7.2
general documentation
cs_gwf.h File Reference
#include "cs_base.h"
#include "cs_equation.h"
#include "cs_gwf_param.h"
#include "cs_gwf_priv.h"
#include "cs_gwf_soil.h"
#include "cs_gwf_tracer.h"
+ Include dependency graph for cs_gwf.h:

Go to the source code of this file.

Functions

bool cs_gwf_is_activated (void)
 Check if the groundwater flow module has been activated. More...
 
cs_gwf_tcs_gwf_activate (cs_gwf_model_type_t model, cs_flag_t option_flag, cs_flag_t post_flag)
 Initialize the module dedicated to groundwater flows. More...
 
cs_gwf_tcs_gwf_destroy_all (void)
 Free all structures related to groundwater flows. More...
 
cs_gwf_two_phase_tcs_gwf_get_two_phase_model (void)
 Get the main structure which manages a two-phase flow model. More...
 
void cs_gwf_set_two_phase_numerical_options (bool use_coupled_solver, bool use_incremental_solver, bool use_properties_on_submesh)
 Set the numerical options related to the two phase flow models. More...
 
void cs_gwf_set_miscible_two_phase_model (cs_real_t l_mass_density, cs_real_t l_viscosity, cs_real_t g_viscosity, cs_real_t l_diffusivity_h, cs_real_t w_molar_mass, cs_real_t h_molar_mass, cs_real_t ref_temperature, cs_real_t henry_constant)
 Set the parameters defining the two-phase flow model. Use SI unit if not prescribed otherwise. More...
 
void cs_gwf_set_immiscible_two_phase_model (cs_real_t l_mass_density, cs_real_t l_viscosity, cs_real_t g_viscosity, cs_real_t h_molar_mass, cs_real_t ref_temperature)
 Set the parameters defining the immiscible two-phase flow model. Use SI unit if not prescribed otherwise. More...
 
void cs_gwf_log_setup (void)
 Summary of the main cs_gwf_t structure. More...
 
void cs_gwf_set_post_options (cs_flag_t post_flag, bool reset)
 Set the flag dedicated to the post-processing of the GWF module. More...
 
cs_adv_field_tcs_gwf_get_adv_field (void)
 Retrieve the advection field related to the Darcy flux in the liquid phase. More...
 
cs_gwf_soil_t * cs_gwf_add_iso_soil (const char *z_name, double density, double k_abs, double porosity, cs_gwf_soil_model_t model)
 Create and add a new cs_gwf_soil_t structure. An initialization by default of all members is performed. Case of a soil with an isotropic absolute permeability. More...
 
cs_gwf_soil_t * cs_gwf_add_aniso_soil (const char *z_name, double density, double k_abs[3][3], double porosity, cs_gwf_soil_model_t model)
 Create and add a new cs_gwf_soil_t structure. An initialization by default of all members is performed. More...
 
cs_gwf_tracer_t * cs_gwf_add_tracer (cs_gwf_tracer_model_t tr_model, const char *eq_name, const char *var_name)
 Add a new equation related to the groundwater flow module. More...
 
cs_gwf_tracer_t * cs_gwf_add_user_tracer (const char *eq_name, const char *var_name, cs_gwf_tracer_init_setup_t *init_setup, cs_gwf_tracer_finalize_setup_t *finalize_setup)
 Add a new equation related to the groundwater flow module. More...
 
void cs_gwf_init_model_context (void)
 Initialize the context of the model after the activation of the module and a first settings of the model parameters (physical and numerical). At this stage, cs_user_parameters() has not been called. More...
 
void cs_gwf_init_setup (void)
 Predefined settings for the groundwater flow model and its related equations. At this stage, all soils have been defined and equation parameters are set (cs_user_parameters() has been called). Create new cs_field_t structures according to the setting. More...
 
void cs_gwf_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant)
 Last initialization step of the groundwater flow module. At this stage, the mesh quantities are defined. More...
 
void cs_gwf_init_values (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts)
 Initialize the GWF module (done after all the setup phase and after the initialization of all equations) One sets an initial value to all quantities related to this module. More...
 
void cs_gwf_update (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts, cs_flag_t update_flag)
 Update the groundwater system (pressure head, head in law, moisture content, darcian velocity, soil capacity or permeability if needed) More...
 
void cs_gwf_compute_steady_state (const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq)
 Compute the steady-state of the groundwater flows module. Nothing is done if all equations are unsteady. More...
 
void cs_gwf_compute (const cs_mesh_t *mesh, const cs_time_step_t *time_step, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq)
 Compute the system related to groundwater flows module. More...
 
void cs_gwf_extra_op (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq)
 Predefined extra-operations for the groundwater flow module. More...
 
void cs_gwf_extra_post_sspf (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step)
 Predefined post-processing output for the groundwater flow module in case of saturated single-phase flows (sspf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More...
 
void cs_gwf_extra_post_uspf (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step)
 Predefined post-processing output for the groundwater flow module in case of unsaturated single-phase flows (uspf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More...
 
void cs_gwf_extra_post_mtpf (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step)
 Predefined post-processing output for the groundwater flow module in case of miscible two-phase flows (mtpf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More...
 

Function Documentation

◆ cs_gwf_activate()

cs_gwf_t* cs_gwf_activate ( cs_gwf_model_type_t  model,
cs_flag_t  option_flag,
cs_flag_t  post_flag 
)

Initialize the module dedicated to groundwater flows.

Parameters
[in]modeltype of physical modelling
[in]option_flagoptional flag to specify this module
[in]post_flagoptional automatic postprocessing
Returns
a pointer to a new allocated groundwater flow structure

◆ cs_gwf_add_aniso_soil()

cs_gwf_soil_t* cs_gwf_add_aniso_soil ( const char *  z_name,
double  density,
double  k_abs[3][3],
double  porosity,
cs_gwf_soil_model_t  model 
)

Create and add a new cs_gwf_soil_t structure. An initialization by default of all members is performed.

Parameters
[in]z_namename of the volume zone corresponding to the soil
[in]densityvalue of the bulk mass density
[in]k_absabsolute (or intrisic) permeability (tensor-valued)
[in]porosityvalue of the porosity (saturated moisture content)
[in]modeltype of model for the soil behavior
Returns
a pointer to the new allocated soil structure

◆ cs_gwf_add_iso_soil()

cs_gwf_soil_t* cs_gwf_add_iso_soil ( const char *  z_name,
double  density,
double  k_abs,
double  porosity,
cs_gwf_soil_model_t  model 
)

Create and add a new cs_gwf_soil_t structure. An initialization by default of all members is performed. Case of a soil with an isotropic absolute permeability.

Parameters
[in]z_namename of the volume zone corresponding to the soil
[in]densityvalue of the bulk mass density
[in]k_absabsolute (or intrisic) permeability (scalar-valued)
[in]porosityvalue of the porosity (saturated moisture content)
[in]modeltype of model for the soil behavior
Returns
a pointer to the new allocated soil structure

◆ cs_gwf_add_tracer()

cs_gwf_tracer_t* cs_gwf_add_tracer ( cs_gwf_tracer_model_t  tr_model,
const char *  eq_name,
const char *  var_name 
)

Add a new equation related to the groundwater flow module.

This equation is a particular type of unsteady advection-diffusion reaction equation. Tracer is advected thanks to the darcian velocity and diffusion/reaction parameters result from a physical modelling. Terms solved in this equation are activated according to predefined settings. The advection field corresponds to that of the liquid phase.

Parameters
[in]tr_modelphysical modelling to consider (0 = default settings)
[in]eq_namename of the tracer equation
[in]var_namename of the related variable
Returns
a pointer to the new cs_gwf_tracer_t structure

◆ cs_gwf_add_user_tracer()

cs_gwf_tracer_t* cs_gwf_add_user_tracer ( const char *  eq_name,
const char *  var_name,
cs_gwf_tracer_init_setup_t init_setup,
cs_gwf_tracer_finalize_setup_t finalize_setup 
)

Add a new equation related to the groundwater flow module.

This equation is a particular type of unsteady advection-diffusion reaction equation. Tracer is advected thanks to the darcian velocity and diffusion/reaction parameters result from a physical modelling. Terms are activated according to predefined settings. Modelling of the tracer parameters are left to the user

Parameters
[in]eq_namename of the tracer equation
[in]var_namename of the related variable
[in]init_setupfunction pointer (predefined prototype)
[in]finalize_setupfunction pointer (predefined prototype)
Returns
a pointer to the new cs_gwf_tracer_t structure

◆ cs_gwf_compute()

void cs_gwf_compute ( const cs_mesh_t mesh,
const cs_time_step_t time_step,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t cdoq 
)

Compute the system related to groundwater flows module.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_compute_steady_state()

void cs_gwf_compute_steady_state ( const cs_mesh_t mesh,
const cs_time_step_t time_step,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t cdoq 
)

Compute the steady-state of the groundwater flows module. Nothing is done if all equations are unsteady.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]time_steppointer to a cs_time_step_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_destroy_all()

cs_gwf_t* cs_gwf_destroy_all ( void  )

Free all structures related to groundwater flows.

Returns
a NULL pointer

◆ cs_gwf_extra_op()

void cs_gwf_extra_op ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t cdoq 
)

Predefined extra-operations for the groundwater flow module.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]cdoqpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_extra_post_mtpf()

void cs_gwf_extra_post_mtpf ( void *  input,
int  mesh_id,
int  cat_id,
int  ent_flag[5],
cs_lnum_t  n_cells,
cs_lnum_t  n_i_faces,
cs_lnum_t  n_b_faces,
const cs_lnum_t  cell_ids[],
const cs_lnum_t  i_face_ids[],
const cs_lnum_t  b_face_ids[],
const cs_time_step_t time_step 
)

Predefined post-processing output for the groundwater flow module in case of miscible two-phase flows (mtpf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)

Parameters
[in,out]inputpointer to a optional structure (here a cs_gwf_t structure)
[in]mesh_idid of the output mesh for the current call
[in]cat_idcategory id of the output mesh for this call
[in]ent_flagindicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4])
[in]n_cellslocal number of cells of post_mesh
[in]n_i_faceslocal number of interior faces of post_mesh
[in]n_b_faceslocal number of boundary faces of post_mesh
[in]cell_idslist of cells (0 to n-1)
[in]i_face_idslist of interior faces (0 to n-1)
[in]b_face_idslist of boundary faces (0 to n-1)
[in]time_steppointer to a cs_time_step_t struct.

◆ cs_gwf_extra_post_sspf()

void cs_gwf_extra_post_sspf ( void *  input,
int  mesh_id,
int  cat_id,
int  ent_flag[5],
cs_lnum_t  n_cells,
cs_lnum_t  n_i_faces,
cs_lnum_t  n_b_faces,
const cs_lnum_t  cell_ids[],
const cs_lnum_t  i_face_ids[],
const cs_lnum_t  b_face_ids[],
const cs_time_step_t time_step 
)

Predefined post-processing output for the groundwater flow module in case of saturated single-phase flows (sspf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)

Parameters
[in,out]inputpointer to a optional structure (here a cs_gwf_t structure)
[in]mesh_idid of the output mesh for the current call
[in]cat_idcategory id of the output mesh for this call
[in]ent_flagindicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4])
[in]n_cellslocal number of cells of post_mesh
[in]n_i_faceslocal number of interior faces of post_mesh
[in]n_b_faceslocal number of boundary faces of post_mesh
[in]cell_idslist of cells (0 to n-1)
[in]i_face_idslist of interior faces (0 to n-1)
[in]b_face_idslist of boundary faces (0 to n-1)
[in]time_steppointer to a cs_time_step_t struct.

◆ cs_gwf_extra_post_uspf()

void cs_gwf_extra_post_uspf ( void *  input,
int  mesh_id,
int  cat_id,
int  ent_flag[5],
cs_lnum_t  n_cells,
cs_lnum_t  n_i_faces,
cs_lnum_t  n_b_faces,
const cs_lnum_t  cell_ids[],
const cs_lnum_t  i_face_ids[],
const cs_lnum_t  b_face_ids[],
const cs_time_step_t time_step 
)

Predefined post-processing output for the groundwater flow module in case of unsaturated single-phase flows (uspf) in porous media. Prototype of this function is given since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)

Parameters
[in,out]inputpointer to a optional structure (here a cs_gwf_t structure)
[in]mesh_idid of the output mesh for the current call
[in]cat_idcategory id of the output mesh for this call
[in]ent_flagindicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4])
[in]n_cellslocal number of cells of post_mesh
[in]n_i_faceslocal number of interior faces of post_mesh
[in]n_b_faceslocal number of boundary faces of post_mesh
[in]cell_idslist of cells (0 to n-1)
[in]i_face_idslist of interior faces (0 to n-1)
[in]b_face_idslist of boundary faces (0 to n-1)
[in]time_steppointer to a cs_time_step_t struct.

◆ cs_gwf_finalize_setup()

void cs_gwf_finalize_setup ( const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant 
)

Last initialization step of the groundwater flow module. At this stage, the mesh quantities are defined.

Parameters
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure

◆ cs_gwf_get_adv_field()

cs_adv_field_t* cs_gwf_get_adv_field ( void  )

Retrieve the advection field related to the Darcy flux in the liquid phase.

Returns
a pointer to a cs_adv_field_t structure or NULL

◆ cs_gwf_get_two_phase_model()

cs_gwf_two_phase_t* cs_gwf_get_two_phase_model ( void  )

Get the main structure which manages a two-phase flow model.

Returns
a pointer to the structure cs_gwf_two_phase_t

◆ cs_gwf_init_model_context()

void cs_gwf_init_model_context ( void  )

Initialize the context of the model after the activation of the module and a first settings of the model parameters (physical and numerical). At this stage, cs_user_parameters() has not been called.

◆ cs_gwf_init_setup()

void cs_gwf_init_setup ( void  )

Predefined settings for the groundwater flow model and its related equations. At this stage, all soils have been defined and equation parameters are set (cs_user_parameters() has been called). Create new cs_field_t structures according to the setting.

◆ cs_gwf_init_values()

void cs_gwf_init_values ( const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_time_step_t ts 
)

Initialize the GWF module (done after all the setup phase and after the initialization of all equations) One sets an initial value to all quantities related to this module.

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]tspointer to a cs_time_step_t structure

◆ cs_gwf_is_activated()

bool cs_gwf_is_activated ( void  )

Check if the groundwater flow module has been activated.

Returns
true or false

◆ cs_gwf_log_setup()

void cs_gwf_log_setup ( void  )

Summary of the main cs_gwf_t structure.

◆ cs_gwf_set_immiscible_two_phase_model()

void cs_gwf_set_immiscible_two_phase_model ( cs_real_t  l_mass_density,
cs_real_t  l_viscosity,
cs_real_t  g_viscosity,
cs_real_t  h_molar_mass,
cs_real_t  ref_temperature 
)

Set the parameters defining the immiscible two-phase flow model. Use SI unit if not prescribed otherwise.

Parameters
[in]l_mass_densitymass density of the main liquid component
[in]l_viscosityviscosity in the liquid phase (Pa.s)
[in]g_viscosityviscosity in the gas phase (Pa.s)
[in]h_molar_massmolar mass of the main gas component
[in]ref_temperaturereference temperature in Kelvin

◆ cs_gwf_set_miscible_two_phase_model()

void cs_gwf_set_miscible_two_phase_model ( cs_real_t  l_mass_density,
cs_real_t  l_viscosity,
cs_real_t  g_viscosity,
cs_real_t  l_diffusivity_h,
cs_real_t  w_molar_mass,
cs_real_t  h_molar_mass,
cs_real_t  ref_temperature,
cs_real_t  henry_constant 
)

Set the parameters defining the two-phase flow model. Use SI unit if not prescribed otherwise.

Parameters
[in]l_mass_densitymass density of the main liquid component
[in]l_viscosityviscosity in the liquid phase (Pa.s)
[in]g_viscosityviscosity in the gas phase (Pa.s)
[in]l_diffusivity_hdiffusivity of the main gas component in the liquid phase
[in]w_molar_massmolar mass of the main liquid component
[in]h_molar_massmolar mass of the main gas component
[in]ref_temperaturereference temperature in Kelvin
[in]henry_constantconstant in the Henry law

◆ cs_gwf_set_post_options()

void cs_gwf_set_post_options ( cs_flag_t  post_flag,
bool  reset 
)

Set the flag dedicated to the post-processing of the GWF module.

Parameters
[in]post_flagflag to set
[in]resetreset post flag before

◆ cs_gwf_set_two_phase_numerical_options()

void cs_gwf_set_two_phase_numerical_options ( bool  use_coupled_solver,
bool  use_incremental_solver,
bool  use_properties_on_submesh 
)

Set the numerical options related to the two phase flow models.

Parameters
[in]use_coupled_solvertrue/false
[in]use_incremental_solvertrue/false
[in]use_properties_on_submeshtrue/false

◆ cs_gwf_update()

void cs_gwf_update ( const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t quant,
const cs_time_step_t ts,
cs_flag_t  update_flag 
)

Update the groundwater system (pressure head, head in law, moisture content, darcian velocity, soil capacity or permeability if needed)

Parameters
[in]meshpointer to a cs_mesh_t structure
[in]connectpointer to a cs_cdo_connect_t structure
[in]quantpointer to a cs_cdo_quantities_t structure
[in]tspointer to a cs_time_step_t structure
[in]update_flagmetadata associated to the status of the update step to perform