Richards
Solving The Richards equation with temporally periodic surface boundary conditions
settings.h
Go to the documentation of this file.
1 #ifndef SETTINGS_H_
2 #define SETTINGS_H_
3 
5 
6 #include <iostream>
7 #include <vector>
8 #include <string>
9 #include <string.h>
10 #include <cstdlib>
11 
13 struct Settings {
14 
15  //-------------------------------------
16  //grid settings
17 
19  double depth;
21  double delz0;
23  double delzfrac;
25  double delzmax;
27  bool save_grid;
28 
29  //-------------------------------------
30  //model set up and integration settings
31 
33  double tint;
35  double tunit;
37  long nsnap;
39  long nmaxout;
41  double dtfac;
42 
43  //-------------------------------------
44  //physical parameters
45 
47  double poro;
49  double perm;
51  double g;
53  double mu;
55  double rho;
57  double b;
59  double wilt;
60 
61  //-------------------------------------
62  //periodic forcing
63 
65  double tauevap;
67  double Levap;
69  double infper;
71  double infdur;
72 
73  //-------------------------------------
74  //trackers and output
75 
77  bool poroc;
79  bool poroe;
81  bool Ksat;
83  bool psisat;
85  bool dpsidw;
87  bool dwdz;
89  bool K;
91  bool D;
93  bool w;
95  bool we;
97  bool wall;
99  bool q;
101  bool qtop;
103  bool qmid;
105  bool qbot;
107  bool qall;
109  bool infil;
111  bool t;
113  bool tsnap;
114 
115 };
116 
118 bool eval_txt_bool (const char *s);
119 
121 bool cmp (const char *s1, const char *s2);
122 
124 long to_long(const char *val);
125 
127 
130 Settings parse_settings ( std::vector< std::vector< std::string > > sv );
131 
133 
137 
138 #endif
Settings::qall
bool qall
whether to track all fluxes
Definition: settings.h:107
Settings::perm
double perm
permeability (m^2)
Definition: settings.h:49
Settings::qbot
bool qbot
whether to track bottom flux
Definition: settings.h:105
Settings::K
bool K
whether to write hydraulic conductivity when snapping
Definition: settings.h:89
Settings::b
double b
Brooks-Corey parameter.
Definition: settings.h:57
Settings::infil
bool infil
whether to track infiltration flag
Definition: settings.h:109
Settings::dtfac
double dtfac
safety factor for stable time step
Definition: settings.h:41
Settings
container struct for all the settings variables needed for a BousThermModel run
Definition: settings.h:13
Settings::tauevap
double tauevap
evaporation timescale
Definition: settings.h:65
Settings::w
bool w
whether to water fraction profile when snapping
Definition: settings.h:93
cmp
bool cmp(const char *s1, const char *s2)
abbreviates strcmp
Definition: settings.cc:10
Settings::tsnap
bool tsnap
whether to track snap times
Definition: settings.h:113
Settings::t
bool t
whether to track step times
Definition: settings.h:111
Settings::tint
double tint
duration of solve
Definition: settings.h:33
Settings::wilt
double wilt
wilting saturation as fraction of porosity
Definition: settings.h:59
Settings::Levap
double Levap
evaporation depth
Definition: settings.h:67
Settings::mu
double mu
water viscosity (Pa*s)
Definition: settings.h:53
Settings::nmaxout
long nmaxout
maximum length of output vectors (subsampled to accomodate)
Definition: settings.h:39
Settings::delz0
double delz0
surface cell width (m)
Definition: settings.h:21
copy_settings
Settings copy_settings(Settings &b)
constructs a copy of another Settings object
Definition: settings.cc:87
Settings::poroc
bool poroc
whether to write porosity at cell centers
Definition: settings.h:77
Settings::poro
double poro
porosity
Definition: settings.h:47
Settings::infdur
double infdur
infiltration duration (s)
Definition: settings.h:71
Settings::qtop
bool qtop
whether to track top flux
Definition: settings.h:101
Settings::Ksat
bool Ksat
whether to write saturated hydraulic conductivity
Definition: settings.h:81
Settings::poroe
bool poroe
whether to write porosity at cell edges
Definition: settings.h:79
Settings::we
bool we
whether to write water fraction at cell edges when snapping
Definition: settings.h:95
Settings::psisat
bool psisat
whether to write saturated matric head
Definition: settings.h:83
Settings::infper
double infper
infiltration period (s)
Definition: settings.h:69
Settings::tunit
double tunit
time unit to use (number of seconds)
Definition: settings.h:35
Settings::g
double g
gravity (m/s^2)
Definition: settings.h:51
Settings::rho
double rho
water density (kg/m^3)
Definition: settings.h:55
Settings::dwdz
bool dwdz
whether to write moisture fraction derivative when snapping
Definition: settings.h:87
Settings::delzmax
double delzmax
maximum cell width (m)
Definition: settings.h:25
Settings::dpsidw
bool dpsidw
whether to write dpsidw when snapping
Definition: settings.h:85
Settings::q
bool q
whether to write water flux when snapping
Definition: settings.h:99
Settings::D
bool D
whether to write diffusivity when snapping
Definition: settings.h:91
eval_txt_bool
bool eval_txt_bool(const char *s)
converts a string into a bool if it's supposed to be "true" or "false"
Definition: settings.cc:5
parse_settings
Settings parse_settings(std::vector< std::vector< std::string > > sv)
parses a settings file and returns it in a Settings structure
Definition: settings.cc:20
Settings::wall
bool wall
whether to track all water fractions
Definition: settings.h:97
Settings::depth
double depth
domain depth (m)
Definition: settings.h:19
Settings::qmid
bool qmid
whether to track middle flux
Definition: settings.h:103
Settings::nsnap
long nsnap
number of snaps to take
Definition: settings.h:37
Settings::save_grid
bool save_grid
whether to write grid files
Definition: settings.h:27
to_long
long to_long(const char *val)
converts a character to an integet
Definition: settings.cc:15
Settings::delzfrac
double delzfrac
fraction increase for deeper neighbor cell
Definition: settings.h:23