Commit ab78f171 authored by Timo Koch's avatar Timo Koch Committed by Timo Koch
Browse files

[richards][fluidsystems] Fix static assert in Richards and implement...

[richards][fluidsystems] Fix static assert in Richards and implement H2OAir::viscosityIsConstant interface
parent 8e3e6ea6
......@@ -61,6 +61,10 @@ and a liquid phase are present.
- __Richards__: Fixed a bug that creeped into the 1.5-phase model so it actually computes diffusion in the gas phase now.
- __Richards__: Fixed a bug that checked that the fluid viscosity is _not_ constant where as the check should have asserted that it is constant
- __Fluidsystems__: Implemented `isViscosityConstant()` for `H2OAir`
_ __Privarswitch__: Fixed a bug in the privar switch which did not fully reset the `switched` variable. This lead
to a possibly increased number of Newton iterations.
......
......@@ -170,6 +170,25 @@ public:
return H2O::liquidIsCompressible();
}
/*!
* \brief Returns true if and only if a fluid phase is assumed to
* have a constant viscosity.
*
* \param phaseIdx The index of the fluid phase to consider
*/
static constexpr bool viscosityIsConstant(int phaseIdx)
{
// water decides for the liquid phase
if (phaseIdx == liquidPhaseIdx)
return H2O::liquidViscosityIsConstant();
// air decides if policy is enabled
else if (phaseIdx == gasPhaseIdx && Policy::useAirViscosityAsGasMixtureViscosity())
return Air::gasViscosityIsConstant();
// in general it depends on the mixture
else
return false;
}
/*!
* \brief Returns true if and only if a fluid phase is assumed to
* be an ideal gas.
......
......@@ -267,7 +267,7 @@ public:
"richards/localresidual.hh: Analytic Jacobian not implemented for the water diffusion in air version!");
static_assert(!FluidSystem::isCompressible(0),
"richards/localresidual.hh: Analytic Jacobian only supports incompressible fluids!");
static_assert(!FluidSystem::viscosityIsConstant(0),
static_assert(FluidSystem::viscosityIsConstant(0),
"richards/localresidual.hh: Analytic Jacobian only supports fluids with constant viscosity!");
// get references to the two participating vol vars & parameters
......@@ -343,7 +343,7 @@ public:
"richards/localresidual.hh: Analytic Jacobian not implemented for the water diffusion in air version!");
static_assert(!FluidSystem::isCompressible(0),
"richards/localresidual.hh: Analytic Jacobian only supports incompressible fluids!");
static_assert(!FluidSystem::viscosityIsConstant(0),
static_assert(FluidSystem::viscosityIsConstant(0),
"richards/localresidual.hh: Analytic Jacobian only supports fluids with constant viscosity!");
// get references to the two participating vol vars & parameters
......@@ -441,7 +441,7 @@ public:
"richards/localresidual.hh: Analytic Jacobian not implemented for the water diffusion in air version!");
static_assert(!FluidSystem::isCompressible(0),
"richards/localresidual.hh: Analytic Jacobian only supports incompressible fluids!");
static_assert(!FluidSystem::viscosityIsConstant(0),
static_assert(FluidSystem::viscosityIsConstant(0),
"richards/localresidual.hh: Analytic Jacobian only supports fluids with constant viscosity!");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment