9.0
general documentation
Loading...
Searching...
No Matches
cs_turbomachinery.h File Reference
#include "base/cs_defs.h"
#include "base/cs_restart.h"
Include dependency graph for cs_turbomachinery.h:

Go to the source code of this file.

Enumerations

enum  cs_turbomachinery_model_t { CS_TURBOMACHINERY_NONE , CS_TURBOMACHINERY_FROZEN , CS_TURBOMACHINERY_TRANSIENT }

Functions

void cs_turbomachinery_set_model (cs_turbomachinery_model_t model)
 Define rotor/stator model.
cs_turbomachinery_model_t cs_turbomachinery_get_model (void)
 Return rotor/stator model.
int cs_turbomachinery_get_n_couplings (void)
 Return number of boundary couplings used for rotor/stator model.
void cs_turbomachinery_add_rotor (const char *cell_criteria, double rotation_velocity, const double rotation_axis[3], const double rotation_invariant[3])
 Define a rotor by its axis and cell selection criteria.
int cs_turbomachinery_join_add (const char *sel_criteria, float fraction, float plane, int verbosity, int visualization)
 Add a cs_join_t structure to the list of rotor/stator joinings.
int cs_turbomachinery_coupling_add (const char *sel_criteria, float tolerance, int verbosity)
 Add a boundary coupling to the list of rotor/stator couplings.
void cs_turbomachinery_define (void)
 Definitions for turbomachinery computation.
void cs_turbomachinery_initialize (void)
 Initializations for turbomachinery computation.
void cs_turbomachinery_finalize (void)
 Free turbomachinery structure.
void cs_turbomachinery_update_mesh (double *t_elapsed)
 Update mesh for unsteady rotor/stator computation.
void cs_turbomachinery_restart_mesh (void)
 Update mesh for unsteady rotor/stator computation in case of restart.
void cs_turbomachinery_reinit_i_face_fields (void)
 Reinitialize interior face-based fields.
void cs_turbomachinery_resize_cell_fields (void)
 Resize cell-based fields.
void cs_turbomachinery_rotation_matrix (int rotor_num, double theta, cs_real_t matrix[3][4])
 Compute rotation matrix.
int cs_turbomachinery_n_rotors (void)
 Return number of rotors.
const int * cs_turbomachinery_get_cell_rotor_num (void)
 Return cell rotor number.
void cs_turbomachinery_get_wall_bc_coeffs (cs_real_t **coftur, cs_real_t **hfltur)
 Get arrays associated to wall BC update.
double cs_turbomachinery_get_rotation_velocity (int rotor_num)
 Return rotation velocity.
void cs_turbomachinery_set_rotation_velocity (int rotor_num, double omega)
 Set rotation velocity.
cs_real_34_tcs_turbomachinery_get_rotation_matrices (double dt)
 Build rotation matrices for a given time interval.
void cs_turbomachinery_set_rotation_retry (int n_max_join_retries, double dt_retry_multiplier)
 Set turbomachinery joining retry parameters.
void cs_turbomachinery_rotate_fields (const cs_real_t dt[])
 Rotation of vector and tensor fields.
void cs_turbomachinery_relative_velocity (int rotor_num, const cs_real_t coords[3], cs_real_t velocity[3])
 Compute velocity relative to fixed coordinates at a given point.
void cs_turbomachinery_restart_read (cs_restart_t *r)
 Read turbomachinery metadata from restart file.
void cs_turbomachinery_restart_write (cs_restart_t *r)
 Write turbomachinery metadata to checkpoint file.
void cs_turbomachinery_define_functions (void)
 Create or access function objects specific to turbomachinery models (relative_pressure, relative_velocity).

Enumeration Type Documentation

◆ cs_turbomachinery_model_t

Enumerator
CS_TURBOMACHINERY_NONE 
CS_TURBOMACHINERY_FROZEN 
CS_TURBOMACHINERY_TRANSIENT 

Function Documentation

◆ cs_turbomachinery_add_rotor()

void cs_turbomachinery_add_rotor ( const char * cell_criteria,
double rotation_velocity,
const double rotation_axis[3],
const double rotation_invariant[3] )

Define a rotor by its axis and cell selection criteria.

Parameters
[in]cell_criteriacell selection criteria string
[in]rotation_velocityrotation velocity, in radians/second
[in]rotation_axisrotation axis vector
[in]rotation_invariantrotation invariant point

◆ cs_turbomachinery_coupling_add()

int cs_turbomachinery_coupling_add ( const char * sel_criteria,
float tolerance,
int verbosity )

Add a boundary coupling to the list of rotor/stator couplings.

Parameters
[in]sel_criteriaboundary face selection criteria
[in]tolerancevalue of the search tolerance
[in]verbositylevel of verbosity required
Returns
number (1 to n) associated with new coupling

◆ cs_turbomachinery_define()

void cs_turbomachinery_define ( void )

Definitions for turbomachinery computation.

◆ cs_turbomachinery_define_functions()

void cs_turbomachinery_define_functions ( void )

Create or access function objects specific to turbomachinery models (relative_pressure, relative_velocity).

◆ cs_turbomachinery_finalize()

void cs_turbomachinery_finalize ( void )

Free turbomachinery structure.

◆ cs_turbomachinery_get_cell_rotor_num()

const int * cs_turbomachinery_get_cell_rotor_num ( void )

Return cell rotor number.

Each cell may be associated with a given rotor, or rotation, with 0 indicating that that cell does not rotate.

Returns
array defining rotor number associated with each cell (0 for none, 1 to n otherwise)

◆ cs_turbomachinery_get_model()

cs_turbomachinery_model_t cs_turbomachinery_get_model ( void )

Return rotor/stator model.

◆ cs_turbomachinery_get_n_couplings()

int cs_turbomachinery_get_n_couplings ( void )

Return number of boundary couplings used for rotor/stator model.

Joining-based definitions are not counted here.

Returns
number of boundary couplings used for rotor/stator model.

◆ cs_turbomachinery_get_rotation_matrices()

cs_real_34_t * cs_turbomachinery_get_rotation_matrices ( double dt)

Build rotation matrices for a given time interval.

The caller is responsible for freeing the array when not needed.

Parameters
[in]dtassociated time delta (0 for current, unmodified time)
Returns
array of rotation matrices.

◆ cs_turbomachinery_get_rotation_velocity()

double cs_turbomachinery_get_rotation_velocity ( int rotor_num)

Return rotation velocity.

Parameters
[in]rotor_numrotor number (1 to n numbering)

◆ cs_turbomachinery_get_wall_bc_coeffs()

void cs_turbomachinery_get_wall_bc_coeffs ( cs_real_t ** coftur,
cs_real_t ** hfltur )

Get arrays associated to wall BC update.

Parameters
[out]cofturvalues of "cofimp" term before geometry update
[out]hflturlocal exchange coefficient before geometry update

◆ cs_turbomachinery_initialize()

void cs_turbomachinery_initialize ( void )

Initializations for turbomachinery computation.

Note
This function should be called after the mesh is built, but before cs_post_init_meshes() so that postprocessing meshes are updated correctly in the transient case.

◆ cs_turbomachinery_join_add()

int cs_turbomachinery_join_add ( const char * sel_criteria,
float fraction,
float plane,
int verbosity,
int visualization )

Add a cs_join_t structure to the list of rotor/stator joinings.

Parameters
[in]sel_criteriaboundary face selection criteria
[in]fractionvalue of the fraction parameter
[in]planevalue of the plane parameter
[in]verbositylevel of verbosity required
[in]visualizationlevel of visualization required
Returns
number (1 to n) associated with new joining

◆ cs_turbomachinery_n_rotors()

int cs_turbomachinery_n_rotors ( void )

Return number of rotors.

Note that the number of associated rotations is n_rotors + 1, as the first rotation id is reserved for the fixed portion of the domain.

Returns
number of rotors

◆ cs_turbomachinery_reinit_i_face_fields()

void cs_turbomachinery_reinit_i_face_fields ( void )

Reinitialize interior face-based fields.

◆ cs_turbomachinery_relative_velocity()

void cs_turbomachinery_relative_velocity ( int rotor_num,
const cs_real_t coords[3],
cs_real_t velocity[3] )

Compute velocity relative to fixed coordinates at a given point.

Deprecated
Use cs_rotation_velocity for more consistent naming of this reference frame velocity.
Parameters
[in]rotor_numrotor number (1 to n numbering)
[in]coordspoint coordinates
[out]velocityvelocity relative to fixed coordinates

◆ cs_turbomachinery_resize_cell_fields()

void cs_turbomachinery_resize_cell_fields ( void )

Resize cell-based fields.

This function only handles fields owning their values.

◆ cs_turbomachinery_restart_mesh()

void cs_turbomachinery_restart_mesh ( void )

Update mesh for unsteady rotor/stator computation in case of restart.

Reads mesh from checkpoint when available.

◆ cs_turbomachinery_restart_read()

void cs_turbomachinery_restart_read ( cs_restart_t * r)

Read turbomachinery metadata from restart file.

The mesh is handled separately.

Parameters
[in,out]rassociated restart file pointer

◆ cs_turbomachinery_restart_write()

void cs_turbomachinery_restart_write ( cs_restart_t * r)

Write turbomachinery metadata to checkpoint file.

The mesh is handled separately.

Parameters
[in,out]rassociated restart file pointer

◆ cs_turbomachinery_rotate_fields()

void cs_turbomachinery_rotate_fields ( const cs_real_t dt[])

Rotation of vector and tensor fields.

◆ cs_turbomachinery_rotation_matrix()

void cs_turbomachinery_rotation_matrix ( int rotor_num,
double theta,
cs_real_t matrix[3][4] )

Compute rotation matrix.

Parameters
[in]rotor_numrotor number (1 to n numbering)
[in]thetarotation angle, in radians
[out]matrixresulting rotation matrix

◆ cs_turbomachinery_set_model()

void cs_turbomachinery_set_model ( cs_turbomachinery_model_t model)

Define rotor/stator model.

◆ cs_turbomachinery_set_rotation_retry()

void cs_turbomachinery_set_rotation_retry ( int n_max_join_retries,
double dt_retry_multiplier )

Set turbomachinery joining retry parameters.

When a joing leads to a different number of boundary faces from the previous position, the rotor positions may be perturbed by a small quantity to try to obtain a better joining.

param[in] n_max_join_retries maximum number of retries before considering the joining has failed param[in] dt_retry_multiplier time step multiplier for new position retry

◆ cs_turbomachinery_set_rotation_velocity()

void cs_turbomachinery_set_rotation_velocity ( int rotor_num,
double omega )

Set rotation velocity.

param[in] rotor_num rotor number (1 to n numbering) param[in] omega rotation velocity

◆ cs_turbomachinery_update_mesh()

void cs_turbomachinery_update_mesh ( double * t_elapsed)

Update mesh for unsteady rotor/stator computation.

Parameters
[out]t_elapsedelapsed computation time