programmer's documentation
cs_groundwater.h
Go to the documentation of this file.
1 #ifndef __CS_GROUNDWATER_H__
2 #define __CS_GROUNDWATER_H__
3 
4 /*============================================================================
5  * Compute the wall distance using the CDO framework
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2015 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 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 #include "cs_equation.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*============================================================================
42  * Macro definitions
43  *============================================================================*/
44 
45 /* Tag to build a flag dedicated to the groundwater module */
46 #define CS_GROUNDWATER_POST_MOISTURE (1 << 0) // 1: post the moisture content
47 
48 /*============================================================================
49  * Type definitions
50  *============================================================================*/
51 
52 /* Type of predefined modelling for the groundwater flows */
53 typedef enum {
54 
55  CS_GROUNDWATER_MODEL_SATURATED, /* media is satured */
56  CS_GROUNDWATER_MODEL_GENUCHTEN, /* Van Genuchten-Mualem laws for dimensionless
57  moisture content and hydraulic conductivity
58  */
59  CS_GROUNDWATER_MODEL_TRACY, /* Tracy model for unsaturated soils */
60  CS_GROUNDWATER_MODEL_USER, /* User-defined model */
62 
64 
65 typedef struct _groundwater_t cs_groundwater_t;
66 
67 /*============================================================================
68  * Public function prototypes
69  *============================================================================*/
70 
71 /*----------------------------------------------------------------------------*/
77 /*----------------------------------------------------------------------------*/
78 
79 cs_groundwater_t *
81 
82 /*----------------------------------------------------------------------------*/
90 /*----------------------------------------------------------------------------*/
91 
92 cs_groundwater_t *
93 cs_groundwater_finalize(cs_groundwater_t *gw);
94 
95 /*----------------------------------------------------------------------------*/
103 /*----------------------------------------------------------------------------*/
104 
105 void
106 cs_groundwater_set_param(cs_groundwater_t *gw,
107  const char *keyname,
108  const char *keyval);
109 
110 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
118 void
119 cs_groundwater_summary(const cs_groundwater_t *gw);
120 
121 /*----------------------------------------------------------------------------*/
135 /*----------------------------------------------------------------------------*/
136 
137 cs_equation_t *
139  int richards_eq_id,
140  const char *model,
141  cs_property_t *permeability,
142  cs_property_t *soil_capacity,
143  cs_adv_field_t *adv_field,
144  cs_groundwater_t *gw);
145 
146 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 cs_equation_t *
169 cs_groundwater_add_tracer(cs_groundwater_t *gv,
170  int tracer_eq_id,
171  const char *eq_name,
172  const char *var_name,
173  cs_property_t *diff_property,
174  cs_real_3_t dispersivity,
175  double bulk_density,
176  double distrib_coef,
177  double reaction_rate);
178 
179 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 void
189 cs_groundwater_automatic_settings(cs_equation_t **equations,
190  cs_groundwater_t *gw);
191 
192 /*----------------------------------------------------------------------------*/
204 /*----------------------------------------------------------------------------*/
205 
206 void
208  const cs_time_step_t *time_step,
209  double dt_cur,
210  const cs_cdo_connect_t *connect,
211  const cs_cdo_quantities_t *cdoq,
212  cs_equation_t *eqs[],
213  cs_groundwater_t *gw);
214 
215 /*----------------------------------------------------------------------------*/
222 /*----------------------------------------------------------------------------*/
223 
224 void
225 cs_groundwater_post(const cs_time_step_t *time_step,
226  const cs_groundwater_t *gw);
227 
228 /*----------------------------------------------------------------------------*/
229 
231 
232 #endif /* __CS_GROUNDWATER_H__ */
time step descriptor
Definition: cs_time_step.h:51
Definition: cs_groundwater.h:55
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
Definition: cs_cdo_connect.h:67
Definition: cs_groundwater.h:60
Definition: cs_groundwater.h:61
Definition: cs_cdo_quantities.h:86
void cs_groundwater_post(const cs_time_step_t *time_step, const cs_groundwater_t *gw)
Predefined postprocessing for the groundwater module.
Definition: cs_groundwater.c:1118
Definition: cs_mesh.h:62
Definition: cs_groundwater.h:59
Definition: cs_groundwater.h:56
cs_equation_t * cs_groundwater_add_tracer(cs_groundwater_t *gv, int tracer_eq_id, const char *eq_name, const char *var_name, cs_property_t *diff_property, cs_real_3_t dispersivity, double bulk_density, double distrib_coef, double reaction_rate)
Add a new equation related to the groundwater flow module This equation is a specific unsteady advect...
Definition: cs_groundwater.c:843
cs_equation_t * cs_groundwater_init(const cs_cdo_connect_t *connect, int richards_eq_id, const char *model, cs_property_t *permeability, cs_property_t *soil_capacity, cs_adv_field_t *adv_field, cs_groundwater_t *gw)
Initialize the module dedicated to groundwater flows.
Definition: cs_groundwater.c:742
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:307
#define END_C_DECLS
Definition: cs_defs.h:430
void cs_groundwater_compute(const cs_mesh_t *mesh, const cs_time_step_t *time_step, double dt_cur, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *cdoq, cs_equation_t *eqs[], cs_groundwater_t *gw)
Compute the system related to groundwater flows.
Definition: cs_groundwater.c:1000
void cs_groundwater_automatic_settings(cs_equation_t **equations, cs_groundwater_t *gw)
Predefined settings for the module dedicated to groundwater flows.
Definition: cs_groundwater.c:891
cs_groundwater_model_t
Definition: cs_groundwater.h:53
cs_groundwater_t * cs_groundwater_finalize(cs_groundwater_t *gw)
Free the main structure related to groundwater flows.
Definition: cs_groundwater.c:590
void cs_groundwater_summary(const cs_groundwater_t *gw)
Summary of a cs_groundwater_t structure.
Definition: cs_groundwater.c:681
void cs_groundwater_set_param(cs_groundwater_t *gw, const char *keyname, const char *keyval)
Set parameters related to a cs_groundwater_t structure.
Definition: cs_groundwater.c:615
cs_groundwater_t * cs_groundwater_create(void)
Create a structure dedicated to manage groundwater flows.
Definition: cs_groundwater.c:547
Definition: mesh.f90:26