Extraction of variables along a profile of a blade at a given radius

Extraction of variables along a profile of a blade at a given radius


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)

  • coordinates – (type = list(str) ) – The name of the variables that defines the mesh.

  • family_name – (type = str ) – The name of the family from which the percent will be computed and on which the cut is computed.

  • percent – (default = None, type = float or None ) – The percentage relative to the family to determine the absolute position value.

  • position – (default = None, type = float or None ) – The absolute position value relative to the family

Main functions

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

Extraction of variables along a profile of a blade at a given radius.

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)


# Extraction on blade
res_dir = os.path.join('OUTPUT', 'ON_BLADE')
if not os.path.isdir(res_dir):
    os.makedirs(res_dir)

t = Treatment('extractbladeline')
t['base'] = base
t['family_name'] = 'BLADE'
t['percent'] = 0.75
t['coordinates'] = ['x', 'y', 'z']
ex_on_blade = t.execute()

writer = Writer('column')
writer['filename'] = os.path.join(res_dir, 'extract_on_blade.dat')
writer['base'] = ex_on_blade
writer.dump()