Radial distribution

Compute the radial distribution by performing an azimuthal average over an ‘x’-plane. The mass-flow variable is used as the averaging variable (\(\displaystyle \rho v_x \partial \theta\))


Input Parameters

The following keys can be set:

  • base – (type = antares.Base ) – A base containing:

    • the mesh coordinates x, y, and z

    • the solution

    • ‘hb_computation’ as an Base.attrs (if HB/TSM type)

  • family_name – (default = None, type = str ) – The name of the family from which the percent will be computed

  • r_percent – (default = None, type = tuple of floats or None ) – the radius value given as a percentage of the radius. The argument should be a tuple of min and max values. This limits the lower/upper bounds of the radial distribution. If not given, the lower/upper bounds of the radial distribution are computed.

  • x_value – (default = None, type = float or None ) – The absolute position value of the plane

  • r_value – (default = None, type = tuple of floats or None ) – the radius value. The argument should be a tuple of min and max values

  • vectors – (default = [], type = tuple/list of tuples of variables ) – if the base contains vectors, they must be rotated. It is assumed that they are expressed in cartesian coordinates

  • var-equ – (default = [], type = list of variables and equations ) – Compute these values/equations on the ‘x’-plane.

Warning

Values and equations must be ordered so as to avoid dependency issues

  • num – (default = 100, type = int ) – the number of points in the radial distribution

Warning

The coordinate variables must be available at node and the integration will be performed on all the other variables

Main functions

class antares.treatment.turbomachine.TreatmentAzimuthalMean.TreatmentAzimuthalMean
execute()

Execute the treatment.

Returns

Return type

antares.Base

Example

import os

if not os.path.isdir('OUTPUT'):
    os.makedirs('OUTPUT')

import numpy as np

from antares import Reader, Treatment, Writer

#

# Data can be downloaded from
# https://cerfacs.fr/antares/tutorial/application/application1/application1_tutorial_data.tgz

r = Reader('bin_tp')
r['filename'] = os.path.join('..', 'data', 'ROTOR37', 'ELSA_CASE', 'MESH',
                             'mesh_<zone>.dat')
r['zone_prefix'] = 'Block'
r['topology_file'] = os.path.join('..', 'data', 'ROTOR37', 'ELSA_CASE',
                                  'script_topo.py')
r['shared'] = True
base = r.read()
print(base.families)

r = Reader('bin_tp')
r['base'] = base
r['filename'] = os.path.join('..', 'data', 'ROTOR37', 'ELSA_CASE', 'FLOW',
                             'flow_<zone>.dat')
r['zone_prefix'] = 'Block'
r['location'] = 'cell'
r.read()

base.set_computer_model('internal')

# Needed for turbomachinery dedicated treatments
base.cell_to_node()
base = base.get_location('node')
print(base.families)

base.compute('psta')
base.compute('Pi')
base.compute('theta')
P0_INF = 1.9
base.compute('MachIs = (((%f/psta)**((gamma-1)/gamma)-1.) * (2./(gamma-1.))  )**0.5' % P0_INF)

# Definition of the treatment
t = Treatment('azimuthalmean')
t['base'] = base
t['family_name'] = 'BLADE'
t['num'] = 60

writer = Writer('column')  # for 2D plot

# Azimuthal mean
res_dir = os.path.join('OUTPUT', 'AZ_MEAN')
if not os.path.isdir(res_dir):
    os.makedirs(res_dir)

NUM = 9
x = np.linspace(-12.5, 12.5, NUM)
for i in range(0, NUM):
    print('radial distribution at x = {}'.format(x[i]))

    t['x_value'] = x[i]
    azim_base = t.execute()

    writer['filename'] = os.path.join(res_dir, 'flow_azim_%i.plt' % x[i])
    writer['base'] = azim_base[:, :, ('R', 'rovx', 'vx', 'ro')]
    writer.dump()