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.


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


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 the treatment.


Return type



import os

if not os.path.isdir('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',
r['zone_prefix'] = 'Block'
r['topology_file'] = os.path.join('..', 'data', 'ROTOR37', 'ELSA_CASE',
r['shared'] = True
base = r.read()

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


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

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):

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')]