Meridional Line

Description

Create hub and shroud meridional lines from hub and shroud mesh surfaces described by families in a tri-dimensional mesh.

image

Construction

import antares
myt = antares.Treatment('MeridionalLine')

Parameters

  • base: Base

    The input base.

  • families: dict

    Complex data structure that contains the family names associated to some turbomachine entities. The turbomachine entities described are the rows (‘ROWS’), the hub part concerned by the rows (‘HUB’), the shroud part concerned by the rows (‘SHROUD’). Each entity (key of the dictionary) contains a list which size is the number of turbomachine rows. The rows must be ordered from the inlet to the outlet of the machine. This is the same order for the list elements. Each element of this list is another list containing the family names that characterize this entity in the specific row.

    Example: Description of a machine with 4 rows ordered from the inlet to the outlet of the machine.

    archi_fams = {
      'ROWS':    [['ROW1'],    ['ROW2'],    ['ROW3'],    ['ROW4']],
      'HUB':     [['HUB1'],    ['HUB2'],    ['HUB3'],    ['HUB4', 'STATIC_H4']],
      'SHROUD':  [['SHROUD1'], ['SHROUD2'], ['SHROUD3'], ['SHROUD4']]
    }
    
  • coordinates: list(str), default= antares.core.GlobalVar.coordinates

    The ordered names of the mesh cartesian coordinates.

Preconditions

The input base must contain the families detailed in the parameter families.

Postconditions

The treatment returns:

  • ndarray with points that define the hub meridional line.

  • ndarray with points that define the shroud meridional line.

Example

import antares
myt = antares.Treatment('MeridionalLine')
myt['base'] = base
myt['families'] = archi_fams
hub_points, shroud_points = myt.execute()

Main functions

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

Compute hub and shroud meridional lines from mesh surfaces.

Returns:

Points that define the hub meridional line

Return type:

ndarray

Returns:

Points that define the shroud meridional line

Return type:

ndarray

Example

import os

import antares

import numpy as np

import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.use('Agg')
font = {'family':'serif','weight':'medium','size':40}
mpl.rc('font', **font)
mpl.rcParams['axes.linewidth'] = 2.0

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

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

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

print(base.families)

archi_fams = {
    'ROWS':   [['superblock_0000']],
    'HUB':    [['HUB']],
    'SHROUD': [['CASING']]
}

tre = antares.Treatment('MeridionalLine')
tre['base'] = base
tre['families'] = archi_fams
hub_points, shroud_points = tre.execute()

# Definition of the treatment
tr = antares.Treatment('hH')
tr['base'] = base
tr['families'] = ['superblock_0000']
tr['hub_pts'] = hub_points
tr['shroud_pts'] = shroud_points
tr['extension'] = 0.1
tr['output_dir'] = output
hhbase, paramgrid = tr.execute()

print(hhbase[0][0])

writer = antares.Writer('bin_tp')
writer['filename'] = os.path.join(output, 'ex_hh.plt')
writer['base'] = hhbase
writer.dump()
writer = antares.Writer('bin_tp')
writer['filename'] = os.path.join(output, 'ex_paramgrid.plt')
writer['base'] = paramgrid
writer.dump()

archi_fams = {
    'ROWS':    [['superblock_0000']],
    'HUB':     [['HUB']],
    'SHROUD':  [['CASING']],
    'INLETS':  [['INLET']],
    'OUTLETS': [['OUTLET']],
    'BLADES':  [ {'SKIN': [ ['BLADE'] ],
                  'TIP': [ [] ]}
               ]
}

tre = antares.Treatment('meridionalview')
tre['base'] = base
tre['param_grid'] = paramgrid
tre['families'] = archi_fams
tre['hub_pts'] = hub_points
tre['shroud_pts'] = shroud_points
tre['extension'] = 0.1
tre['height_value'] = 0.1
component = tre.execute()

# ---------------------------------------
# Display geometry
# ---------------------------------------
fig = plt.figure(figsize=(30,20), dpi=300, facecolor='w', edgecolor='k')
ax = fig.add_subplot(111)
ax.set_aspect('equal', adjustable='datalim')
meridional_lines = {}
meridional_lines['Hub'] = hub_points
meridional_lines['Shroud'] = shroud_points
for idx, row in enumerate(component['Row']):
    for jdx, blade in enumerate(row['Blade']):
        list_of_points = blade['profiles']
        for i, profile_3D in enumerate(list_of_points):
            name = 'row_%d_blade_%d_%d' % (idx, jdx, i)
            line = np.zeros((np.shape(profile_3D)[0], 2))
            line[:, 0] = profile_3D[:, 0]
            y = profile_3D[:, 1]
            z = profile_3D[:, 2]
            line[:, 1] = np.sqrt(y**2 + z**2)
            meridional_lines[name] = line
            i += 1

for part in meridional_lines.keys():
    ax.plot(meridional_lines[part][:, 0], meridional_lines[part][:, 1], linewidth=6)

for row in component['Row']:
    ax.plot(row['inletMeridionalPoints'][:, 0],  row['inletMeridionalPoints'][:, 1], linewidth=6)
    ax.plot(row['outletMeridionalPoints'][:, 0], row['outletMeridionalPoints'][:, 1], linewidth=6)
    for blade in row['Blade']:
        ax.plot(blade['LE'][:, 0], blade['LE'][:, 1], linewidth=6)
        ax.plot(blade['TE'][:, 0], blade['TE'][:, 1], linewidth=6)
        if 'rootMeridionalPoints' in blade:
            ax.plot(blade['rootMeridionalPoints'][:, 0],
                    blade['rootMeridionalPoints'][:, 1], linewidth=6)
        if 'tipMeridionalPoints' in blade:
            ax.plot(blade['tipMeridionalPoints'][:, 0],
                    blade['tipMeridionalPoints'][:, 1], linewidth=6)

ax.tick_params(which='major', width=2, length=20)
plt.savefig(os.path.join(output, 'meridional_view.png'), bbox_inches='tight')
plt.close()