SNOWPACK 20240428.b7bfb45
ReSolver1d Class Reference

Detailed Description

This module contains the solver for the 1d Richards Equation for the 1d snowpack model.

Author
Nander Wever

#include <ReSolver1d.h>

Public Member Functions

 ReSolver1d (const SnowpackConfig &cfg, const bool &matrix_part)
 
void SolveRichardsEquation (SnowStation &Xdata, SurfaceFluxes &Sdata, double &ql, const mio::Date &date)
 Solve Richards Equation
Solve Richards Equation
. More...
 

Static Public Member Functions

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 system of equations using Thomas Algorithm
. More...
 
static int pinv (int m, int n, int lda, double *a)
 Solving system of equations using matrix inversion
The following function solves a tridiagonal system of equations using
Moore-Penrose matrix inversion, using SVD, giving a pseudo-inverse of a.
. More...
 

Public Attributes

double surfacefluxrate
 
double soilsurfacesourceflux
 

Static Public Attributes

static const double max_theta_ice = 0.99
 
static const double REQUIRED_ACCURACY_THETA = 1E-5
 

Constructor & Destructor Documentation

◆ ReSolver1d()

ReSolver1d::ReSolver1d ( const SnowpackConfig cfg,
const bool &  matrix_part 
)

Member Function Documentation

◆ pinv()

int ReSolver1d::pinv ( int  m,
int  n,
int  lda,
double *  a 
)
static

Solving system of equations using matrix inversion
The following function solves a tridiagonal system of equations using
Moore-Penrose matrix inversion, using SVD, giving a pseudo-inverse of a.
.

Author
Nander Wever
Parameters
mnumber of rows in matrix
nnumber of columns in matrix
ldaleading dimension of matrix
apointer to top-left corner of matrix to inverse

◆ SolveRichardsEquation()

void ReSolver1d::SolveRichardsEquation ( SnowStation Xdata,
SurfaceFluxes Sdata,
double &  ql,
const mio::Date &  date 
)

Solve Richards Equation
Solve Richards Equation
.

Author
Nander Wever
Parameters
XdataSnowStation object for which Richards Equation should be solved
SdataSurfaceFluxes object to store fluxes
qllatent heat flux that should be considered as evaporation in the upper boundary condition
dateDate for wich the time step is executed, to provide a helpful error message when problems occur

◆ TDMASolver()

int ReSolver1d::TDMASolver ( size_t  n,
double *  a,
double *  b,
double *  c,
double *  v,
double *  x 
)
static

Solving system of equations using Thomas Algorithm
The following function solves a tridiagonal system of equations using Thomas Algorithm
.

Author
http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
Parameters
nnumber of equations
asub-diagonal (means it is the diagonal below the main diagonal) – indexed from 0..n-2
bthe main diagonal
csup-diagonal (means it is the diagonal above the main diagonal) – indexed from 0..n-2
vright part
xthe solution

n - number of equations a - sub-diagonal (means it is the diagonal below the main diagonal) – indexed from 0..n-2 b - the main diagonal c - sup-diagonal (means it is the diagonal above the main diagonal) – indexed from 0..n-2 v - right part x - the solution Return value: 0 = succes, otherwise: error

Member Data Documentation

◆ max_theta_ice

const double ReSolver1d::max_theta_ice = 0.99
static

◆ REQUIRED_ACCURACY_THETA

const double ReSolver1d::REQUIRED_ACCURACY_THETA = 1E-5
static

◆ soilsurfacesourceflux

double ReSolver1d::soilsurfacesourceflux

◆ surfacefluxrate

double ReSolver1d::surfacefluxrate

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