Richards
Solving The Richards equation with temporally periodic surface boundary conditions
Public Member Functions | Public Attributes | List of all members
Richards Class Reference

the main model class More...

#include <richards.h>

Inheritance diagram for Richards:

Public Member Functions

 Richards (Grid grid, Settings stgin)
 constructs More...
 
double f_poro (double depth, double poro)
 computes porosity as a function of depth (-)
 
double f_ksat (double depth, double perm)
 computes saturated permeability (m^2)
 
double f_Ksat (double depth, double g, double mu, double rho)
 computes saturated hydraulic conductivity (m/s)
 
double f_K (double w, double Ksat, double wsat, double b)
 computes Brooks-Corey hydraulic conductivity (m/s)
 
double f_psisat (double depth)
 computes the saturation matric head (m)
 
double f_dpsidw (double w, double psisat, double wsat, double b)
 computes derivative of Brooks-Corey matric head w/r/t water fraction (-)
 
bool f_infil (double t)
 infiltration flag
 
double f_w_bot (double poro)
 bottom boundary condition
 
void infil_times (double t, double *ta, double *tb)
 computes beginning and end of next or current infiltration event
 
double f_q (double K, double dpsidw, double dwdz, double satl, double satr)
 computes the flux between two cells
 
double f_dwdt (double qt, double qb, double delz)
 computes the time derivative of a cell, given fluxes on its sides
 
void update_q (double *w, double t)
 updates fluxes
 
void ode_fun (double *solin, double *fout)
 ode function for the integrator
 
double dt_adapt ()
 computes the next time step, based on the maximum diffusivity
 
void steady (double atol=1e-9, unsigned long ntol=1000000)
 integrates to steady state using current state boundary conditions
 
void spinup (double rtol=1e-12, bool quiet=true)
 integrates over infiltration periods until nearly periodic behavior is established
 
void before_solve ()
 does extra stuff before starting a solve
 
void after_snap (std::string dirout, long isnap, double t)
 does extra stuff after every snap
 
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
 
void after_solve ()
 does extra stuff after integrating
 

Public Attributes

Settings stg
 settings container
 
const long n
 number of cells
 
const double dep
 length/depth of domain (m)
 
const std::vector< double > ze
 cell edge coordinates (m)
 
const std::vector< double > zc
 cell center coordinates (m)
 
const std::vector< double > delz
 cell width (m)
 
const std::vector< double > delze
 cell widths used for stability calculations (m)
 
const std::vector< double > vefac
 factors for cell edge values
 
const std::vector< double > gefac
 factors for cell edge gradients
 
std::vector< double > dtcons
 constants for finding maximum stable time step
 
std::vector< double > poroc
 porosity at cell centers (maximum saturation fraction)
 
std::vector< double > poroe
 porosity at cell edges
 
std::vector< double > Ksat
 saturated hydraulic conductivity over depth (m/s)
 
std::vector< double > psisat
 saturated matric head (m)
 
std::vector< double > we
 water fractions at cell edges
 
std::vector< double > dpsidw
 derivative of psi w/r/t moisture
 
std::vector< double > dwdz
 derivative of moisture w/r/t z
 
std::vector< double > K
 hydraulic conductivity (unsaturated)
 
std::vector< double > D
 diffusivity (K*d psi /dt)
 
std::vector< double > q
 fluxes
 
std::vector< float > t
 time tracker
 
std::vector< float > tsnap
 snapshot times
 
std::vector< float > qtop
 top boundary flux
 
std::vector< float > qmid
 middle boundary flux
 
unsigned long mididx
 index of approximate middle edge
 
std::vector< float > qbot
 bottom boundary flux
 
std::vector< std::vector< float > > qall
 whether to track ALL fluxes
 
std::vector< std::vector< float > > wall
 whether to track ALL water fractions
 
std::vector< float > infil
 infiltration flag
 

Detailed Description

the main model class

Definition at line 54 of file richards.h.

Constructor & Destructor Documentation

◆ Richards()

Richards::Richards ( Grid  grid,
Settings  stgin 
)

constructs

Parameters
[in]grida Grid object defining the model domain and discretization
[in]stgina Settings object defining model settings and configuration

Definition at line 5 of file richards.cc.


The documentation for this class was generated from the following files: