8.1
general documentation
cs_gwf_soil.h File Reference
#include "cs_base.h"
#include "cs_cdo_connect.h"
#include "cs_cdo_quantities.h"
#include "cs_gwf_param.h"
#include "cs_gwf_hydraulic_model.h"
#include "cs_mesh.h"
#include "cs_property.h"
#include "cs_volume_zone.h"
+ Include dependency graph for cs_gwf_soil.h:

Go to the source code of this file.

Data Structures

struct  cs_gwf_soil_vgm_spf_param_t
 Structure to handle the Van Genuchten-Mualem model of soil in the case of a single-phase flow in a porous media. More...
 
struct  cs_gwf_soil_vgm_tpf_param_t
 
struct  cs_gwf_soil_t
 Main structure to handle a soil in the groundwater flow module: its definition, the way to update its related properties. More...
 

Typedefs

typedef void() cs_gwf_soil_update_t(const cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_zone_t *zone, cs_gwf_soil_t *soil)
 Generic function to update the properties related to a hydraulic model given the soil model. The soil parameters depend on the type of soil model. More...
 
typedef void() cs_gwf_soil_free_param_t(void **p_param)
 Generic function to set free the parameter structure associated to a soil. More...
 
typedef void() cs_gwf_soil_tpf_eval_t(const cs_gwf_soil_vgm_tpf_param_t *sp, const double pc, double *sl, double *dsldpc, double *krl, double *krg)
 Compute the values of the different properties related to a soil in the case of a Van Genuchten-Mualem model and a two-phase flow model. More...
 

Enumerations

enum  cs_gwf_soil_join_type_t {
  CS_GWF_SOIL_JOIN_NOTHING , CS_GWF_SOIL_JOIN_C1_HYPERBOLIC , CS_GWF_SOIL_JOIN_C1_EXPONENTIAL , CS_GWF_SOIL_JOIN_C1_POLY_ORDER2 ,
  CS_GWF_SOIL_N_JOINS
}
 Kind of joining function used with closure laws. More...
 
enum  cs_gwf_soil_state_t { CS_GWF_SOIL_STATE_SATURATED = 0 , CS_GWF_SOIL_STATE_UNSATURATED = 1 , CS_GWF_SOIL_STATE_DRY = 2 , CS_GWF_SOIL_N_STATES = 3 }
 Kind of state in which a cell is. More...
 

Functions

int cs_gwf_get_n_soils (void)
 Get the number of allocated soils. More...
 
cs_gwf_soil_t * cs_gwf_soil_create (const cs_zone_t *zone, cs_gwf_model_type_t hydraulic_model, cs_gwf_soil_model_t model, cs_property_type_t perm_type, double k_abs[3][3], double porosity, double bulk_density, void *hydraulic_context)
 Create a new cs_gwf_soil_t structure and add it to the array of soils. An initialization by default of all members is performed. More...
 
cs_gwf_soil_t * cs_gwf_soil_by_id (int id)
 Retrieve a soil structure from its id. More...
 
cs_gwf_soil_t * cs_gwf_soil_by_name (const char *name)
 Retrieve a soil structure from its name. More...
 
const cs_zone_tcs_gwf_soil_get_zone (int soil_id)
 Retrieve a zone associated to a soil from its id. More...
 
void cs_gwf_soil_free_all (void)
 Free all cs_gwf_soil_t structures. More...
 
void cs_gwf_soil_finalize_setup (cs_gwf_model_type_t gwf_model, cs_flag_t post_flag, cs_lnum_t n_cells)
 Last initialization step for the soil structures/parameters. More...
 
void cs_gwf_soil_log_setup (void)
 Summary of the settings related to all cs_gwf_soil_t structures. More...
 
void cs_gwf_soil_update (cs_real_t time_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq)
 Update the soil properties. More...
 
void cs_gwf_soil_update_soil_state (cs_lnum_t n_cells, const cs_real_t *sliq)
 Update the soil state associated to each cell w.r.t. the given liquid saturation. More...
 
void cs_gwf_soil_define_shared_properties (cs_property_t *abs_permeability, cs_property_t *soil_porosity)
 Set the definition of the soil porosity and absolute permeability (which are properties always defined in the GWF module). One relies on the definition of these properties in each soil. More...
 
void cs_gwf_soil_define_sspf_property (cs_property_t *moisture_content)
 Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil. More...
 
void cs_gwf_soil_build_dual_porous_volume (const cs_cdo_quantities_t *cdoq, const cs_cdo_connect_t *connect)
 Build an array storing the dual volume associated to each vertex taking into account the porosity of the soil The computed quantity is stored as a static array. Use the function cs_gwf_soil_get_dual_vol_l() More...
 
const double * cs_gwf_soil_get_dual_porous_volume (void)
 Get the array storing the dual volume weighted by the soil porosity Array of size n_vertices. More...
 
const short int * cs_gwf_soil_get_cell2soil (void)
 Get the array storing the associated soil for each cell. More...
 
const int * cs_gwf_soil_get_soil_state (void)
 Get the array storing the soil state associated to each cell. More...
 
cs_real_t cs_gwf_soil_get_porosity (int soil_id)
 Get the porosity value for the given soil id. More...
 
cs_real_t cs_gwf_soil_get_saturated_moisture (int soil_id)
 Get the saturated moisture for the given soil id. More...
 
int cs_gwf_soil_get_permeability_max_dim (void)
 Retrieve the max dim (aniso=9; iso=1) for the absolute permeability associated to each soil. More...
 
void cs_gwf_soil_set_vgm_spf_param (cs_gwf_soil_t *soil, double theta_r, double alpha, double n, double L)
 Set a soil defined by a Van Genuchten-Mualem model in the case of single-phase flow in an (unsaturated) porous media. More...
 
void cs_gwf_soil_set_vgm_tpf_param (cs_gwf_soil_t *soil, double n, double pr_r, double sl_r, double sl_s)
 Set the parameters related to a Van Genuchten-Mualen model to defined the behavior of a soil in the case of two-phase flow in an porous media. More...
 
void cs_gwf_soil_set_vgm_tpf_advanced_param (cs_gwf_soil_t *soil, cs_gwf_soil_join_type_t sle_jtype, cs_gwf_soil_join_type_t kr_jtype, double sle_thres)
 Set advanced parameter settings related to a Van Genuchten-Mualen soil model. More...
 
void cs_gwf_soil_set_user_model_param (cs_gwf_soil_t *soil, void *param, cs_gwf_soil_update_t *update_func, cs_gwf_soil_free_param_t *free_param_func)
 Set a soil defined by a user-defined model. More...
 
void cs_gwf_soil_set_joining_poly_order (int order)
 Set the value of the polynomial order considered when regularizing the Van Genuchten-Mualen soil law near the saturated regime. Advanced usage. This function has to be called before calling the function cs_gwf_soil_set_vgm_tpf_param Default: 2. Available values: 2 or 3. More...
 

Typedef Documentation

◆ cs_gwf_soil_free_param_t

typedef void() cs_gwf_soil_free_param_t(void **p_param)

Generic function to set free the parameter structure associated to a soil.

Parameters
[in,out]p_paramdouble pointer to a structure cast on-the-fly

◆ cs_gwf_soil_tpf_eval_t

typedef void() cs_gwf_soil_tpf_eval_t(const cs_gwf_soil_vgm_tpf_param_t *sp, const double pc, double *sl, double *dsldpc, double *krl, double *krg)

Compute the values of the different properties related to a soil in the case of a Van Genuchten-Mualem model and a two-phase flow model.

Parameters
[in]spset of modelling parameters
[out]slliquid saturation
[out]dsldpcliquid capacity
[out]krlrelative permeability for the liquid phase
[out]krgrelative permeability for the gas phase

◆ cs_gwf_soil_update_t

typedef void() cs_gwf_soil_update_t(const cs_real_t t_eval, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_zone_t *zone, cs_gwf_soil_t *soil)

Generic function to update the properties related to a hydraulic model given the soil model. The soil parameters depend on the type of soil model.

Parameters
[in]t_evaltime at which one performs the evaluation
[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]zonepointer to a cs_zone_t
[in,out]soilpointer to the soil structure to update

Enumeration Type Documentation

◆ cs_gwf_soil_join_type_t

Kind of joining function used with closure laws.

Enumerator
CS_GWF_SOIL_JOIN_NOTHING 

No joining function

CS_GWF_SOIL_JOIN_C1_HYPERBOLIC 

C1 join using a hyperbolic function

CS_GWF_SOIL_JOIN_C1_EXPONENTIAL 

C1 join using an exponential function

CS_GWF_SOIL_JOIN_C1_POLY_ORDER2 

C1 join using a second order polynomial

CS_GWF_SOIL_N_JOINS 

◆ cs_gwf_soil_state_t

Kind of state in which a cell is.

Enumerator
CS_GWF_SOIL_STATE_SATURATED 

All the available space in the porous media is liquid

CS_GWF_SOIL_STATE_UNSATURATED 

Only a part of the porous media is filled with liquid

CS_GWF_SOIL_STATE_DRY 

All the available space in the porous media is gas or void

CS_GWF_SOIL_N_STATES 

Function Documentation

◆ cs_gwf_get_n_soils()

int cs_gwf_get_n_soils ( void  )

Get the number of allocated soils.

Returns
the number of allocated soils

◆ cs_gwf_soil_build_dual_porous_volume()

void cs_gwf_soil_build_dual_porous_volume ( const cs_cdo_quantities_t cdoq,
const cs_cdo_connect_t connect 
)

Build an array storing the dual volume associated to each vertex taking into account the porosity of the soil The computed quantity is stored as a static array. Use the function cs_gwf_soil_get_dual_vol_l()

Parameters
[in]cdoqadditional geometrical quantities for CDO schemes
[in]connectadditional connectivities for CDO schemes

◆ cs_gwf_soil_by_id()

cs_gwf_soil_t* cs_gwf_soil_by_id ( int  id)

Retrieve a soil structure from its id.

Parameters
[in]idid to look for
Returns
a pointer to a cs_gwf_soil_t structure

◆ cs_gwf_soil_by_name()

cs_gwf_soil_t* cs_gwf_soil_by_name ( const char *  name)

Retrieve a soil structure from its name.

Parameters
[in]namename to look for
Returns
a pointer to a cs_gwf_soil_t structure

◆ cs_gwf_soil_create()

cs_gwf_soil_t* cs_gwf_soil_create ( const cs_zone_t zone,
cs_gwf_model_type_t  hydraulic_model,
cs_gwf_soil_model_t  model,
cs_property_type_t  perm_type,
double  k_abs[3][3],
double  porosity,
double  bulk_density,
void *  hydraulic_context 
)

Create a new cs_gwf_soil_t structure and add it to the array of soils. An initialization by default of all members is performed.

Parameters
[in]zonepointer to a volume zone structure
[in]hydraulic_modelmain hydraulic model for the module
[in]modeltype of model for the soil behavior
[in]perm_typetype of permeability (iso/anisotropic)
[in]k_absabsolute (intrisic) permeability
[in]porosityporosity or max. moisture content
[in]bulk_densityvalue of the mass density
[in]hydraulic_contextpointer to the context structure
Returns
a pointer to the new allocated structure

◆ cs_gwf_soil_define_shared_properties()

void cs_gwf_soil_define_shared_properties ( cs_property_t abs_permeability,
cs_property_t soil_porosity 
)

Set the definition of the soil porosity and absolute permeability (which are properties always defined in the GWF module). One relies on the definition of these properties in each soil.

Parameters
[in,out]abs_permeabilitypointer to a cs_property_t structure
[in,out]soil_porositypointer to a cs_property_t structure

◆ cs_gwf_soil_define_sspf_property()

void cs_gwf_soil_define_sspf_property ( cs_property_t moisture_content)

Set the definition of the soil porosity and absolute porosity (which are properties always defined). This relies on the definition of each soil.

Parameters
[in,out]moisture_contentpointer to a cs_property_t structure

◆ cs_gwf_soil_finalize_setup()

void cs_gwf_soil_finalize_setup ( cs_gwf_model_type_t  gwf_model,
cs_flag_t  post_flag,
cs_lnum_t  n_cells 
)

Last initialization step for the soil structures/parameters.

Parameters
[in]gwf_modelmodelling used for the GWF module
[in]post_flagwhich post-processing to do
[in]n_cellsnumber of cells

◆ cs_gwf_soil_free_all()

void cs_gwf_soil_free_all ( void  )

Free all cs_gwf_soil_t structures.

◆ cs_gwf_soil_get_cell2soil()

const short int* cs_gwf_soil_get_cell2soil ( void  )

Get the array storing the associated soil for each cell.

Returns
a pointer to the array

◆ cs_gwf_soil_get_dual_porous_volume()

const double* cs_gwf_soil_get_dual_porous_volume ( void  )

Get the array storing the dual volume weighted by the soil porosity Array of size n_vertices.

Returns
a pointer to the requested array

◆ cs_gwf_soil_get_permeability_max_dim()

int cs_gwf_soil_get_permeability_max_dim ( void  )

Retrieve the max dim (aniso=9; iso=1) for the absolute permeability associated to each soil.

Returns
the associated max. dimension

◆ cs_gwf_soil_get_porosity()

cs_real_t cs_gwf_soil_get_porosity ( int  soil_id)

Get the porosity value for the given soil id.

Parameters
[in]soil_idid of the requested soil
Returns
the value of the soil porosity

◆ cs_gwf_soil_get_saturated_moisture()

cs_real_t cs_gwf_soil_get_saturated_moisture ( int  soil_id)

Get the saturated moisture for the given soil id.

Parameters
[in]soil_idid of the requested soil
Returns
the value of the saturated moisture

◆ cs_gwf_soil_get_soil_state()

const int* cs_gwf_soil_get_soil_state ( void  )

Get the array storing the soil state associated to each cell.

Returns
a pointer to the array (may be NULL)

◆ cs_gwf_soil_get_zone()

const cs_zone_t* cs_gwf_soil_get_zone ( int  soil_id)

Retrieve a zone associated to a soil from its id.

Parameters
[in]soil_idid to look for
Returns
a pointer to a zone structure or NULL

◆ cs_gwf_soil_log_setup()

void cs_gwf_soil_log_setup ( void  )

Summary of the settings related to all cs_gwf_soil_t structures.

◆ cs_gwf_soil_set_joining_poly_order()

void cs_gwf_soil_set_joining_poly_order ( int  order)

Set the value of the polynomial order considered when regularizing the Van Genuchten-Mualen soil law near the saturated regime. Advanced usage. This function has to be called before calling the function cs_gwf_soil_set_vgm_tpf_param Default: 2. Available values: 2 or 3.

Parameters
[in]ordervalue of the polynomial order (2 or 3)

◆ cs_gwf_soil_set_user_model_param()

void cs_gwf_soil_set_user_model_param ( cs_gwf_soil_t *  soil,
void *  param,
cs_gwf_soil_update_t update_func,
cs_gwf_soil_free_param_t free_param_func 
)

Set a soil defined by a user-defined model.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]parampointer to a structure cast on-the-fly
[in]update_funcfunction pointer to update propoerties
[in]free_param_funcfunction pointer to free the param struct.

◆ cs_gwf_soil_set_vgm_spf_param()

void cs_gwf_soil_set_vgm_spf_param ( cs_gwf_soil_t *  soil,
double  theta_r,
double  alpha,
double  n,
double  L 
)

Set a soil defined by a Van Genuchten-Mualem model in the case of single-phase flow in an (unsaturated) porous media.

The (effective) liquid saturation (also called moisture content) follows the identity S_l,eff = (S_l - theta_r)/(theta_s - theta_r) = (1 + |alpha . h|^n)^(-m)

The isotropic relative permeability is defined as: k_r = S_l,eff^L * (1 - (1 - S_l,eff^(1/m))^m))^2 where m = 1 - 1/n

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]theta_rresidual moisture
[in]alphascale parameter (in m^-1)
[in]nshape parameter
[in]Ltortuosity parameter

◆ cs_gwf_soil_set_vgm_tpf_advanced_param()

void cs_gwf_soil_set_vgm_tpf_advanced_param ( cs_gwf_soil_t *  soil,
cs_gwf_soil_join_type_t  sle_jtype,
cs_gwf_soil_join_type_t  kr_jtype,
double  sle_thres 
)

Set advanced parameter settings related to a Van Genuchten-Mualen soil model.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]sle_jtypetype of joining function for the effective Sl
[in]kr_jtypetype of joining function for krg and krl
[in]sle_thresvalue of the effective liquid saturation above which a joining function is used

◆ cs_gwf_soil_set_vgm_tpf_param()

void cs_gwf_soil_set_vgm_tpf_param ( cs_gwf_soil_t *  soil,
double  n,
double  pr_r,
double  sl_r,
double  sl_s 
)

Set the parameters related to a Van Genuchten-Mualen model to defined the behavior of a soil in the case of two-phase flow in an porous media.

The (effective) liquid saturation follows the identity sl_eff = (sl - sl_r)/(sl_s - sl_r) = (1 + |Pc/Pr_r|^n)^(-m) where m = 1 - 1/n

The isotropic relative permeability in the liquid and gaz are defined as: krl = sl_eff^(1/2) * (1 - (1 - sl_eff^(1/m))^m))^2 krg = (1 - sl_eff)^(1/2) * (1 - sl_eff^(1/m))^(2m)

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]nshape parameter
[in]pr_rreference (capillarity) pressure
[in]sl_rresidual liquid saturation
[in]sl_ssaturated (max.) liquid saturation

◆ cs_gwf_soil_update()

void cs_gwf_soil_update ( cs_real_t  time_eval,
const cs_mesh_t mesh,
const cs_cdo_connect_t connect,
const cs_cdo_quantities_t cdoq 
)

Update the soil properties.

Parameters
[in]time_evaltime at which one evaluates properties
[in]meshpointer to the mesh structure
[in]connectpointer to the cdo connectivity
[in]cdoqpointer to the cdo quantities

◆ cs_gwf_soil_update_soil_state()

void cs_gwf_soil_update_soil_state ( cs_lnum_t  n_cells,
const cs_real_t sliq 
)

Update the soil state associated to each cell w.r.t. the given liquid saturation.

Parameters
[in]n_cellsnumber of mesh cells
[in]sliqvalues of the liquid saturation in each cell