#include "cs_boundary.h"
#include "cs_cdo_turbulence.h"
#include "cs_equation_param.h"
#include "cs_iter_algo.h"
#include "cs_math.h"
#include "cs_param_sles.h"
#include "cs_physical_constants.h"
Go to the source code of this file.
Data Structures | |
struct | cs_navsto_param_sles_t |
struct | cs_navsto_param_boussinesq_t |
Structure storing the parameters related to the Boussinesq source term in the momentum equation. More... | |
struct | cs_navsto_param_t |
Structure storing the parameters related to the resolution of the Navier-Stokes system. More... | |
Macros | |
#define | CS_NAVSTO_STREAM_EQNAME "streamfunction_eq" |
Typedefs | |
typedef cs_flag_t | cs_navsto_param_model_flag_t |
typedef cs_flag_t | cs_navsto_param_post_flag_t |
Functions | |
static bool | cs_navsto_param_is_steady (const cs_navsto_param_t *nsp) |
Ask cs_navsto_param_t structure if the settings correspond to a steady computation. More... | |
cs_navsto_param_t * | cs_navsto_param_create (const cs_boundary_t *boundaries, cs_navsto_param_model_t model, cs_navsto_param_model_flag_t model_flag, cs_navsto_param_coupling_t algo_coupling, cs_navsto_param_post_flag_t post_flag) |
Create a new structure to store all numerical parameters related to the resolution of the Navier-Stokes (NS) system. More... | |
cs_navsto_param_t * | cs_navsto_param_free (cs_navsto_param_t *param) |
Free a cs_navsto_param_t structure. More... | |
void | cs_navsto_param_set (cs_navsto_param_t *nsp, cs_navsto_key_t key, const char *keyval) |
Set a parameter attached to a keyname in a cs_navsto_param_t structure. More... | |
void | cs_navsto_param_transfer (const cs_navsto_param_t *nsp, cs_equation_param_t *eqp) |
Apply the numerical settings defined for the Navier-Stokes system to an equation related to this system. Be aware that the user-defined settings can be modified in this function when a different choice is set between the settings for the Navier-Stokes system and the settings for the momentum equation. The final choice is given by the settings for the Navier-Stokes system. More... | |
void | cs_navsto_param_log (const cs_navsto_param_t *nsp) |
Summary of the main cs_navsto_param_t structure. More... | |
cs_navsto_param_boussinesq_t * | cs_navsto_param_add_boussinesq_term (cs_navsto_param_t *nsp, cs_real_t dilatation_coef, cs_real_t reference_value) |
Add a new Boussinesq term (source term for the momemtum equation) More... | |
void | cs_navsto_param_set_boussinesq_array (cs_navsto_param_boussinesq_t *bp, const cs_real_t *var) |
Set the array of values to consider in the Boussinesq term. More... | |
cs_equation_param_t * | cs_navsto_param_get_velocity_param (const cs_navsto_param_t *nsp) |
Retrieve the cs_equation_param_t structure related to the velocity equation (momentum equation in most of the cases) More... | |
const char * | cs_navsto_param_get_model_name (cs_navsto_param_model_t model) |
Retrieve the name of the model system of equations. More... | |
const char * | cs_navsto_param_get_coupling_name (cs_navsto_param_coupling_t coupling) |
Retrieve the name of the coupling algorithm. More... | |
void | cs_navsto_param_set_quadrature_to_all (cs_navsto_param_t *nsp, cs_quadrature_type_t qtype) |
Apply the given quadrature rule to all existing definitions under the cs_navsto_param_t structure. More... | |
void | cs_navsto_set_reference_pressure (cs_navsto_param_t *nsp, cs_real_t pref) |
Set the value to consider for the reference pressure. More... | |
cs_xdef_t * | cs_navsto_add_velocity_ic_by_value (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val) |
Define the initial condition for the velocity unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set to a constant value. More... | |
cs_xdef_t * | cs_navsto_add_velocity_ic_by_analytic (cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *analytic, void *input) |
Define the initial condition for the velocity unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function. More... | |
cs_xdef_t * | cs_navsto_add_pressure_ic_by_value (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val) |
Define the initial condition for the pressure unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set to a constant value. More... | |
cs_xdef_t * | cs_navsto_add_pressure_ic_by_analytic (cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *analytic, void *input) |
Define the initial condition for the pressure unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function. More... | |
void | cs_navsto_set_fixed_walls (cs_navsto_param_t *nsp) |
Add the definition of boundary conditions related to a fixed wall into the set of parameters for the management of the Navier-Stokes system of equations. More... | |
void | cs_navsto_set_symmetries (cs_navsto_param_t *nsp) |
Add the definition of boundary conditions related to a symmetry into the set of parameters for the management of the Navier-Stokes system of equations. More... | |
void | cs_navsto_set_outlets (cs_navsto_param_t *nsp) |
Add the definition of boundary conditions related to outlets into the set of parameters for the management of the Navier-Stokes system of equations. More... | |
cs_xdef_t * | cs_navsto_set_pressure_bc_by_value (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values) |
Set the pressure field on a boundary using a uniform value. More... | |
cs_xdef_t * | cs_navsto_set_velocity_wall_by_value (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values) |
Define the velocity field for a sliding wall boundary using a uniform value. More... | |
cs_xdef_t * | cs_navsto_set_velocity_inlet_by_value (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *values) |
Define the velocity field for an inlet boundary using a uniform value. More... | |
cs_xdef_t * | cs_navsto_set_velocity_inlet_by_analytic (cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *ana, void *input) |
Define the velocity field for an inlet boundary using an analytical function. More... | |
cs_xdef_t * | cs_navsto_set_velocity_inlet_by_array (cs_navsto_param_t *nsp, const char *z_name, cs_flag_t loc, cs_real_t *array, bool is_owner, bool full_length) |
Define the velocity field for an inlet boundary using an array of values. More... | |
cs_xdef_t * | cs_navsto_set_velocity_inlet_by_dof_func (cs_navsto_param_t *nsp, const char *z_name, cs_flag_t dof_loc, cs_dof_func_t *func, void *func_input) |
Define the velocity field for an inlet boundary using a DoF function. More... | |
cs_xdef_t * | cs_navsto_add_source_term_by_analytic (cs_navsto_param_t *nsp, const char *z_name, cs_analytic_func_t *ana, void *input) |
Define a new source term structure defined by an analytical function. More... | |
cs_xdef_t * | cs_navsto_add_source_term_by_val (cs_navsto_param_t *nsp, const char *z_name, cs_real_t *val) |
Define a new source term structure defined by a constant value. More... | |
cs_xdef_t * | cs_navsto_add_source_term_by_array (cs_navsto_param_t *nsp, const char *z_name, cs_flag_t loc, cs_real_t *array, bool is_owner, bool full_length) |
Define a new source term structure defined by an array. More... | |
void | cs_navsto_add_oseen_field (cs_navsto_param_t *nsp, cs_adv_field_t *adv_fld) |
Add a advection field for the Oseen problem. More... | |
#define CS_NAVSTO_STREAM_EQNAME "streamfunction_eq" |
typedef cs_flag_t cs_navsto_param_post_flag_t |
enum cs_navsto_key_t |
List of available keys for setting the parameters of the Navier-Stokes system.
Enumerator | |
---|---|
CS_NSKEY_DOF_REDUCTION | Set how the DoFs are defined (similar to CS_EQKEY_DOF_REDUCTION) Enable to set this type of DoFs definition for all related equations |
CS_NSKEY_NL_ALGO | Type of algorithm to consider to solve the non-linearity arising from the Navier-Stokes system (Picard or Anderson) |
CS_NSKEY_NL_ALGO_ATOL | Absolute tolerance at which the non-linearity arising from the advection term is resolved |
CS_NSKEY_NL_ALGO_DTOL | Threshold at which the non-linear algorithm is set as diverged |
CS_NSKEY_NL_ALGO_MAX_ITER | Set the maximal number of iterations for solving the non-linearity arising from the advection form |
CS_NSKEY_NL_ALGO_RTOL | Relative tolerance at which the non-linearity arising from the advection term is resolved |
CS_NSKEY_SPACE_SCHEME | Numerical scheme for the space discretization. Available choices are:
|
CS_NSKEY_THERMAL_TOLERANCE | Value of the tolerance criterion under which one stops iterating on the Navier-Stokes and thermal systems |
CS_NSKEY_VERBOSITY | Set the level of details for the specific part related to the Navier-Stokes system |
CS_NSKEY_N_KEYS |
Choice of algorithm for solving the system.
Bit values for additional physical modelling related to the Navier-Stokes system of equations.
Enumerator | |
---|---|
CS_NAVSTO_MODEL_STEADY | There is no time dependency in the model |
CS_NAVSTO_MODEL_GRAVITY_EFFECTS | Take into account the gravity effects (add a constant source term equal to rho*vect(g)) |
CS_NAVSTO_MODEL_CORIOLIS_EFFECTS | Take into account the Coriolis effects (add a source term) |
CS_NAVSTO_MODEL_PASSIVE_THERMAL_TRACER | An additional equation is created involving the thermal equation. The advection field is automatically set as the mass flux. By default, the temperature is solved in Celsius and homogeneous Neumann boundary conditions (no flux) are set. This option is not compatible with the option CS_NAVSTO_MODEL_BOUSSINESQ |
CS_NAVSTO_MODEL_BOUSSINESQ | An additional equation is created involving the thermal equation. The advection field is automatically set as the mass flux. By default, the temperature is solved in Celsius and homogeneous Neumann boundary conditions (no flux) are set. The variation of mass density around a reference value is related to the variation of temperature w.r.t. a reference temperature and it plays a role in the gravity effects (rho.vect(g)) The gradient of temperature is assumed to have a small norm and the mass density variates in a small range. In this case, an additional momentum source term is added. |
CS_NAVSTO_MODEL_WITH_SOLIDIFICATION | The Navier-Stokes is modified to take into account solidification process. A boussinesq term is added as well as a head loss term derived from a Darcy approximation. Please see the cs_solidification_model_t structure and related structures for more details |
Describe the system of equations related to the Navier-Stokes to be solved.
Enumerator | |
---|---|
CS_NAVSTO_MODEL_STOKES | Stokes equations (mass and momentum) with the classical choice of variables i.e. velocity and pressure. Mass density is assumed to be constant. |
CS_NAVSTO_MODEL_OSEEN | Like the incompressible Navier-Stokes equations (mass and momentum) but with a velocity field which is given. Thus the advection term in the momentum equation is linear. Unknowns: velocity and pressure. Mass density is assumed to be constant. The advection field is set using cs_navsto_add_oseen_field |
CS_NAVSTO_MODEL_INCOMPRESSIBLE_NAVIER_STOKES | Navier-Stokes equations: mass and momentum with a constant mass density Mass equation is equivalent to an incompressibility constraint |
CS_NAVSTO_N_MODELS |
Bit values for additional generic postprocessing related to the Navier-Stokes module. In what follows, w denotes the vorticity vector, u the velocity vector and k the kinetic energy defined by .
void cs_navsto_add_oseen_field | ( | cs_navsto_param_t * | nsp, |
cs_adv_field_t * | adv_fld | ||
) |
Add a advection field for the Oseen problem.
[in,out] | nsp | pointer to a cs_navsto_param_t |
[in,out] | adv_fld | pointer to a cs_adv_field_t |
cs_xdef_t * cs_navsto_add_pressure_ic_by_analytic | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_analytic_func_t * | analytic, | ||
void * | input | ||
) |
Define the initial condition for the pressure unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function |
[in] | input | null or pointer to a structure cast on-the-fly |
cs_xdef_t * cs_navsto_add_pressure_ic_by_value | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define the initial condition for the pressure unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set to a constant value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" if all cells are considered) |
[in] | val | pointer to the value |
cs_xdef_t * cs_navsto_add_source_term_by_analytic | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_analytic_func_t * | ana, | ||
void * | input | ||
) |
Define a new source term structure defined by an analytical function.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all cells are considered) |
[in] | ana | pointer to an analytical function |
[in] | input | null or pointer to a structure cast on-the-fly |
cs_xdef_t * cs_navsto_add_source_term_by_array | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_flag_t | loc, | ||
cs_real_t * | array, | ||
bool | is_owner, | ||
bool | full_length | ||
) |
Define a new source term structure defined by an array.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all cells are considered) |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | is_owner | transfer the lifecycle to the cs_xdef_t structure (true or false) |
[in] | full_length | if true, array size is allocated and filled to access the full-length array corresponding to all locations where are defined the values |
cs_xdef_t * cs_navsto_add_source_term_by_val | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define a new source term structure defined by a constant value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all cells are considered) |
[in] | val | pointer to the value to set |
cs_xdef_t * cs_navsto_add_velocity_ic_by_analytic | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_analytic_func_t * | analytic, | ||
void * | input | ||
) |
Define the initial condition for the velocity unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set according to an analytical function.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" if all cells are considered) |
[in] | analytic | pointer to an analytic function |
[in] | input | null or pointer to a structure cast on-the-fly |
cs_xdef_t * cs_navsto_add_velocity_ic_by_value | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | val | ||
) |
Define the initial condition for the velocity unknowns. This definition can be done on a specified mesh location. By default, the unknown is set to zero everywhere. Here the initial value is set to a constant value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" if all cells are considered) |
[in] | val | pointer to the value |
cs_navsto_param_boussinesq_t * cs_navsto_param_add_boussinesq_term | ( | cs_navsto_param_t * | nsp, |
cs_real_t | dilatation_coef, | ||
cs_real_t | reference_value | ||
) |
Add a new Boussinesq term (source term for the momemtum equation)
[in,out] | nsp | pointer to a cs_navsto_param_t struct. |
[in] | dilatation_coef | value of the dilatation coefficient |
[in] | reference_value | reference value of the associated variable |
cs_navsto_param_t * cs_navsto_param_create | ( | const cs_boundary_t * | boundaries, |
cs_navsto_param_model_t | model, | ||
cs_navsto_param_model_flag_t | model_flag, | ||
cs_navsto_param_coupling_t | algo_coupling, | ||
cs_navsto_param_post_flag_t | post_flag | ||
) |
Create a new structure to store all numerical parameters related to the resolution of the Navier-Stokes (NS) system.
[in] | boundaries | pointer to a cs_boundary_t structure |
[in] | model | type of model related to the NS system |
[in] | model_flag | additional high-level model options |
[in] | algo_coupling | algorithm used for solving the NS system |
[in] | post_flag | predefined post-processings options |
cs_navsto_param_t * cs_navsto_param_free | ( | cs_navsto_param_t * | param | ) |
Free a cs_navsto_param_t structure.
[in,out] | param | pointer to a cs_navsto_param_t structure |
const char * cs_navsto_param_get_coupling_name | ( | cs_navsto_param_coupling_t | coupling | ) |
Retrieve the name of the coupling algorithm.
[in] | coupling | a cs_navsto_param_coupling_t |
const char * cs_navsto_param_get_model_name | ( | cs_navsto_param_model_t | model | ) |
Retrieve the name of the model system of equations.
[in] | model | a cs_navsto_param_model_t |
cs_equation_param_t * cs_navsto_param_get_velocity_param | ( | const cs_navsto_param_t * | nsp | ) |
Retrieve the cs_equation_param_t structure related to the velocity equation (momentum equation in most of the cases)
[in] | nsp | pointer to a cs_navsto_param_t structure |
|
inlinestatic |
Ask cs_navsto_param_t structure if the settings correspond to a steady computation.
[in] | nsp | pointer to a cs_navsto_param_t structure |
void cs_navsto_param_log | ( | const cs_navsto_param_t * | nsp | ) |
Summary of the main cs_navsto_param_t structure.
[in] | nsp | pointer to a cs_navsto_param_t structure |
void cs_navsto_param_set | ( | cs_navsto_param_t * | nsp, |
cs_navsto_key_t | key, | ||
const char * | keyval | ||
) |
Set a parameter attached to a keyname in a cs_navsto_param_t structure.
[in,out] | nsp | pointer to a cs_navsto_param_t structure to set |
[in] | key | key related to the member of eq to set |
[in] | keyval | accessor to the value to set |
void cs_navsto_param_set_boussinesq_array | ( | cs_navsto_param_boussinesq_t * | bp, |
const cs_real_t * | var | ||
) |
Set the array of values to consider in the Boussinesq term.
[in,out] | bp | pointer to a cs_navsto_param_boussinesq_t structure |
[in] | var | shared pointer to the array of values to consider |
void cs_navsto_param_set_quadrature_to_all | ( | cs_navsto_param_t * | nsp, |
cs_quadrature_type_t | qtype | ||
) |
Apply the given quadrature rule to all existing definitions under the cs_navsto_param_t structure.
[in,out] | nsp | pointer to a cs_navsto_param_t structure |
[in] | qtype | type of quadrature to apply |
void cs_navsto_param_transfer | ( | const cs_navsto_param_t * | nsp, |
cs_equation_param_t * | eqp | ||
) |
Apply the numerical settings defined for the Navier-Stokes system to an equation related to this system. Be aware that the user-defined settings can be modified in this function when a different choice is set between the settings for the Navier-Stokes system and the settings for the momentum equation. The final choice is given by the settings for the Navier-Stokes system.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in,out] | eqp | pointer to a cs_equation_param_t structure |
void cs_navsto_set_fixed_walls | ( | cs_navsto_param_t * | nsp | ) |
Add the definition of boundary conditions related to a fixed wall into the set of parameters for the management of the Navier-Stokes system of equations.
[in] | nsp | pointer to a cs_navsto_param_t structure |
void cs_navsto_set_outlets | ( | cs_navsto_param_t * | nsp | ) |
Add the definition of boundary conditions related to outlets into the set of parameters for the management of the Navier-Stokes system of equations.
[in] | nsp | pointer to a cs_navsto_param_t structure |
cs_xdef_t * cs_navsto_set_pressure_bc_by_value | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | values | ||
) |
Set the pressure field on a boundary using a uniform value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | values | value to set |
void cs_navsto_set_reference_pressure | ( | cs_navsto_param_t * | nsp, |
cs_real_t | pref | ||
) |
Set the value to consider for the reference pressure.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | pref | value of the reference pressure |
void cs_navsto_set_symmetries | ( | cs_navsto_param_t * | nsp | ) |
Add the definition of boundary conditions related to a symmetry into the set of parameters for the management of the Navier-Stokes system of equations.
[in] | nsp | pointer to a cs_navsto_param_t structure |
cs_xdef_t * cs_navsto_set_velocity_inlet_by_analytic | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_analytic_func_t * | ana, | ||
void * | input | ||
) |
Define the velocity field for an inlet boundary using an analytical function.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | ana | pointer to an analytical function |
[in] | input | null or pointer to a structure cast on-the-fly |
cs_xdef_t * cs_navsto_set_velocity_inlet_by_array | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_flag_t | loc, | ||
cs_real_t * | array, | ||
bool | is_owner, | ||
bool | full_length | ||
) |
Define the velocity field for an inlet boundary using an array of values.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | loc | information to know where are located values |
[in] | array | pointer to an array |
[in] | is_owner | transfer the lifecycle to the cs_xdef_t structure (true or false) |
[in] | full_length | if true, the size of "array" should be allocated to the total numbers of entities related to the given location. If false, a new list is allocated and filled with the related subset indirection. |
cs_xdef_t * cs_navsto_set_velocity_inlet_by_dof_func | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_flag_t | dof_loc, | ||
cs_dof_func_t * | func, | ||
void * | func_input | ||
) |
Define the velocity field for an inlet boundary using a DoF function.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | dof_loc | where are located DoFs |
[in] | func | pointer to a cs_dof_function_t |
[in] | func_input | null or pointer to a structure cast on-the-fly |
cs_xdef_t * cs_navsto_set_velocity_inlet_by_value | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | values | ||
) |
Define the velocity field for an inlet boundary using a uniform value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | values | array of three real values |
cs_xdef_t * cs_navsto_set_velocity_wall_by_value | ( | cs_navsto_param_t * | nsp, |
const char * | z_name, | ||
cs_real_t * | values | ||
) |
Define the velocity field for a sliding wall boundary using a uniform value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | z_name | name of the associated zone (if null or "" all boundary faces are considered) |
[in] | values | array of three real values |