49 static int TDMASolver (
size_t n,
double *a,
double *b,
double *c,
double *v,
double *x);
50 static int pinv(
int m,
int n,
int lda,
double *a);
56 enum watertransportmodels{UNDEFINED, BUCKET, NIED, RICHARDSEQUATION};
58 enum K_AverageTypes{ARITHMETICMEAN, LOGMEAN, GEOMETRICMEAN, HARMONICMEAN, MINIMUMVALUE, UPSTREAM};
60 enum K_frozen_soilTypes{IGNORE, OMEGA, LIQUIDPORESPACE};
62 enum SOLVERS{DGESVD, DGTSV, TDMA};
64 enum BoundaryConditions{DIRICHLET, NEUMANN, LIMITEDFLUXEVAPORATION, LIMITEDFLUXINFILTRATION, LIMITEDFLUX, WATERTABLE, FREEDRAINAGE, GRAVITATIONALDRAINAGE, SEEPAGEBOUNDARY, SEAICE};
66 enum SalinityMixingModels{NONE, CAPILLARY_GRAVITY, DENSITY_DIFFERENCE, DENSITY_GRAVITY};
68 watertransportmodels iwatertransportmodel_snow, iwatertransportmodel_soil;
70 std::string watertransportmodel_snow;
71 std::string watertransportmodel_soil;
72 BoundaryConditions BottomBC;
73 K_AverageTypes K_AverageType;
74 K_frozen_soilTypes K_frozen_soilType;
76 bool enable_pref_flow;
77 double pref_flow_param_th;
78 double pref_flow_param_N;
79 double pref_flow_param_heterogeneity_factor;
80 bool enable_ice_reservoir;
81 bool runSoilInitializer;
84 bool allow_surface_ponding;
89 std::vector<double> dz;
90 std::vector<double> z;
91 std::vector<double> dz_up;
92 std::vector<double> dz_down;
93 std::vector<double> dz_;
96 void InitializeGrid(
const std::vector<ElementData>& EMS,
const size_t& lowernode,
const size_t& uppernode);
97 std::vector<double> AssembleRHS(
const size_t& lowernode,
const size_t& uppernode,
const std::vector<double>& h_np1_m,
const std::vector<double>& theta_n,
const std::vector<double>& theta_np1_m,
const std::vector<double>& theta_i_n,
const std::vector<double>& theta_i_np1_m,
const std::vector<double>& s,
const double& dt,
const std::vector<double>& rho,
const std::vector<double>& k_np1_m_im12,
const std::vector<double>& k_np1_m_ip12,
const BoundaryConditions aTopBC,
const double& TopFluxRate,
const BoundaryConditions aBottomBC,
const double& BottomFluxRate,
const SnowStation& Xdata,
SalinityTransport& Salinity,
const SalinityMixingModels& SALINITY_MIXING);
100 const static double REQUIRED_ACCURACY_H, convergencecriterionthreshold, MAX_ALLOWED_DELTA_H;
101 const static size_t INCR_ITER, DECR_ITER, MAX_ITER, BS_MAX_ITER;
102 const static double MIN_VAL_TIMESTEP, MAX_VAL_TIMESTEP, MIN_DT_FOR_INFILTRATION;
103 const static double SF_epsilon;
This module contains the solver for the 1d Richards Equation for the 1d snowpack model.
Definition: ReSolver1d.h:36
static const double max_theta_ice
Definition: ReSolver1d.h:45
double soilsurfacesourceflux
Definition: ReSolver1d.h:43
ReSolver1d(const SnowpackConfig &cfg, const bool &matrix_part)
Definition: ReSolver1d.cc:76
void SolveRichardsEquation(SnowStation &Xdata, SurfaceFluxes &Sdata, double &ql, const mio::Date &date)
Solve Richards Equation Solve Richards Equation .
Definition: ReSolver1d.cc:653
static const double REQUIRED_ACCURACY_THETA
Definition: ReSolver1d.h:46
double surfacefluxrate
Definition: ReSolver1d.h:42
static int TDMASolver(size_t n, double *a, double *b, double *c, double *v, double *x)
Solving system of equations using Thomas Algorithm The following function solves a tridiagonal syste...
Definition: ReSolver1d.cc:232
static int pinv(int m, int n, int lda, double *a)
Solving system of equations using matrix inversion The following function solves a tridiagonal syste...
Definition: ReSolver1d.cc:392
This module contains the solver for the diffusion-advection equation for the transport of salinity.
Definition: SalinityTransport.h:34
SalinityTransportSolvers
Definition: SalinityTransport.h:43
Definition: DataClasses.h:604
Definition: SnowpackConfig.h:28
Definition: DataClasses.h:733