|
Richards
Solving The Richards equation with temporally periodic surface boundary conditions
|
Go to the documentation of this file.
51 #include "ode_ssp_3.h"
76 const std::vector<double>
ze;
78 const std::vector<double>
zc;
80 const std::vector<double>
delz;
82 const std::vector<double>
delze;
84 const std::vector<double>
vefac;
86 const std::vector<double>
gefac;
107 std::vector<double>
we;
113 std::vector<double>
K;
115 std::vector<double>
D;
117 std::vector<double>
q;
123 std::vector<float>
t;
135 std::vector< std::vector<float> >
qall;
137 std::vector< std::vector<float> >
wall;
145 double f_poro (
double depth,
double poro);
148 double f_ksat (
double depth,
double perm);
151 double f_Ksat (
double depth,
double g,
double mu,
double rho);
154 double f_K (
double w,
double Ksat,
double wsat,
double b);
175 double f_q (
double K,
double dpsidw,
double dwdz,
double satl,
double satr);
178 double f_dwdt (
double qt,
double qb,
double delz);
184 void ode_fun (
double *solin,
double *fout);
190 void steady (
double atol=1e-9,
unsigned long ntol=1000000);
193 void spinup (
double rtol=1e-12,
bool quiet=
true);
201 void after_snap (std::string dirout,
long isnap,
double t);
double f_w_bot(double poro)
bottom boundary condition
std::vector< std::vector< float > > qall
whether to track ALL fluxes
double f_dwdt(double qt, double qb, double delz)
computes the time derivative of a cell, given fluxes on its sides
std::vector< double > dwdz
derivative of moisture w/r/t z
std::vector< float > qtop
top boundary flux
std::vector< float > t
time tracker
double f_Ksat(double depth, double g, double mu, double rho)
computes saturated hydraulic conductivity (m/s)
container struct for all the settings variables needed for a BousThermModel run
void spinup(double rtol=1e-12, bool quiet=true)
integrates over infiltration periods until nearly periodic behavior is established
double f_ksat(double depth, double perm)
computes saturated permeability (m^2)
double f_poro(double depth, double poro)
computes porosity as a function of depth (-)
class for constructing and containing grid information
std::vector< float > qbot
bottom boundary flux
double f_q(double K, double dpsidw, double dwdz, double satl, double satr)
computes the flux between two cells
void before_solve()
does extra stuff before starting a solve
std::vector< double > K
hydraulic conductivity (unsaturated)
double dt_adapt()
computes the next time step, based on the maximum diffusivity
void q_updated(double t, bool *qup)
updates fluxes and sets a flag, if needed
void after_step(double tin)
does extra stuff after every step
Richards(Grid grid, Settings stgin)
constructs
const long n
number of cells
std::vector< float > infil
infiltration flag
void infil_times(double t, double *ta, double *tb)
computes beginning and end of next or current infiltration event
const std::vector< double > zc
cell center coordinates (m)
const std::vector< double > ze
cell edge coordinates (m)
std::vector< double > psisat
saturated matric head (m)
std::vector< double > dtcons
constants for finding maximum stable time step
const std::vector< double > delz
cell width (m)
double f_dpsidw(double w, double psisat, double wsat, double b)
computes derivative of Brooks-Corey matric head w/r/t water fraction (-)
unsigned long mididx
index of approximate middle edge
const std::vector< double > delze
cell widths used for stability calculations (m)
std::vector< double > Ksat
saturated hydraulic conductivity over depth (m/s)
double f_K(double w, double Ksat, double wsat, double b)
computes Brooks-Corey hydraulic conductivity (m/s)
std::vector< float > tsnap
snapshot times
std::vector< std::vector< float > > wall
whether to track ALL water fractions
bool f_infil(double t)
infiltration flag
std::vector< double > q
fluxes
void ode_fun(double *solin, double *fout)
ode function for the integrator
const double dep
length/depth of domain (m)
std::vector< double > D
diffusivity (K*d psi /dt)
std::vector< double > poroe
porosity at cell edges
void steady(double atol=1e-9, unsigned long ntol=1000000)
integrates to steady state using current state boundary conditions
std::vector< double > we
water fractions at cell edges
void update_q(double *w, double t)
updates fluxes
double f_psisat(double depth)
computes the saturation matric head (m)
std::vector< double > poroc
porosity at cell centers (maximum saturation fraction)
const std::vector< double > vefac
factors for cell edge values
std::vector< float > qmid
middle boundary flux
const std::vector< double > gefac
factors for cell edge gradients
void after_snap(std::string dirout, long isnap, double t)
does extra stuff after every snap
void after_solve()
does extra stuff after integrating
Settings stg
settings container
std::vector< double > dpsidw
derivative of psi w/r/t moisture