9.2
general documentation
cs_gwf_hydraulic_model.h
Go to the documentation of this file.
1#ifndef CS_GWF_HYDRAULIC_MODEL_H
2#define CS_GWF_HYDRAULIC_MODEL_H
3
4/*============================================================================
5 * Structures related to the hydraulic models available in the GWF module
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------
29 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "base/cs_defs.h"
33
35#include "alge/cs_param_sles.h"
36
37/*============================================================================
38 * Macro definitions
39 *============================================================================*/
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
46
47/*----------------------------------------------------------------------------*/
59/*----------------------------------------------------------------------------*/
60
61typedef void
63 const cs_cdo_quantities_t *cdoq,
64 cs_real_t t_eval,
65 bool cur2prev,
66 cs_gwf_darcy_flux_t *darcy);
67
68/* ++++++++++++++++++++++++++++++++++++++++++++++ */
69/* Saturated single-phase flows in a porous media */
70/* ++++++++++++++++++++++++++++++++++++++++++++++ */
71
81typedef struct {
82
95
108
120
136
142
143/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
144/* Unsaturated single-phase flows in a porous media */
145/* ++++++++++++++++++++++++++++++++++++++++++++++++ */
146
155typedef struct {
156
168
181
203
240
242
248
249/* +++++++++++++++++++++++++++++++++ */
250/* Two-phase flows in a porous media */
251/* +++++++++++++++++++++++++++++++++ */
252
273typedef enum {
274
277
279
281
288typedef enum {
289
294
296
298
300
328typedef struct {
329
330 /* Set of equations associated to this modelling */
331
344
352
359
366
373
390
414
415 /* Properties associated to a discrete term in the system of equations
416 *
417 * \var time_wc_pty
418 * Property related to the unsteady term of the water conservation equation
419 * w.r.t. the capillary pressure
420 *
421 * \var diff_wl_pty
422 * Property related to the diffusion term of the water conservation equation
423 * w.r.t. the pressure in the liquid phase
424 *
425 * \var time_hc_pty
426 * Property related to the unsteady term of the hydrogen conservation equation
427 * w.r.t. the capillary pressure
428 *
429 * \var diff_hc_pty
430 * Property related to the diffusion term of the hydrogen conservation
431 * equation w.r.t. the capillary pressure
432 *
433 * \var time_hl_pty
434 * Property related to the unsteady term of the hydrogen conservation equation
435 * w.r.t. the pressure in the liquid phase.
436 *
437 * \var diff_hl_pty
438 * Property related to the diffusion term of the hydrogen conservation
439 * equation w.r.t. the pressure in the liquid phase
440 *
441 * \var diff_g_pty
442 * Property used in the definition of the Darcy flux in the gas phase
443 */
444
447
450
453
455
497
520
559
567
618
623
625
631
632
640typedef struct {
641
666
687
700
705} cs_gwf_t;
706
707/*============================================================================
708 * Public function prototypes
709 *============================================================================*/
710
711/*----------------------------------------------------------------------------*/
712
713#endif /* CS_GWF_HYDRAULIC_MODEL_H */
Field descriptor.
Definition: cs_field.h:275
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
unsigned short int cs_flag_t
Definition: cs_defs.h:334
void() cs_gwf_darcy_update_t(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, cs_real_t t_eval, bool cur2prev, cs_gwf_darcy_flux_t *darcy)
Update the advection field/arrays related to the Darcy flux. The context associated to a cs_gwf_darcy...
Definition: cs_gwf_hydraulic_model.h:62
cs_gwf_tpf_approx_type_t
Type of approximation used for the computation of unsteady or diffusion properties.
Definition: cs_gwf_hydraulic_model.h:288
@ CS_GWF_TPF_APPROX_PC_CELL_VERTEX_AVERAGE
Definition: cs_gwf_hydraulic_model.h:291
@ CS_GWF_TPF_N_APPROX
Definition: cs_gwf_hydraulic_model.h:297
@ CS_GWF_TPF_APPROX_PC_VERTEX_AVERAGE
Definition: cs_gwf_hydraulic_model.h:293
@ CS_GWF_TPF_APPROX_VERTEX_SUBCELL
Definition: cs_gwf_hydraulic_model.h:295
@ CS_GWF_TPF_APPROX_PC_CELL_AVERAGE
Definition: cs_gwf_hydraulic_model.h:290
@ CS_GWF_TPF_APPROX_PC_EDGE_AVERAGE
Definition: cs_gwf_hydraulic_model.h:292
cs_gwf_tpf_solver_type_t
Type of solver considered for a two-phase flow model.
Definition: cs_gwf_hydraulic_model.h:273
@ CS_GWF_TPF_SOLVER_PLPC_COUPLED
Definition: cs_gwf_hydraulic_model.h:275
@ CS_GWF_TPF_SOLVER_PLPC_COUPLED_INCR
Definition: cs_gwf_hydraulic_model.h:276
@ CS_GWF_TPF_N_SOLVERS
Definition: cs_gwf_hydraulic_model.h:278
cs_gwf_model_type_t
Type of system of equation(s) to consider for the physical modelling.
Definition: cs_gwf_param.h:123
Structure and routines handling the SLES ((Sparse Linear Equation Solver) settings stored inside a cs...
cs_param_nl_algo_t
Class of non-linear iterative algorithm.
Definition: cs_param_types.h:715
Definition: cs_gwf_priv.h:51
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Main structure to handle a set of coupled equations.
Definition: cs_equation_system.h:121
Main structure to handle the discretization and the resolution of an equation.
Structure to handle a Darcy flux.
Structure to handle the modelling of a single-phase flows in a porous media considered as saturated.
Definition: cs_gwf_hydraulic_model.h:81
cs_gwf_darcy_flux_t * darcy
Definition: cs_gwf_hydraulic_model.h:107
cs_equation_t * richards
Definition: cs_gwf_hydraulic_model.h:94
cs_property_t * moisture_content
Definition: cs_gwf_hydraulic_model.h:119
cs_field_t * pressure_head
Definition: cs_gwf_hydraulic_model.h:135
Main set of parameters/structures to manage the groundwater flow (GWF) module. This is an explicit de...
Definition: cs_gwf_hydraulic_model.h:640
cs_gwf_model_type_t model
Definition: cs_gwf_hydraulic_model.h:663
cs_flag_t flag
Definition: cs_gwf_hydraulic_model.h:664
cs_flag_t post_flag
Definition: cs_gwf_hydraulic_model.h:665
int verbosity
Definition: cs_gwf_hydraulic_model.h:662
cs_property_t * soil_porosity
Definition: cs_gwf_hydraulic_model.h:685
void * model_context
Definition: cs_gwf_hydraulic_model.h:699
cs_property_t * abs_permeability
Definition: cs_gwf_hydraulic_model.h:686
Structure to handle the modelling of miscible or immiscible two-phase flows in a porous media.
Definition: cs_gwf_hydraulic_model.h:328
double cell_weight
weight associated to the cell value w.r.t. to the values at vertices when a CS_GWF_TPF_APPROX_PC_CELL...
Definition: cs_gwf_hydraulic_model.h:616
cs_real_t henry_constant
Definition: cs_gwf_hydraulic_model.h:566
cs_real_t l_diffusivity_h
Definition: cs_gwf_hydraulic_model.h:563
cs_real_t h_molar_mass
Definition: cs_gwf_hydraulic_model.h:564
cs_property_t * diff_hl_pty
Definition: cs_gwf_hydraulic_model.h:452
cs_property_t * time_hc_pty
Definition: cs_gwf_hydraulic_model.h:448
cs_property_t * time_hl_pty
Definition: cs_gwf_hydraulic_model.h:451
cs_field_t * c_pressure
Definition: cs_gwf_hydraulic_model.h:491
cs_property_t * diff_wl_pty
Definition: cs_gwf_hydraulic_model.h:446
cs_param_nl_algo_t nl_algo_type
Definition: cs_gwf_hydraulic_model.h:619
cs_equation_param_t * b01_w_eqp
Definition: cs_gwf_hydraulic_model.h:358
cs_iter_algo_param_aac_t anderson_param
Definition: cs_gwf_hydraulic_model.h:622
cs_field_t * l_saturation
Definition: cs_gwf_hydraulic_model.h:494
cs_gwf_tpf_solver_type_t solver_type
Type of solver considered to solve the system of equations (choice of main unknowns and strategy of r...
Definition: cs_gwf_hydraulic_model.h:613
cs_real_t * srct_h_array
Definition: cs_gwf_hydraulic_model.h:518
double upwind_weight
weight associated to the upwind value w.r.t. to the centered value There is no effect when CS_GWF_TPF...
Definition: cs_gwf_hydraulic_model.h:617
cs_real_t l_mass_density
Definition: cs_gwf_hydraulic_model.h:560
cs_property_t * time_wc_pty
Definition: cs_gwf_hydraulic_model.h:445
int nl_algo_verbosity
Definition: cs_gwf_hydraulic_model.h:620
cs_equation_t * w_eq
Definition: cs_gwf_hydraulic_model.h:343
cs_property_t * lsat_pty
Definition: cs_gwf_hydraulic_model.h:412
cs_real_t ref_temperature
Definition: cs_gwf_hydraulic_model.h:565
cs_gwf_darcy_flux_t * g_darcy
Definition: cs_gwf_hydraulic_model.h:389
cs_equation_param_t * b10_h_eqp
Definition: cs_gwf_hydraulic_model.h:365
cs_real_t g_viscosity
Definition: cs_gwf_hydraulic_model.h:562
cs_field_t * g_pressure
Definition: cs_gwf_hydraulic_model.h:493
cs_real_t * srct_w_array
Definition: cs_gwf_hydraulic_model.h:517
cs_field_t * g_rho_h
Definition: cs_gwf_hydraulic_model.h:496
bool enforce_pg_positivity
Apply a rescaling on the gas pressure to avoid a negative value.
Definition: cs_gwf_hydraulic_model.h:614
cs_field_t * l_rho_h
Definition: cs_gwf_hydraulic_model.h:495
cs_property_t * krl_pty
Definition: cs_gwf_hydraulic_model.h:410
cs_gwf_darcy_flux_t * l_darcy
Definition: cs_gwf_hydraulic_model.h:388
cs_equation_system_t * system
Definition: cs_gwf_hydraulic_model.h:372
cs_property_t * krg_pty
Definition: cs_gwf_hydraulic_model.h:411
cs_iter_algo_t * nl_algo
Definition: cs_gwf_hydraulic_model.h:624
cs_param_convergence_t nl_cvg_param
Definition: cs_gwf_hydraulic_model.h:621
bool is_miscible
Definition: cs_gwf_hydraulic_model.h:558
cs_real_t * lsat_pre_array
Definition: cs_gwf_hydraulic_model.h:519
cs_gwf_tpf_approx_type_t approx_type
type of approximation used for the computation of diffusion, unsteady coefficients
Definition: cs_gwf_hydraulic_model.h:615
cs_property_t * lcap_pty
Definition: cs_gwf_hydraulic_model.h:413
cs_equation_t * h_eq
Definition: cs_gwf_hydraulic_model.h:351
cs_field_t * l_pressure
Definition: cs_gwf_hydraulic_model.h:492
cs_real_t l_viscosity
Definition: cs_gwf_hydraulic_model.h:561
cs_property_t * diff_hc_pty
Definition: cs_gwf_hydraulic_model.h:449
cs_property_t * diff_g_pty
Definition: cs_gwf_hydraulic_model.h:454
Structure to handle the modelling of a single-phase flows in a porous media considered as saturated o...
Definition: cs_gwf_hydraulic_model.h:155
cs_gwf_darcy_flux_t * darcy
Definition: cs_gwf_hydraulic_model.h:180
cs_field_t * moisture_field
Definition: cs_gwf_hydraulic_model.h:237
cs_equation_t * richards
Definition: cs_gwf_hydraulic_model.h:167
cs_property_t * soil_capacity
Definition: cs_gwf_hydraulic_model.h:202
cs_real_t * head_in_law
Definition: cs_gwf_hydraulic_model.h:241
cs_property_t * moisture_content
Definition: cs_gwf_hydraulic_model.h:201
cs_field_t * pressure_head
Definition: cs_gwf_hydraulic_model.h:239
cs_field_t * capacity_field
Definition: cs_gwf_hydraulic_model.h:238
cs_field_t * permeability_field
Definition: cs_gwf_hydraulic_model.h:236
cs_property_t * permeability
Definition: cs_gwf_hydraulic_model.h:200
Structure storing all the parameters to drive the algorithm called Anderson acceleration.
Definition: cs_iter_algo.h:134
Structure to handle the convergence of an iterative algorithm.
Definition: cs_iter_algo.h:285
Set of parameters to check the convergence (or the divergence) of an iterative process (tolerances or...
Definition: cs_param_types.h:603
Structure associated to the definition of a property relying on the cs_xdef_t structure.