Element-wise calculation of the Navier-Stokes residual for models using the staggered discretization. More...
#include <dumux/freeflow/navierstokes/momentum/localresidual.hh>
Element-wise calculation of the Navier-Stokes residual for models using the staggered discretization.
Public Types | |
using | ElementResidualVector = typename ParentType::ElementResidualVector |
Public Member Functions | |
NumEqVector | computeStorage (const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars, const bool isPreviousStorage=false) const |
Calculate the source term of the equation. More... | |
NumEqVector | computeSource (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const |
Calculate the source term of the equation. More... | |
NumEqVector | computeFlux (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache, const ElementBoundaryTypes &elemBcTypes) const |
Evaluates the mass flux over a face of a sub control volume. More... | |
NumEqVector | maybeHandleDirichletBoundary (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
NumEqVector | maybeHandleNeumannBoundary (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Implementation & | asImp_ () |
Returns the implementation of the problem (i.e. static polymorphism) More... | |
const Implementation & | asImp_ () const |
Returns the implementation of the problem (i.e. static polymorphism) More... | |
void | evalFlux (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
evaluate flux residuals for one sub control volume face and add to residual More... | |
NumEqVector | evalFlux (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
evaluate flux residuals for one sub control volume face More... | |
void | evalStorage (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &prevElemVolVars, const ElementVolumeVariables &curElemVolVars, const SubControlVolume &scv) const |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems. More... | |
ElementResidualVector | evalStorage (const Problem &problem, const Element &element, const GridGeometry &gridGeometry, const GridVariables &gridVariables, const SolutionVector &sol) const |
Compute the storage term for the current solution. More... | |
ElementResidualVector | evalStorage (const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &prevElemVolVars, const ElementVolumeVariables &curElemVolVars) const |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems. More... | |
void | evalStorage (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &prevElemVolVars, const ElementVolumeVariables &curElemVolVars, const SubControlVolume &scv) const |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems. More... | |
Discretization specific interface | |
| |
void | evalFlux (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the flux local residual, i.e. the deviation of the flux term from zero. More... | |
NumEqVector | evalFlux (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the flux local residual, i.e. the deviation of the flux term from zero. More... | |
void | evalStorage (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &prevElemVolVars, const ElementVolumeVariables &curElemVolVars, const SubControlVolume &scv) const |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems. More... | |
void | evalSource (ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &curElemVolVars, const SubControlVolume &scv) const |
Compute the source local residual, i.e. the deviation of the source term from zero. More... | |
Model specific interface | |
| |
NumEqVector | computeSource (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const |
Calculate the source term of the equation. More... | |
NumEqVector | computeStorage (const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const |
Calculate the source term of the equation. More... | |
NumEqVector | computeFlux (const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const |
Calculate the flux term of the equation. More... | |
Main interface | |
| |
ElementResidualVector | evalStorage (const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &prevElemVolVars, const ElementVolumeVariables &curElemVolVars) const |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems. More... | |
ElementResidualVector | evalFluxAndSource (const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const ElementBoundaryTypes &bcTypes) const |
Interfaces for analytic Jacobian computation | |
template<class PartialDerivativeMatrix > | |
void | addStorageDerivatives (PartialDerivativeMatrix &partialDerivatives, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const VolumeVariables &curVolVars, const SubControlVolume &scv) const |
Compute the derivative of the storage residual. More... | |
template<class PartialDerivativeMatrix > | |
void | addSourceDerivatives (PartialDerivativeMatrix &partialDerivatives, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const VolumeVariables &curVolVars, const SubControlVolume &scv) const |
Compute the derivative of the source residual. More... | |
template<class PartialDerivativeMatrices , class T = TypeTag> | |
std::enable_if_t< GetPropType< T, Properties::GridGeometry >::discMethod !=DiscretizationMethods::box, void > | addFluxDerivatives (PartialDerivativeMatrices &derivativeMatrices, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &curElemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the derivative of the flux residual. More... | |
template<class JacobianMatrix , class T = TypeTag> | |
std::enable_if_t< GetPropType< T, Properties::GridGeometry >::discMethod==DiscretizationMethods::box, void > | addFluxDerivatives (JacobianMatrix &A, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &curElemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the derivative of the flux residual for the box method. More... | |
template<class PartialDerivativeMatrices > | |
void | addCCDirichletFluxDerivatives (PartialDerivativeMatrices &derivativeMatrices, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &curElemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the derivative of the Dirichlet flux residual for cell-centered schemes. More... | |
template<class PartialDerivativeMatrices > | |
void | addRobinFluxDerivatives (PartialDerivativeMatrices &derivativeMatrices, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &curElemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const |
Compute the derivative of Robin type boundary conditions ("solution dependent Neumann") More... | |
Interfaces accessed by local residual implementations | |
const Problem & | problem () const |
the problem More... | |
const TimeLoop & | timeLoop () const |
bool | isStationary () const |
returns true if the residual is stationary More... | |
Implementation & | asImp () |
const Implementation & | asImp () const |
|
inherited |
|
inlineinherited |
Compute the derivative of the Dirichlet flux residual for cell-centered schemes.
|
inlineinherited |
Compute the derivative of the flux residual for the box method.
|
inlineinherited |
Compute the derivative of the flux residual.
|
inlineinherited |
Compute the derivative of Robin type boundary conditions ("solution dependent Neumann")
|
inlineinherited |
Compute the derivative of the source residual.
|
inlineinherited |
Compute the derivative of the storage residual.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inline |
Returns the implementation of the problem (i.e. static polymorphism)
|
inline |
Returns the implementation of the problem (i.e. static polymorphism)
|
inlineinherited |
Calculate the flux term of the equation.
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
elemVolVars | The volume variables associated with the element stencil |
scvf | The sub-control volume over which we integrate the flux |
elemFluxVarsCache | the flux variable caches for the element's flux stencils |
|
inline |
Evaluates the mass flux over a face of a sub control volume.
problem | The problem |
element | The element |
fvGeometry | The finite volume geometry context |
elemVolVars | The volume variables for all flux stencil elements |
scvf | The sub control volume face to compute the flux on |
elemFluxVarsCache | The cache related to flux computation |
elemBcTypes | The element boundary condition types |
|
inlineinherited |
Calculate the source term of the equation.
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
elemVolVars | The volume variables associated with the element stencil |
scv | The sub-control volume over which we integrate the source term |
|
inline |
Calculate the source term of the equation.
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
elemVolVars | The volume variables associated with the element stencil |
scv | The sub-control volume over which we integrate the source term |
|
inlineinherited |
Calculate the source term of the equation.
problem | The problem to solve |
scv | The sub-control volume over which we integrate the storage term |
volVars | The volume variables associated with the scv |
|
inline |
Calculate the source term of the equation.
problem | The problem to solve |
scv | The sub-control volume over which we integrate the storage term |
volVars | The volume variables associated with the scv |
isPreviousStorage | Bool transferring the information if the storage term is computed at the current or previous time step |
|
inlineinherited |
evaluate flux residuals for one sub control volume face
|
inlineinherited |
Compute the flux local residual, i.e. the deviation of the flux term from zero.
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
elemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
elemFluxVarsCache | The flux variable caches for the element stencil |
scvf | The sub control volume face the flux term is integrated over |
|
inlineinherited |
evaluate flux residuals for one sub control volume face and add to residual
|
inlineinherited |
Compute the flux local residual, i.e. the deviation of the flux term from zero.
residual | The residual vector to fill |
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
elemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
elemBcTypes | the boundary types for the boundary entities of an elements |
elemFluxVarsCache | The flux variable caches for the element stencil |
scvf | The sub control volume face the flux term is integrated over |
|
inlineinherited |
|
inlineinherited |
Compute the source local residual, i.e. the deviation of the source term from zero.
residual | The residual vector to fill |
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
scv | The sub control volume the source term is integrated over |
Compute source with the model specific storage residual
subtract source from local rate (sign convention in user interface)
|
inlineinherited |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems.
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
prevElemVolVars | The volume averaged variables for all sub-control volumes of the element at the previous time level |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
|
inlineinherited |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems.
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
prevElemVolVars | The volume averaged variables for all sub-control volumes of the element at the previous time level |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
|
inlineinherited |
Compute the storage term for the current solution.
This can be used to figure out how much of each conservation quantity is inside the element.
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the storage term ought to be calculated |
gridGeometry | The finite-volume grid geometry |
gridVariables | The grid variables (volume and flux variables) |
sol | The solution vector |
|
inlineinherited |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems.
residual | The residual vector to fill |
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
prevElemVolVars | The volume averaged variables for all sub-control volumes of the element at the previous time level |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
scv | The sub control volume the storage term is integrated over |
Compute storage with the model specific storage residual
|
inlineinherited |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems.
residual | The residual vector to fill |
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
prevElemVolVars | The volume averaged variables for all sub-control volumes of the element at the previous time level |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
scv | The sub control volume the storage term is integrated over |
Compute storage with the model specific storage residual
|
inlineinherited |
Compute the storage local residual, i.e. the deviation of the storage term from zero for instationary problems.
residual | The residual vector to fill |
problem | The problem to solve |
element | The DUNE Codim<0> entity for which the residual ought to be calculated |
fvGeometry | The finite-volume geometry of the element |
prevElemVolVars | The volume averaged variables for all sub-control volumes of the element at the previous time level |
curElemVolVars | The volume averaged variables for all sub-control volumes of the element at the current time level |
scv | The sub control volume the storage term is integrated over |
Compute storage with the model specific storage residual
|
inlineinherited |
returns true if the residual is stationary
|
inline |
Evaluate flux residuals for one sub control volume face when the element features at least one Dirichlet boundary condition Skip the flux calculation if the DOF of the associated sub control volume features an appropriate Dirichlet condition.
|
inline |
Evaluate flux residuals for one sub control volume face when the element features at least one Neumann boundary condition This requires special care.
|
inlineinherited |
the problem
|
inlineinherited |
the timeloop for instationary problems calling this for stationary leads to undefined behaviour