This module contains the solver for the diffusion-advection equation for the transport of salinity.
- Author
- Nander Wever
#include <SalinityTransport.h>
◆ SalinityTransportSolvers
Enumerator |
---|
EXPLICIT | |
IMPLICIT | |
IMPLICIT2 | |
◆ SalinityTransport()
SalinityTransport::SalinityTransport |
( |
size_t |
nE | ) |
|
Class for solving diffusion-advection equation for salinity using the Crank-Nicolson implicit method
Solve Richards Equation
.
- Author
- Nander Wever
- Parameters
-
nE | Domain size (number of elements) |
◆ SolveSalinityTransportEquationExplicit()
bool SalinityTransport::SolveSalinityTransportEquationExplicit |
( |
const double |
dt, |
|
|
std::vector< double > & |
DeltaSal |
|
) |
| |
Solve diffusion-advection equation using the upwind explicit method
.
- Author
- Nander Wever
- Parameters
-
dt | Time step (s) |
DeltaSal | Result vector (change in salinity over time step) |
- Returns
- false on error, true otherwise
◆ SolveSalinityTransportEquationImplicit()
bool SalinityTransport::SolveSalinityTransportEquationImplicit |
( |
const double |
dt, |
|
|
std::vector< double > & |
DeltaSal, |
|
|
const double |
f, |
|
|
const bool |
DonorCell = true |
|
) |
| |
Solve diffusion-advection equation using the Crank-Nicolson implicit, or fully implicit method
.
- Author
- Nander Wever
This function solves the following equation (n and i denoting time and spatial level, respectively):
Here, results in the fully implicit scheme, whereas corresponds to the Crank-Nicolson scheme. The implicit scheme is first order accurate, whereas the Crank-Nicolson scheme is second order accurate. Furthermore, both are unconditionally stable and suffer only minimal numerical diffusion for the advection part. As with many other common schemes, the advection part is not perfectly conserving sharp transitions. Futhermore, the reason to not use the fully implicit or the Crank Nicolson scheme is the occurrence of spurious oscillations in the solution, which negatively impact the accuracy of the simulations more than the negative effect on computational efficiency imposed by the CFL criterion required for the explicit method (see SalinityTransport::SolveSalinityTransportEquationExcplicit).
- Parameters
-
dt | Time step (s) |
DeltaSal | Result vector (change in salinity over time step) |
f | Set to 0.5 for Crank-Nicolson, or to 1.0 for fully implicit |
DonorCell | If true, use mass-conserving donor-cell scheme (upwind). If false, use default implicit discretization |
- Returns
- false on error, true otherwise
◆ VerifyCFL()
bool SalinityTransport::VerifyCFL |
( |
const double |
dt | ) |
|
Check for CFL criterion
.
- Author
- Nander Wever
- Parameters
-
- Returns
- true when provided time step dt satisfies CFL criterion, false otherwise.
◆ VerifyImplicitDt()
bool SalinityTransport::VerifyImplicitDt |
( |
const double |
dt | ) |
|
Check for Implicit criterion
.
- Author
- Nander Wever
- Parameters
-
- Returns
- true when provided time step dt satisfies criterion to reduce spurious oscillations, false otherwise.
◆ BottomSalFlux
double SalinityTransport::BottomSalFlux |
◆ BottomSalinity
double SalinityTransport::BottomSalinity |
◆ BrineSal
std::vector<double> SalinityTransport::BrineSal |
std::vector<double> SalinityTransport::D |
◆ dz_
std::vector<double> SalinityTransport::dz_ |
◆ dz_down
std::vector<double> SalinityTransport::dz_down |
◆ dz_up
std::vector<double> SalinityTransport::dz_up |
◆ flux_down
std::vector<double> SalinityTransport::flux_down |
◆ flux_down_2
std::vector<double> SalinityTransport::flux_down_2 |
◆ flux_up
std::vector<double> SalinityTransport::flux_up |
◆ flux_up_2
std::vector<double> SalinityTransport::flux_up_2 |
◆ sb
std::vector<double> SalinityTransport::sb |
◆ theta1
std::vector<double> SalinityTransport::theta1 |
◆ theta2
std::vector<double> SalinityTransport::theta2 |
◆ TopSalFlux
double SalinityTransport::TopSalFlux |
◆ TopSalinity
double SalinityTransport::TopSalinity |
The documentation for this class was generated from the following files: