GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71933
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
N_gwflow.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * MODULE: Grass PDE Numerical Library
5 * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
6 * soerengebbert <at> gmx <dot> de
7 *
8 * PURPOSE: groundwater flow in porous media
9 * part of the gpde library
10 *
11 * COPYRIGHT: (C) 2000 by the GRASS Development Team
12 *
13 * This program is free software under the GNU General Public
14 * License (>=v2). Read the file COPYING that comes with GRASS
15 * for details.
16 *
17 *****************************************************************************/
18 
19 #ifndef _N_GWFLOW_H_
20 #define _N_GWFLOW_H_
21 #include "N_pde.h"
22 #include <math.h>
23 
24 #define N_GW_CONFINED 0 /*confined groundwater */
25 #define N_GW_UNCONFINED 1 /*unconfined groundwater */
26 
27 #define N_GW_DRY_CELL 0 /*a dry cell */
28 #define N_GW_SURFACE_CELL 1 /*a surface cell */
29 #define N_GW_NORMAL_CELL 2 /*a normal wet cell */
30 
31 /*!
32  * \brief This data structure contains all data needed to compute the
33  * groundwater mass balance in three dimension
34  * */
35 typedef struct
36 {
37  N_array_3d *phead; /*!piezometric head [m] */
38  N_array_3d *phead_start; /*!start conditions [m] */
39  N_array_3d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
40  N_array_3d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
41  N_array_3d *hc_z; /*!z part of the hydraulic conductivity tensor [m/s] */
42  N_array_3d *q; /*!sources and sinks [m^3/s] */
43  N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
44  N_array_3d *s; /*!specific yield [1/m] */
45  N_array_3d *nf; /*!effective porosity [-] */
46 
47  /*river */
48  N_array_3d *river_leak; /*!Leakage of the river bed [1/s] */
49  N_array_3d *river_head; /*!Waterlevel of the river [m] */
50  N_array_3d *river_bed; /*!Bed of the river [m] */
51 
52  /*drainage */
53  N_array_3d *drain_leak; /*!Leakage of the drainage bed [1/s] */
54  N_array_3d *drain_bed; /*!Bed of the drainage [m] */
55 
56  N_array_3d *status; /*!active/inactive/dirichlet cell status */
57  N_array_3d *drycells; /*!array of dry cells */
58 
59  double dt; /*!calculation time [s] */
60 
62 
63 /*!
64  * \brief This data structure contains all data needed to compute the
65  * groundwater mass balance in two dimension
66  * */
67 typedef struct
68 {
69  N_array_2d *phead; /*!piezometric head [m] */
70  N_array_2d *phead_start; /*!start conditions [m] */
71  N_array_2d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
72  N_array_2d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
73  N_array_2d *q; /*!sources and sinks [m^3/s] */
74  N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
75  N_array_2d *s; /*!specific yield [1/m] */
76  N_array_2d *nf; /*!effective porosity [-] */
77 
78  /*river */
79  N_array_2d *river_leak; /*!Leakage of the river bed [1/s] */
80  N_array_2d *river_head; /*!Waterlevel of the river [m] */
81  N_array_2d *river_bed; /*!Bed of the river [m] */
82 
83  /*drainage */
84  N_array_2d *drain_leak; /*!Leakage of the drainage bed [1/s] */
85  N_array_2d *drain_bed; /*!Bed of the drainage */
86 
87 
88  N_array_2d *top; /*!top surface of the quifer [m] */
89  N_array_2d *bottom; /*!bottom of the aquifer [m] */
90 
91  N_array_2d *status; /*!active/inactive/dirichlet cell status */
92  N_array_2d *drycells; /*!array of dry cells */
93 
94  double dt; /*!calculation time */
95  int gwtype; /*!Which type of groundwater, N_GW_CONFINED or N_GW_UNCONFIED */
96 
98 
99 extern N_data_star *N_callback_gwflow_3d(void *gwdata, N_geom_data * geom,
100  int col, int row, int depth);
101 extern N_data_star *N_callback_gwflow_2d(void *gwdata, N_geom_data * geom,
102  int col, int row);
104  N_geom_data * geom, N_array_3d * budget);
106  N_geom_data * geom, N_array_2d * balance);
108  int river, int drain);
109 extern N_gwflow_data2d *N_alloc_gwflow_data2d(int cols, int rows, int river,
110  int drain);
111 extern void N_free_gwflow_data3d(N_gwflow_data3d * data);
112 extern void N_free_gwflow_data2d(N_gwflow_data2d * data);
113 #endif
N_array_2d * status
Definition: N_gwflow.h:91
N_array_2d * top
Definition: N_gwflow.h:88
Matrix entries for a mass balance 5/7/9 star system.
Definition: N_pde.h:272
N_array_2d * s
Definition: N_gwflow.h:75
N_array_2d * hc_y
Definition: N_gwflow.h:72
N_array_2d * drycells
Definition: N_gwflow.h:92
N_array_2d * river_bed
Definition: N_gwflow.h:81
N_gwflow_data2d * N_alloc_gwflow_data2d(int cols, int rows, int river, int drain)
Alllocate memory for the groundwater calculation data structure in 2 dimensions.
Definition: n_gwflow.c:148
N_array_3d * river_head
Definition: N_gwflow.h:49
This data structure contains all data needed to compute the groundwater mass balance in three dimensi...
Definition: N_gwflow.h:35
N_data_star * N_callback_gwflow_3d(void *gwdata, N_geom_data *geom, int col, int row, int depth)
This callback function creates the mass balance of a 7 point star.
Definition: n_gwflow.c:263
N_array_2d * phead_start
Definition: N_gwflow.h:70
N_array_3d * river_leak
Definition: N_gwflow.h:48
N_array_2d * phead
Definition: N_gwflow.h:69
N_array_2d * q
Definition: N_gwflow.h:73
void N_free_gwflow_data2d(N_gwflow_data2d *data)
Release the memory of the groundwater flow data structure in two dimensions.
Definition: n_gwflow.c:200
N_array_3d * s
Definition: N_gwflow.h:44
N_array_3d * nf
Definition: N_gwflow.h:45
void N_gwflow_2d_calc_water_budget(N_gwflow_data2d *data, N_geom_data *geom, N_array_2d *budget)
This function computes the water budget of the entire groundwater.
Definition: n_gwflow.c:659
N_array_3d * river_bed
Definition: N_gwflow.h:50
N_array_3d * hc_z
Definition: N_gwflow.h:41
N_array_2d * r
Definition: N_gwflow.h:74
N_array_2d * r
Definition: N_gwflow.h:43
Geometric information about the structured grid.
Definition: N_pde.h:103
N_array_3d * status
Definition: N_gwflow.h:56
N_array_3d * drain_leak
Definition: N_gwflow.h:53
N_array_3d * drycells
Definition: N_gwflow.h:57
N_array_3d * phead_start
Definition: N_gwflow.h:38
N_array_3d * hc_y
Definition: N_gwflow.h:40
void N_gwflow_3d_calc_water_budget(N_gwflow_data3d *data, N_geom_data *geom, N_array_3d *budget)
This function computes the water budget of the entire groundwater.
Definition: n_gwflow.c:371
N_array_2d * hc_x
Definition: N_gwflow.h:71
int depths
number of depths for 3D data
Definition: gis.h:413
N_array_2d * river_head
Definition: N_gwflow.h:80
N_array_2d * nf
Definition: N_gwflow.h:76
N_array_2d * drain_bed
Definition: N_gwflow.h:85
void N_free_gwflow_data3d(N_gwflow_data3d *data)
Release the memory of the groundwater flow data structure in three dimensions.
Definition: n_gwflow.c:92
N_array_3d * hc_x
Definition: N_gwflow.h:39
N_array_2d * drain_leak
Definition: N_gwflow.h:84
int cols
Number of columns for 2D data.
Definition: gis.h:409
This data structure contains all data needed to compute the groundwater mass balance in two dimension...
Definition: N_gwflow.h:67
N_data_star * N_callback_gwflow_2d(void *gwdata, N_geom_data *geom, int col, int row)
This callback function creates the mass balance of a 5 point star.
Definition: n_gwflow.c:464
N_array_3d * drain_bed
Definition: N_gwflow.h:54
N_array_3d * phead
Definition: N_gwflow.h:37
N_array_2d * bottom
Definition: N_gwflow.h:89
N_array_3d * q
Definition: N_gwflow.h:42
N_gwflow_data3d * N_alloc_gwflow_data3d(int cols, int rows, int depths, int river, int drain)
Alllocate memory for the groundwater calculation data structure in 3 dimensions.
Definition: n_gwflow.c:38
N_array_2d * river_leak
Definition: N_gwflow.h:79
int rows
Number of rows for 2D data.
Definition: gis.h:405