8.0
general documentation
cs_navsto_param.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <float.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_base.h"
#include "cs_equation.h"
#include "cs_log.h"
#include "cs_navsto_param.h"
+ Include dependency graph for cs_navsto_param.c:

Functions

double cs_navsto_param_get_notay_scaling (void)
 Retrieve the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha. More...
 
void cs_navsto_param_set_notay_scaling (double scaling_coef)
 Set the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha. More...
 
cs_navsto_param_tcs_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_tcs_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. 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_tcs_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_navsto_param_sles_tcs_navsto_param_get_sles_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...
 
cs_equation_param_tcs_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_set_reference_pressure (cs_navsto_param_t *nsp, cs_real_t pref)
 Set the value to consider for the reference pressure. More...
 
cs_xdef_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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_tcs_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...
 

Function Documentation

◆ cs_navsto_add_oseen_field()

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.

Parameters
[in,out]nsppointer to a cs_navsto_param_t
[in,out]adv_fldpointer to a cs_adv_field_t

◆ cs_navsto_add_pressure_ic_by_analytic()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]analyticpointer to an analytic function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_pressure_ic_by_value()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]valpointer to the value
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_source_term_by_analytic()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]anapointer to an analytical function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_source_term_by_array()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t structure (true or false)
[in]full_lengthif true, array size is allocated and filled to access the full-length array corresponding to all locations where are defined the values
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_source_term_by_val()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all cells are considered)
[in]valpointer to the value to set
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_velocity_ic_by_analytic()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]analyticpointer to an analytic function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_add_velocity_ic_by_value()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" if all cells are considered)
[in]valpointer to the value
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_param_add_boussinesq_term()

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)

Parameters
[in,out]nsppointer to a cs_navsto_param_t struct.
[in]dilatation_coefvalue of the dilatation coefficient
[in]reference_valuereference value of the associated variable
Returns
a pointer to the newly added structure

◆ cs_navsto_param_create()

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.

Parameters
[in]boundariespointer to a cs_boundary_t structure
[in]modeltype of model related to the NS system
[in]model_flagadditional high-level model options
[in]algo_couplingalgorithm used for solving the NS system
[in]post_flagpredefined post-processings options
Returns
a pointer to a new allocated structure

◆ cs_navsto_param_free()

cs_navsto_param_t* cs_navsto_param_free ( cs_navsto_param_t param)

Free a cs_navsto_param_t structure.

Parameters
[in,out]parampointer to a cs_navsto_param_t structure
Returns
a NULL pointer

◆ cs_navsto_param_get_coupling_name()

const char* cs_navsto_param_get_coupling_name ( cs_navsto_param_coupling_t  coupling)

Retrieve the name of the coupling algorithm.

Parameters
[in]couplinga cs_navsto_param_coupling_t
Returns
the name

◆ cs_navsto_param_get_model_name()

const char* cs_navsto_param_get_model_name ( cs_navsto_param_model_t  model)

Retrieve the name of the model system of equations.

Parameters
[in]modela cs_navsto_param_model_t
Returns
the corresponding name

◆ cs_navsto_param_get_notay_scaling()

double cs_navsto_param_get_notay_scaling ( void  )

Retrieve the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha.

Returns
the value of the scaling coefficient

◆ cs_navsto_param_get_sles_param()

cs_navsto_param_sles_t* cs_navsto_param_get_sles_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)

Parameters
[in]nsppointer to a cs_navsto_param_t structure
Returns
a pointer to the set of SLES parameters

◆ cs_navsto_param_get_velocity_param()

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)

Parameters
[in]nsppointer to a cs_navsto_param_t structure
Returns
a pointer to the set of parameters related to the momentum equation

◆ cs_navsto_param_log()

void cs_navsto_param_log ( const cs_navsto_param_t nsp)

Summary of the main cs_navsto_param_t structure.

Parameters
[in]nsppointer to a cs_navsto_param_t structure

◆ cs_navsto_param_set()

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.

Parameters
[in,out]nsppointer to a cs_navsto_param_t structure to set
[in]keykey related to the member of eq to set
[in]keyvalaccessor to the value to set

◆ cs_navsto_param_set_boussinesq_array()

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.

Parameters
[in,out]bppointer to a cs_navsto_param_boussinesq_t structure
[in]varshared pointer to the array of values to consider

◆ cs_navsto_param_set_notay_scaling()

void cs_navsto_param_set_notay_scaling ( double  scaling_coef)

Set the scaling coefficient used in the Notay's transformation devised in "Algebraic multigrid for Stokes equations" SIAM J. Sci. Comput. Vol. 39 (5), 2017 In this article, this scaling is denoted by alpha.

Parameters
[in]scaling_coefvalued of the scaling coefficient

◆ cs_navsto_param_transfer()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in,out]eqppointer to a cs_equation_param_t structure

◆ cs_navsto_set_fixed_walls()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure

◆ cs_navsto_set_outlets()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure

◆ cs_navsto_set_pressure_bc_by_value()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]valuesvalue to set
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_set_reference_pressure()

void cs_navsto_set_reference_pressure ( cs_navsto_param_t nsp,
cs_real_t  pref 
)

Set the value to consider for the reference pressure.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]prefvalue of the reference pressure

◆ cs_navsto_set_symmetries()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure

◆ cs_navsto_set_velocity_inlet_by_analytic()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]anapointer to an analytical function
[in]inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_set_velocity_inlet_by_array()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]locinformation to know where are located values
[in]arraypointer to an array
[in]is_ownertransfer the lifecycle to the cs_xdef_t structure (true or false)
[in]full_lengthif 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.
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_set_velocity_inlet_by_dof_func()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]dof_locwhere are located DoFs
[in]funcpointer to a cs_dof_function_t
[in]func_inputNULL or pointer to a structure cast on-the-fly
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_set_velocity_inlet_by_value()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]valuesarray of three real values
Returns
a pointer to the new cs_xdef_t structure

◆ cs_navsto_set_velocity_wall_by_value()

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.

Parameters
[in]nsppointer to a cs_navsto_param_t structure
[in]z_namename of the associated zone (if NULL or "" all boundary faces are considered)
[in]valuesarray of three real values
Returns
a pointer to the new cs_xdef_t structure