N_gwflow.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*****************************************************************************
  2. *
  3. * MODULE: Grass PDE Numerical Library
  4. * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
  5. * soerengebbert <at> gmx <dot> de
  6. *
  7. * PURPOSE: groundwater flow in porous media
  8. * part of the gpde library
  9. *
  10. * COPYRIGHT: (C) 2000 by the GRASS Development Team
  11. *
  12. * This program is free software under the GNU General Public
  13. * License (>=v2). Read the file COPYING that comes with GRASS
  14. * for details.
  15. *
  16. *****************************************************************************/
  17. #ifndef _N_GWFLOW_H_
  18. #define _N_GWFLOW_H_
  19. #include "N_pde.h"
  20. #include <math.h>
  21. #define N_GW_CONFINED 0 /*confined groundwater */
  22. #define N_GW_UNCONFINED 1 /*unconfined groundwater */
  23. #define N_GW_DRY_CELL 0 /*a dry cell */
  24. #define N_GW_SURFACE_CELL 1 /*a surface cell */
  25. #define N_GW_NORMAL_CELL 2 /*a normal wet cell */
  26. /*!
  27. * \brief This data structure contains all data needed to compute the
  28. * groundwater mass balance in three dimension
  29. * */
  30. typedef struct
  31. {
  32. N_array_3d *phead; /*!piezometric head [m] */
  33. N_array_3d *phead_start; /*!start conditions [m] */
  34. N_array_3d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
  35. N_array_3d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
  36. N_array_3d *hc_z; /*!z part of the hydraulic conductivity tensor [m/s] */
  37. N_array_3d *q; /*!sources and sinks [m^3/s] */
  38. N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
  39. N_array_3d *s; /*!specific yield [1/m] */
  40. N_array_3d *nf; /*!effective porosity [-] */
  41. /*river */
  42. N_array_3d *river_leak; /*!Leakage of the river bed [1/s] */
  43. N_array_3d *river_head; /*!Waterlevel of the river [m] */
  44. N_array_3d *river_bed; /*!Bed of the river [m] */
  45. /*drainage */
  46. N_array_3d *drain_leak; /*!Leakage of the drainage bed [1/s] */
  47. N_array_3d *drain_bed; /*!Bed of the drainage [m] */
  48. N_array_3d *status; /*!active/inactive/dirichlet cell status */
  49. N_array_3d *drycells; /*!array of dry cells */
  50. double dt; /*!calculation time [s] */
  51. } N_gwflow_data3d;
  52. /*!
  53. * \brief This data structure contains all data needed to compute the
  54. * groundwater mass balance in two dimension
  55. * */
  56. typedef struct
  57. {
  58. N_array_2d *phead; /*!piezometric head [m] */
  59. N_array_2d *phead_start; /*!start conditions [m] */
  60. N_array_2d *hc_x; /*!x part of the hydraulic conductivity tensor [m/s] */
  61. N_array_2d *hc_y; /*!y part of the hydraulic conductivity tensor [m/s] */
  62. N_array_2d *q; /*!sources and sinks [m^3/s] */
  63. N_array_2d *r; /*!recharge at the top of the gw leayer [1/s] */
  64. N_array_2d *s; /*!specific yield [1/m] */
  65. N_array_2d *nf; /*!effective porosity [-] */
  66. /*river */
  67. N_array_2d *river_leak; /*!Leakage of the river bed [1/s] */
  68. N_array_2d *river_head; /*!Waterlevel of the river [m] */
  69. N_array_2d *river_bed; /*!Bed of the river [m] */
  70. /*drainage */
  71. N_array_2d *drain_leak; /*!Leakage of the drainage bed [1/s] */
  72. N_array_2d *drain_bed; /*!Bed of the drainage */
  73. N_array_2d *top; /*!top surface of the quifer [m] */
  74. N_array_2d *bottom; /*!bottom of the aquifer [m] */
  75. N_array_2d *status; /*!active/inactive/dirichlet cell status */
  76. N_array_2d *drycells; /*!array of dry cells */
  77. double dt; /*!calculation time */
  78. int gwtype; /*!Which type of groundwater, N_GW_CONFINED or N_GW_UNCONFIED */
  79. } N_gwflow_data2d;
  80. extern N_data_star *N_callback_gwflow_3d(void *gwdata, N_geom_data * geom,
  81. int col, int row, int depth);
  82. extern N_data_star *N_callback_gwflow_2d(void *gwdata, N_geom_data * geom,
  83. int col, int row);
  84. extern void N_gwflow_3d_calc_water_budget(N_gwflow_data3d * data,
  85. N_geom_data * geom, N_array_3d * budget);
  86. extern void N_gwflow_2d_calc_water_budget(N_gwflow_data2d * data,
  87. N_geom_data * geom, N_array_2d * balance);
  88. extern N_gwflow_data3d *N_alloc_gwflow_data3d(int cols, int rows, int depths,
  89. int river, int drain);
  90. extern N_gwflow_data2d *N_alloc_gwflow_data2d(int cols, int rows, int river,
  91. int drain);
  92. extern void N_free_gwflow_data3d(N_gwflow_data3d * data);
  93. extern void N_free_gwflow_data2d(N_gwflow_data2d * data);
  94. #endif