My Project
programmer's documentation
Macros | Functions
cs_gwf_soil.c File Reference

Main functions dedicated to soil management in groundwater flows when using CDO schemes. More...

#include <assert.h>
#include <ctype.h>
#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_field.h"
#include "cs_hodge.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_mesh_location.h"
#include "cs_parall.h"
#include "cs_param.h"
#include "cs_post.h"
#include "cs_prototypes.h"
#include "cs_reco.h"
#include "cs_volume_zone.h"
#include "cs_gwf_soil.h"
Include dependency graph for cs_gwf_soil.c:

Macros

#define CS_GWF_SOIL_DBG   0
 

Functions

cs_gwf_soil_tcs_gwf_soil_add (const char *z_name, cs_gwf_soil_hydraulic_model_t model)
 Create and add a new cs_gwf_soil_t structure. A first initialization of all members by default is performed. More...
 
void cs_gwf_soil_free_all (void)
 Free all cs_gwf_soil_t structures. More...
 
int cs_gwf_get_n_soils (void)
 Get the number of allocated soils. More...
 
cs_gwf_soil_tcs_gwf_soil_by_id (int id)
 Retrieve a soil structure from its id. More...
 
cs_gwf_soil_tcs_gwf_soil_by_name (const char *name)
 Retrieve a soil structure from its name. More...
 
cs_real_t cs_gwf_soil_get_bulk_density (const cs_gwf_soil_t *soil)
 Retrieve the bulk density associated to the given soil structure. More...
 
void cs_gwf_set_iso_saturated_soil (cs_gwf_soil_t *soil, double k_s, double theta_s, double rho)
 Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability. More...
 
void cs_gwf_set_aniso_saturated_soil (cs_gwf_soil_t *soil, double *k_s, double theta_s, double rho)
 Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability. More...
 
void cs_gwf_set_iso_genuchten_soil (cs_gwf_soil_t *soil, double k_s, double theta_s, double theta_r, double rho)
 Set a soil defined by a Van Genuchten hydraulic model and attached to an anisotropic permeability. More...
 
void cs_gwf_set_aniso_genuchten_soil (cs_gwf_soil_t *soil, double *k_s, double theta_s, double theta_r, double rho)
 Set a soil defined by a Van Genuchten hydraulic model and attached to an anisotropic permeability. More...
 
void cs_gwf_set_user_soil (cs_gwf_soil_t *soil, void *input, cs_gwf_soil_update_t *update_func, cs_gwf_soil_finalize_t *free_func)
 Set a soil defined by a user-defined hydraulic model and attached to an anisotropic permeability. More...
 
void cs_gwf_soil_set_all_saturated (cs_property_t *permeability, cs_property_t *moisture_content, cs_field_t *moisture_field)
 Set the properties of the groundwater flow module all soils are considered as saturated. More...
 
void cs_gwf_build_cell2soil (cs_lnum_t n_cells)
 Build an array storing the associated soil for each cell. More...
 
const short int * cs_gwf_get_cell2soil (void)
 Get the array storing the associated soil for each cell. More...
 
void cs_gwf_soil_set_by_field (cs_property_t *permeability, cs_field_t *permea_field, cs_property_t *moisture_content, cs_field_t *moisture_field, cs_property_t *soil_capacity, cs_field_t *capacity_field)
 Set the properties of the groundwater flow module thanks to cs_field_t structure. The consequence is that the related cs_property_t structure relies on only one definition (i.e. for the whole mesh). Fields are updated by using the update function pointer associated to each soil. More...
 
void cs_gwf_soil_log_setup (void)
 Summary of the settings related to all cs_gwf_soil_t structures. More...
 

Detailed Description

Main functions dedicated to soil management in groundwater flows when using CDO schemes.

Macro Definition Documentation

◆ CS_GWF_SOIL_DBG

#define CS_GWF_SOIL_DBG   0

Function Documentation

◆ cs_gwf_build_cell2soil()

void cs_gwf_build_cell2soil ( cs_lnum_t  n_cells)

Build an array storing the associated soil for each cell.

Parameters
[in]n_cellsnumber of cells

◆ cs_gwf_get_cell2soil()

const short int* cs_gwf_get_cell2soil ( void  )

Get the array storing the associated soil for each cell.

◆ 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_set_aniso_genuchten_soil()

void cs_gwf_set_aniso_genuchten_soil ( cs_gwf_soil_t soil,
double *  k_s,
double  theta_s,
double  theta_r,
double  rho 
)

Set a soil defined by a Van Genuchten hydraulic model and attached to an anisotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the anisotropic saturated permeability
[in]theta_ssaturated moisture
[in]theta_rresidual moisture
[in]rhobulk density

◆ cs_gwf_set_aniso_saturated_soil()

void cs_gwf_set_aniso_saturated_soil ( cs_gwf_soil_t soil,
double *  k_s,
double  theta_s,
double  rho 
)

Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the anisotropic saturated permeability
[in]theta_ssaturated moisture
[in]rhobulk density

◆ cs_gwf_set_iso_genuchten_soil()

void cs_gwf_set_iso_genuchten_soil ( cs_gwf_soil_t soil,
double  k_s,
double  theta_s,
double  theta_r,
double  rho 
)

Set a soil defined by a Van Genuchten hydraulic model and attached to an anisotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the isotropic saturated permeability
[in]theta_ssaturated moisture
[in]theta_rresidual moisture
[in]rhobulk density

◆ cs_gwf_set_iso_saturated_soil()

void cs_gwf_set_iso_saturated_soil ( cs_gwf_soil_t soil,
double  k_s,
double  theta_s,
double  rho 
)

Set a soil defined by a saturated hydraulic model and attached to an isotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]k_svalue of the saturated permeability
[in]theta_ssaturated moisture
[in]rhobulk density

◆ cs_gwf_set_user_soil()

void cs_gwf_set_user_soil ( cs_gwf_soil_t soil,
void *  input,
cs_gwf_soil_update_t update_func,
cs_gwf_soil_finalize_t free_func 
)

Set a soil defined by a user-defined hydraulic model and attached to an anisotropic permeability.

Parameters
[in,out]soilpointer to a cs_gwf_soil_t structure
[in]inputpointer to a structure cast on-the-fly
[in]update_funcpointer to the function used for updating
[in]free_funcpointer to the function used for finalizing

◆ cs_gwf_soil_add()

cs_gwf_soil_t* cs_gwf_soil_add ( const char *  z_name,
cs_gwf_soil_hydraulic_model_t  model 
)

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

Parameters
[in]z_namename of the volume zone corresponding to the soil
[in]modeltype of modeling for the hydraulic behavior
Returns
a pointer to the new allocated structure

◆ 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_free_all()

void cs_gwf_soil_free_all ( void  )

Free all cs_gwf_soil_t structures.

◆ cs_gwf_soil_get_bulk_density()

cs_real_t cs_gwf_soil_get_bulk_density ( const cs_gwf_soil_t soil)

Retrieve the bulk density associated to the given soil structure.

Parameters
[in]soilpointer to a cs_gwf_soil_t structure
Returns

◆ 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_all_saturated()

void cs_gwf_soil_set_all_saturated ( cs_property_t permeability,
cs_property_t moisture_content,
cs_field_t moisture_field 
)

Set the properties of the groundwater flow module all soils are considered as saturated.

Parameters
[in,out]permeabilitypointer to a cs_property_t structure
[in,out]moisture_contentpointer to a cs_property_t structure
[in,out]moisture_fieldpointer to a cs_field_t structure

◆ cs_gwf_soil_set_by_field()

void cs_gwf_soil_set_by_field ( cs_property_t permeability,
cs_field_t permea_field,
cs_property_t moisture_content,
cs_field_t moisture_field,
cs_property_t soil_capacity,
cs_field_t capacity_field 
)

Set the properties of the groundwater flow module thanks to cs_field_t structure. The consequence is that the related cs_property_t structure relies on only one definition (i.e. for the whole mesh). Fields are updated by using the update function pointer associated to each soil.

Parameters
[in,out]permeabilitypointer to a cs_property_t structure
[in]permea_fieldpointer to a cs_field_t structure
[in,out]moisture_contentpointer to a cs_property_t structure
[in]moisture_fieldpointer to a cs_field_t structure
[in,out]soil_capacitypointer to a cs_property_t structure
[in]capacity_fieldpointer to a cs_field_t structure