#include "cs_defs.h"
#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_quantities.h"
#include "cs_cdofb_navsto.h"
#include "cs_field.h"
#include "cs_iter_algo.h"
#include "cs_math.h"
#include "cs_matrix.h"
#include "cs_mesh.h"
#include "cs_navsto_param.h"
#include "cs_sdm.h"
#include "cs_time_plot.h"
#include "cs_time_step.h"
Go to the source code of this file.
Typedefs | |
typedef cs_cdofb_navsto_boussinesq_type_t | cs_macfb_navsto_boussinesq_type_t |
typedef cs_cdofb_navsto_builder_t | cs_macfb_navsto_builder_t |
typedef void() | cs_macfb_navsto_source_t(const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Compute and add a source term to the local RHS. This is a special treatment to enable source involving face DoFs and potentially the local discrete divergence/gradient operators. Examples are gravity term or Bousinesq term(s) More... | |
Functions | |
void | cs_macfb_navsto_set_boussinesq_algo (cs_macfb_navsto_boussinesq_type_t type) |
Set the way to compute the Boussinesq approximation. More... | |
cs_macfb_navsto_builder_t | cs_macfb_navsto_create_builder (const cs_navsto_param_t *nsp, const cs_cdo_connect_t *connect) |
Create and allocate a local NavSto builder when Fb schemes are used. More... | |
void | cs_macfb_navsto_free_builder (cs_macfb_navsto_builder_t *nsb) |
Destroy the given cs_macfb_navsto_builder_t structure. More... | |
void | cs_macfb_navsto_define_builder (cs_real_t t_eval, const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_sys_t *csys, const cs_cdo_bc_face_t *pr_bc, const cs_boundary_type_t *bf_type, cs_macfb_navsto_builder_t *nsb) |
Set the members of the cs_macfb_navsto_builder_t structure. More... | |
void | cs_macfb_navsto_mass_flux (const cs_navsto_param_t *nsp, const cs_cdo_quantities_t *quant, const cs_real_t *face_vel, cs_real_t *mass_flux) |
Compute the mass flux playing the role of the advection field in the Navier-Stokes equations One considers the mass flux across primal faces which relies on the velocity vector defined on each face. More... | |
double | cs_macfb_navsto_cell_divergence (const cs_lnum_t c_id, const cs_cdo_quantities_t *quant, const cs_adjacency_t *c2f, const cs_real_t *f_vals) |
Compute the divergence in a cell of a vector-valued array defined at faces (values are defined both at interior and border faces). Variant based on the usage of cs_cdo_quantities_t structure. More... | |
void | cs_macfb_navsto_compute_face_pressure (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, const cs_navsto_param_t *nsp, const cs_real_t *p_cell, cs_real_t *p_face) |
Compute an estimation of the pressure at faces. More... | |
void | cs_macfb_navsto_compute_cell_velocity (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_real_t *mass_flux, cs_real_t *u_cell) |
Compute an estimation of the velocity at cells. More... | |
void | cs_macfb_navsto_add_grad_div (short int n_fc, const cs_real_t zeta, const cs_real_t div[], cs_sdm_t *mat) |
Add the grad-div part to the local matrix (i.e. for the current cell) More... | |
void | cs_macfb_navsto_init_pressure (const cs_navsto_param_t *nsp, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, cs_field_t *pr) |
Initialize the pressure values. More... | |
void | cs_macfb_navsto_init_face_pressure (const cs_navsto_param_t *nsp, const cs_cdo_connect_t *connect, const cs_time_step_t *ts, cs_real_t *pr_f) |
Initialize the pressure values when the pressure is defined at faces. More... | |
void | cs_macfb_navsto_rescale_pressure_to_ref (const cs_navsto_param_t *nsp, const cs_cdo_quantities_t *quant, cs_real_t values[]) |
Update the pressure field in order to get a field with a mean-value equal to the reference value. More... | |
void | cs_macfb_navsto_set_zero_mean_pressure (const cs_cdo_quantities_t *quant, cs_real_t values[]) |
Update the pressure field in order to get a field with a zero-mean average. More... | |
void | cs_macfb_navsto_extra_op (const cs_navsto_param_t *nsp, const cs_mesh_t *mesh, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *ts, cs_time_plot_t *time_plotter, const cs_adv_field_t *adv_field, const cs_real_t *mass_flux, const cs_real_t *p_cell, const cs_real_t *u_face) |
Perform extra-operation related to MAC-Fb schemes when solving Navier-Stokes. Computation of the following quantities according to post-processing flags beeing activated. More... | |
void | cs_macfb_block_dirichlet_alge (short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of an algebraic technique. This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
void | cs_macfb_block_dirichlet_pena (short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a penalization technique (with a large coefficient). One assumes that static condensation has been performed and that the velocity-block has size 3*n_fc This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
void | cs_macfb_block_dirichlet_weak (short int fb, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
void | cs_macfb_block_dirichlet_wsym (short int fb, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (symmetrized Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
void | cs_macfb_symmetry (short int fb, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a boundary defined as 'symmetry' (treated as a sliding BCs on the three velocity components.) A weak penalization technique (symmetrized Nitsche) is used. This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
void | cs_macfb_fixed_wall (short int fb, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *pty, cs_cell_builder_t *cb, cs_cell_sys_t *csys) |
Take into account a wall BCs by a weak enforcement using Nitsche technique plus a symmetric treatment. This prototype matches the function pointer cs_cdo_apply_boundary_t. More... | |
cs_sles_convergence_state_t | cs_macfb_navsto_nl_algo_cvg (cs_param_nl_algo_t nl_algo_type, const cs_real_t *pre_iterate, cs_real_t *cur_iterate, cs_iter_algo_t *algo) |
Test if one has to do one more non-linear iteration. Test if performed on the relative norm on the increment between two iterations. More... | |
void | cs_macfb_navsto_set_gravity_func (const cs_navsto_param_t *nsp, cs_macfb_navsto_source_t **p_func) |
Set the function pointer computing the source term in the momentum equation related to the gravity effect (hydrostatic pressure or the Boussinesq approximation) More... | |
void | cs_macfb_navsto_gravity_term (const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Take into account the gravity effects. Compute and add the source term to the local RHS. This is a special treatment since of face DoFs are involved contrary to the standard case where only the cell DoFs is involved. More... | |
void | cs_macfb_navsto_boussinesq_at_cell (const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This is the standard case where the face DoFs are used for the constant part rho0 . g[] and only the cell DoFs are involved for the remaining part (the Boussinesq approximation). More... | |
void | cs_macfb_navsto_boussinesq_at_face (const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This way to compute the Boussinesq approximation relies only on DoFs at faces. This should enable to keep a stable (no velocity) in case of a stratified configuration. More... | |
void | cs_macfb_navsto_boussinesq_by_part (const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This way to compute the Boussinesq approximation relies only on DoFs at faces. This should enable to keep a stable (no velocity) in case of a stratified configuration. More... | |
void | cs_macfb_navsto_stream_source_term (cs_lnum_t n_elts, const cs_lnum_t *elt_ids, bool dense_output, void *input, cs_real_t *retval) |
Get the source term for computing the stream function. This relies on the prototype associated to the generic function pointer cs_dof_func_t. More... | |
typedef void() cs_macfb_navsto_source_t(const cs_navsto_param_t *nsp, const cs_cell_mesh_t *cm, const cs_macfb_navsto_builder_t *nsb, cs_cell_sys_t *csys) |
Compute and add a source term to the local RHS. This is a special treatment to enable source involving face DoFs and potentially the local discrete divergence/gradient operators. Examples are gravity term or Bousinesq term(s)
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
void cs_macfb_block_dirichlet_alge | ( | short int | f, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of an algebraic technique. This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | f | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of an algebraic technique. This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | f | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_macfb_block_dirichlet_pena | ( | short int | f, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a penalization technique (with a large coefficient). One assumes that static condensation has been performed and that the velocity-block has size 3*n_fc This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | f | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a penalization technique (with a large coefficient). One assumes that static condensation has been performed and that the velocity-block has size 3*n_fc This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | f | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_macfb_block_dirichlet_weak | ( | short int | fb, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_macfb_block_dirichlet_wsym | ( | short int | fb, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (symmetrized Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
Take into account a Dirichlet BCs on the three velocity components. For instance for a velocity inlet boundary or a wall Handle the velocity-block in the global algebraic system in case of a weak penalization technique (symmetrized Nitsche). One assumes that static condensation has not been performed yet and that the velocity-block has size 3*(n_fc + 1) This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_macfb_fixed_wall | ( | short int | fb, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a wall BCs by a weak enforcement using Nitsche technique plus a symmetric treatment. This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |
void cs_macfb_navsto_add_grad_div | ( | short int | n_fc, |
const cs_real_t | zeta, | ||
const cs_real_t | div[], | ||
cs_sdm_t * | mat | ||
) |
Add the grad-div part to the local matrix (i.e. for the current cell)
[in] | n_fc | local number of faces for the current cell |
[in] | zeta | scalar coefficient for the grad-div operator |
[in] | div | divergence |
[in,out] | mat | local system matrix to update |
void cs_macfb_navsto_boussinesq_at_cell | ( | const cs_navsto_param_t * | nsp, |
const cs_cell_mesh_t * | cm, | ||
const cs_macfb_navsto_builder_t * | nsb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This is the standard case where the face DoFs are used for the constant part rho0 . g[] and only the cell DoFs are involved for the remaining part (the Boussinesq approximation).
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
void cs_macfb_navsto_boussinesq_at_face | ( | const cs_navsto_param_t * | nsp, |
const cs_cell_mesh_t * | cm, | ||
const cs_macfb_navsto_builder_t * | nsb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This way to compute the Boussinesq approximation relies only on DoFs at faces. This should enable to keep a stable (no velocity) in case of a stratified configuration.
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This way to compute the Boussinesq approximation relies only on DoFs at faces. This should enable to keep a stable (no velocity) in case of a stratified configuration.
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
void cs_macfb_navsto_boussinesq_by_part | ( | const cs_navsto_param_t * | nsp, |
const cs_cell_mesh_t * | cm, | ||
const cs_macfb_navsto_builder_t * | nsb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account the buoyancy force with the Boussinesq approx. Compute and add the source term to the local RHS. This way to compute the Boussinesq approximation relies only on DoFs at faces. This should enable to keep a stable (no velocity) in case of a stratified configuration.
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
double cs_macfb_navsto_cell_divergence | ( | const cs_lnum_t | c_id, |
const cs_cdo_quantities_t * | quant, | ||
const cs_adjacency_t * | c2f, | ||
const cs_real_t * | f_vals | ||
) |
Compute the divergence in a cell of a vector-valued array defined at faces (values are defined both at interior and border faces). Variant based on the usage of cs_cdo_quantities_t structure.
[in] | c_id | cell id |
[in] | quant | pointer to a cs_cdo_quantities_t |
[in] | c2f | pointer to cell-to-face cs_adjacency_t |
[in] | f_vals | values of the face DoFs |
void cs_macfb_navsto_compute_cell_velocity | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_real_t * | mass_flux, | ||
cs_real_t * | u_cell | ||
) |
Compute an estimation of the velocity at cells.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | mass_flux | scalar-valued mass flux for each face |
[in,out] | u_cell | vector-value velocity velo at each cell |
void cs_macfb_navsto_compute_face_pressure | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts, | ||
const cs_navsto_param_t * | nsp, | ||
const cs_real_t * | p_cell, | ||
cs_real_t * | p_face | ||
) |
Compute an estimation of the pressure at faces.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | p_cell | value of the pressure inside each cell |
[in,out] | p_face | value of the pressure at each face |
cs_macfb_navsto_builder_t cs_macfb_navsto_create_builder | ( | const cs_navsto_param_t * | nsp, |
const cs_cdo_connect_t * | connect | ||
) |
Create and allocate a local NavSto builder when Fb schemes are used.
[in] | nsp | set of parameters to define the NavSto system |
[in] | connect | pointer to a cs_cdo_connect_t structure |
Create and allocate a local NavSto builder when Fb schemes are used.
[in] | nsp | set of parameters to define the NavSto system |
[in] | connect | pointer to a cs_cdo_connect_t structure |
void cs_macfb_navsto_define_builder | ( | cs_real_t | t_eval, |
const cs_navsto_param_t * | nsp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_macfb_builder_t * | macb, | ||
const cs_cell_sys_t * | csys, | ||
const cs_cdo_bc_face_t * | pr_bc, | ||
const cs_boundary_type_t * | bf_type, | ||
cs_macfb_navsto_builder_t * | nsb | ||
) |
Set the members of the cs_macfb_navsto_builder_t structure.
[in] | t_eval | time at which one evaluates the pressure BC |
[in] | nsp | set of parameters to define the NavSto system |
[in] | cm | cellwise view of the mesh |
[in] | macb | macfb builder |
[in] | csys | cellwise view of the algebraic system |
[in] | pr_bc | set of definitions for the presuure BCs |
[in] | bf_type | type of boundaries for all boundary faces |
[in,out] | nsb | builder to update |
void cs_macfb_navsto_extra_op | ( | const cs_navsto_param_t * | nsp, |
const cs_mesh_t * | mesh, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_cdo_connect_t * | connect, | ||
const cs_time_step_t * | ts, | ||
cs_time_plot_t * | time_plotter, | ||
const cs_adv_field_t * | adv_field, | ||
const cs_real_t * | mass_flux, | ||
const cs_real_t * | p_cell, | ||
const cs_real_t * | u_face | ||
) |
Perform extra-operation related to MAC-Fb schemes when solving Navier-Stokes. Computation of the following quantities according to post-processing flags beeing activated.
[in] | nsp | pointer to a cs_navsto_param_t struct. |
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t struct. |
[in] | connect | pointer to a cs_cdo_connect_t struct. |
[in] | ts | pointer to a cs_time_step_t struct. |
[in,out] | time_plotter | pointer to a cs_time_plot_t struct. |
[in] | adv_field | pointer to a cs_adv_field_t struct. |
[in] | mass_flux | scalar-valued mass flux for each face |
[in] | p_cell | scalar-valued pressure in each cell |
[in] | u_face | vector-valued velocity on each face |
void cs_macfb_navsto_free_builder | ( | cs_macfb_navsto_builder_t * | nsb | ) |
Destroy the given cs_macfb_navsto_builder_t structure.
[in,out] | nsb | pointer to the cs_macfb_navsto_builder_t to free |
void cs_macfb_navsto_gravity_term | ( | const cs_navsto_param_t * | nsp, |
const cs_cell_mesh_t * | cm, | ||
const cs_macfb_navsto_builder_t * | nsb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account the gravity effects. Compute and add the source term to the local RHS. This is a special treatment since of face DoFs are involved contrary to the standard case where only the cell DoFs is involved.
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
Take into account the gravity effects. Compute and add the source term to the local RHS. This is a special treatment since of face DoFs are involved contrary to the standard case where only the cell DoFs is involved.
[in] | nsp | set of parameters to handle the Navier-Stokes system |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | nsb | pointer to a builder structure for the NavSto system |
[in,out] | csys | pointer to a cs_cell_sys_t structure |
void cs_macfb_navsto_init_face_pressure | ( | const cs_navsto_param_t * | nsp, |
const cs_cdo_connect_t * | connect, | ||
const cs_time_step_t * | ts, | ||
cs_real_t * | pr_f | ||
) |
Initialize the pressure values when the pressure is defined at faces.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
[in,out] | pr_f | pointer to the pressure values at faces |
void cs_macfb_navsto_init_pressure | ( | const cs_navsto_param_t * | nsp, |
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts, | ||
cs_field_t * | pr | ||
) |
Initialize the pressure values.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
[in,out] | pr | pointer to the pressure cs_field_t structure |
void cs_macfb_navsto_mass_flux | ( | const cs_navsto_param_t * | nsp, |
const cs_cdo_quantities_t * | quant, | ||
const cs_real_t * | face_vel, | ||
cs_real_t * | mass_flux | ||
) |
Compute the mass flux playing the role of the advection field in the Navier-Stokes equations One considers the mass flux across primal faces which relies on the velocity vector defined on each face.
[in] | nsp | set of parameters to define the NavSto system |
[in] | quant | set of additional geometrical quantities |
[in] | face_vel | velocity vectors for each face |
[in,out] | mass_flux | array of mass flux values to update (allocated) |
cs_sles_convergence_state_t cs_macfb_navsto_nl_algo_cvg | ( | cs_param_nl_algo_t | nl_algo_type, |
const cs_real_t * | pre_iterate, | ||
cs_real_t * | cur_iterate, | ||
cs_iter_algo_t * | algo | ||
) |
Test if one has to do one more non-linear iteration. Test if performed on the relative norm on the increment between two iterations.
[in] | nl_algo_type | type of non-linear algorithm |
[in] | pre_iterate | previous state of the mass flux iterate |
[in] | cur_iterate | current state of the mass flux iterate |
[in,out] | algo | pointer to a cs_iter_algo_t structure |
void cs_macfb_navsto_rescale_pressure_to_ref | ( | const cs_navsto_param_t * | nsp, |
const cs_cdo_quantities_t * | quant, | ||
cs_real_t | values[] | ||
) |
Update the pressure field in order to get a field with a mean-value equal to the reference value.
[in] | nsp | pointer to a cs_navsto_param_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in,out] | values | pressure field values |
void cs_macfb_navsto_set_boussinesq_algo | ( | cs_macfb_navsto_boussinesq_type_t | type | ) |
Set the way to compute the Boussinesq approximation.
[in] | type | type of algorithm to use |
void cs_macfb_navsto_set_gravity_func | ( | const cs_navsto_param_t * | nsp, |
cs_macfb_navsto_source_t ** | p_func | ||
) |
Set the function pointer computing the source term in the momentum equation related to the gravity effect (hydrostatic pressure or the Boussinesq approximation)
[in] | nsp | set of parameters for the Navier-Stokes system |
[out] | p_func | way to compute the gravity effect |
void cs_macfb_navsto_set_zero_mean_pressure | ( | const cs_cdo_quantities_t * | quant, |
cs_real_t | values[] | ||
) |
Update the pressure field in order to get a field with a zero-mean average.
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in,out] | values | pressure field values |
void cs_macfb_navsto_stream_source_term | ( | cs_lnum_t | n_elts, |
const cs_lnum_t * | elt_ids, | ||
bool | dense_output, | ||
void * | input, | ||
cs_real_t * | retval | ||
) |
Get the source term for computing the stream function. This relies on the prototype associated to the generic function pointer cs_dof_func_t.
[in] | n_elts | number of elements to consider |
[in] | elt_ids | list of elements ids |
[in] | dense_output | perform an indirection in retval or not |
[in] | input | null or pointer to a structure cast on-the-fly |
[in,out] | retval | result of the function. Must be allocated. |
[in] | n_elts | number of elements to consider |
[in] | elt_ids | list of elements ids |
[in] | dense_output | perform an indirection in retval or not |
[in] | input | null or pointer to a structure cast on-the-fly |
[in,out] | retval | result of the function. Must be allocated. |
void cs_macfb_symmetry | ( | short int | fb, |
const cs_equation_param_t * | eqp, | ||
const cs_cell_mesh_t * | cm, | ||
const cs_property_data_t * | pty, | ||
cs_cell_builder_t * | cb, | ||
cs_cell_sys_t * | csys | ||
) |
Take into account a boundary defined as 'symmetry' (treated as a sliding BCs on the three velocity components.) A weak penalization technique (symmetrized Nitsche) is used. This prototype matches the function pointer cs_cdo_apply_boundary_t.
[in] | fb | face id in the cell mesh numbering |
[in] | eqp | pointer to a cs_equation_param_t struct. |
[in] | cm | pointer to a cs_cell_mesh_t structure |
[in] | pty | pointer to a cs_property_data_t structure |
[in,out] | cb | pointer to a cs_cell_builder_t structure |
[in,out] | csys | structure storing the cellwise system |