HB Chorochronic duplication

Computes the chorochronic duplication of a HB/TSM computation.


Input Parameters

The following keys can be set:

  • base – (type = antares.Base ) – The Base that will be chorochronically duplicated

  • coordinates – (type = tuple/list of variables ) – The variables that serves as a basis for the duplication, it is assumed that these are in cartesian coordinates

  • vectors – (default = [], type = tuple/list of tuples of variables ) – If the base contains vectors, these must be rotated, so put them here. It is assumed that these are in cartesian coordinates

  • hb_computation – (default = in_attr, type = antares.HbComputation, can use in_attr = yes ) – The object that defines the attributes of the current HB/TSM computation

  • nb_duplication – (default = in_attr, type = int, can use in_attr = yes ) – The number of duplications

  • pitch – (default = in_attr, type = int/float, can use in_attr = yes ) – The pitch of the current row

  • omega – (default = 0.0, type = int/float, can use in_attr = yes ) – Rotation speed expressed in radians per second so that the mesh can be rotated accordingly

  • time – (default = 0.0, type = float ) – 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

antares.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()