# Slice at a radial position¶

## Input Parameters¶

The following keys can be set:

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

• 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

• nb_duplication – (default = in_attr, type = int or default string ‘in_attr’, can use in_attr = yes ) – number of duplications to apply after doing the radial cut if duplicate is True. If set to ‘in_attr’, then it is computed from ‘nb_blade’ in Instant.attrs

• duplicate – (default = False, type = boolean ) – duplication of the radial cut. Chorochronic if HB/TSM type

• 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 of the cut

• position – (default = None, type = float or None ) – The absolute position value relative to the family where the cut must be made

## Main functions¶

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

Execute the treatment.

This method performs a cut at a radial position. Either the radius value is given, or it is computed knowing the family name and the percentage. The latter are used to determine the absolute position of the cut.

Returns

Return type

None or antares.Base

## Example¶

import os

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

import numpy as np

from antares import Reader, Treatment, Writer

#

# https://cerfacs.fr/antares/tutorial/application/application1/application1_tutorial_data.tgz

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
print(base.families)

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

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')
base.compute('R')
P0_INF = 1.9
base.compute('MachIs = (((%f/psta)**((gamma-1)/gamma)-1.) * (2./(gamma-1.))  )**0.5' % P0_INF)

res_dir = os.path.join('OUTPUT', 'SLICER')
if not os.path.isdir(res_dir):
os.makedirs(res_dir)

t = Treatment('slicer')
t['base'] = base

writer = Writer('bin_tp')

NUM = 9
x = np.linspace(18., 25.5, NUM)
for i in range(0, NUM):
print('cut at r = {}'.format(x[i]))

t['position'] = x[i]
base = t.execute()

writer['filename'] = os.path.join(res_dir, 'slicer_%i.plt' % x[i])
writer['base'] = base
writer.dump()