HB Chorochronic duplication

Computes the chorochronic duplication of a HB/TSM computation.

Parameters

  • base: Base

    The input base that will be chorochronically duplicated.

  • coordinates: list(str)

    The variable names that define the set of coordinates used for the duplication. It is assumed that they are cartesian coordinates.

  • vectors: list(tuple(str)), default= []

    If the base contains vectors, they must be rotated, so put them here. It is assumed that they are expressed in the cartesian coordinate system.

  • hb_computation: :class:`.HbComputation or in_attr, default= ‘in_attr’

    The object that defines the attributes of the current HB/TSM computation.

  • nb_duplication: int or in_attr, default= ‘in_attr’

    The number of duplications.

  • pitch: int or float or in_attr, default= ‘in_attr’

    The pitch of the current row.

  • omega: int or float or in_attr, default= 0.

    Rotation speed expressed in radians per second so that the mesh can be rotated accordingly.

  • time: float, default= 0.

    Time instant at which solution is sought.

Initialization

To initialize a Chorochronic duplication object:

>>> treatment = Treatment('hbchoro')

Main functions

class antares.hb.TreatmentHbchoro.TreatmentHbchoro
execute()

Execute the treatment.

Returns

the base containing the results

Return type

Base

Example

"""
This example illustrates the chorochronic duplication
treatment on a single frequency (TSM) computation
"""
import os
if not os.path.isdir('OUTPUT'):
    os.makedirs('OUTPUT')

import numpy as np

from antares import HbComputation, Reader, Treatment, Writer

# ------------------
# Reading the files
# ------------------
reader = Reader('bin_tp')
reader['filename'] = os.path.join('..', 'data', 'HARMONIC_BALANCE', 'flow_<zone>.dat')
reader['n_hbt'] = 1
ini_base = reader.read()

# -------------------------------
# Create an HbComputation object
# -------------------------------
# AEL configuration with IBPA = 8 and nb_blade = 20
hb_comp = HbComputation()
hb_comp['frequencies'] = [6.2344674e-04]
hb_comp['phaselag'] = [2 * np.pi * 8. / 20.]
ini_base.attrs['hb_computation'] = hb_comp

# ------------
# Duplication
# ------------
treatment = Treatment('hbchoro')
treatment['base'] = ini_base
treatment['vectors'] = [('rovx', 'rovy', 'rovz')]
treatment['nb_duplication'] = 20
treatment['pitch'] = 2. * np.pi / 20.
result = treatment.execute()

# -------------------
# Writing the result
# -------------------
writer = Writer('bin_tp')
writer['filename'] = os.path.join('OUTPUT', 'ex_hbchoro.plt')
writer['base'] = result
writer.dump()