This module contains the solver for the 1d Richards Equation for the 1d snowpack model.
#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 |
| ReSolver1d::ReSolver1d | ( | const SnowpackConfig & | cfg, |
| const bool & | matrix_part | ||
| ) |
|
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.
.
| m | number of rows in matrix |
| n | number of columns in matrix |
| lda | leading dimension of matrix |
| a | pointer to top-left corner of matrix to inverse |
| void ReSolver1d::SolveRichardsEquation | ( | SnowStation & | Xdata, |
| SurfaceFluxes & | Sdata, | ||
| double & | ql, | ||
| const mio::Date & | date | ||
| ) |
Solve Richards Equation
Solve Richards Equation
.
| Xdata | SnowStation object for which Richards Equation should be solved |
| Sdata | SurfaceFluxes object to store fluxes |
| ql | latent heat flux that should be considered as evaporation in the upper boundary condition |
| date | Date for wich the time step is executed, to provide a helpful error message when problems occur |
|
static |
Solving system of equations using Thomas Algorithm
The following function solves a tridiagonal system of equations using Thomas Algorithm
.
| 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 |
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
|
static |
|
static |
| double ReSolver1d::soilsurfacesourceflux |
| double ReSolver1d::surfacefluxrate |