mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #659 from akva2/no_opm_in_opm
fixed: do not use Opm:: prefix when inside namespace Opm
This commit is contained in:
commit
eab6faeea3
@ -65,7 +65,7 @@ class BlackOilBoundaryRateVector : public GetPropType<TypeTag, Properties::RateV
|
|||||||
|
|
||||||
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
|
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
|
||||||
|
|
||||||
using EnergyModule = Opm::BlackOilEnergyModule<TypeTag, enableEnergy>;
|
using EnergyModule = BlackOilEnergyModule<TypeTag, enableEnergy>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
@ -146,8 +146,8 @@ public:
|
|||||||
specificEnthalpy = fluidState.enthalpy(phaseIdx);
|
specificEnthalpy = fluidState.enthalpy(phaseIdx);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
density = Opm::getValue(fluidState.density(phaseIdx));
|
density = getValue(fluidState.density(phaseIdx));
|
||||||
specificEnthalpy = Opm::getValue(fluidState.enthalpy(phaseIdx));
|
specificEnthalpy = getValue(fluidState.enthalpy(phaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (focusDofIdx == interiorDofIdx) {
|
else if (focusDofIdx == interiorDofIdx) {
|
||||||
@ -155,8 +155,8 @@ public:
|
|||||||
specificEnthalpy = insideIntQuants.fluidState().enthalpy(phaseIdx);
|
specificEnthalpy = insideIntQuants.fluidState().enthalpy(phaseIdx);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
density = Opm::getValue(insideIntQuants.fluidState().density(phaseIdx));
|
density = getValue(insideIntQuants.fluidState().density(phaseIdx));
|
||||||
specificEnthalpy = Opm::getValue(insideIntQuants.fluidState().enthalpy(phaseIdx));
|
specificEnthalpy = getValue(insideIntQuants.fluidState().enthalpy(phaseIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
Evaluation enthalpyRate = density*extQuants.volumeFlux(phaseIdx)*specificEnthalpy;
|
Evaluation enthalpyRate = density*extQuants.volumeFlux(phaseIdx)*specificEnthalpy;
|
||||||
@ -186,9 +186,9 @@ public:
|
|||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned i = 0; i < numEq; ++i) {
|
for (unsigned i = 0; i < numEq; ++i) {
|
||||||
Opm::Valgrind::CheckDefined((*this)[i]);
|
Valgrind::CheckDefined((*this)[i]);
|
||||||
}
|
}
|
||||||
Opm::Valgrind::CheckDefined(*this);
|
Valgrind::CheckDefined(*this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,8 +263,8 @@ public:
|
|||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned i = 0; i < numEq; ++i)
|
for (unsigned i = 0; i < numEq; ++i)
|
||||||
Opm::Valgrind::CheckDefined((*this)[i]);
|
Valgrind::CheckDefined((*this)[i]);
|
||||||
Opm::Valgrind::CheckDefined(*this);
|
Valgrind::CheckDefined(*this);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -70,10 +70,10 @@ class BlackOilBrineModule
|
|||||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using TabulatedFunction = typename Opm::Tabulated1DFunction<Scalar>;
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
||||||
using TabulatedTwoDFunction = typename Opm::IntervalTabulated2DFunction<Scalar>;
|
using TabulatedTwoDFunction = IntervalTabulated2DFunction<Scalar>;
|
||||||
|
|
||||||
static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx;
|
static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx;
|
||||||
static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx;
|
static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx;
|
||||||
@ -90,7 +90,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the brine module
|
* \brief Initialize all internal data structures needed by the brine module
|
||||||
*/
|
*/
|
||||||
static void initFromState(const Opm::EclipseState& eclState)
|
static void initFromState(const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
// some sanity checks: if brine are enabled, the BRINE keyword must be
|
// some sanity checks: if brine are enabled, the BRINE keyword must be
|
||||||
// present, if brine are disabled the keyword must not be present.
|
// present, if brine are disabled the keyword must not be present.
|
||||||
@ -216,7 +216,7 @@ public:
|
|||||||
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
||||||
|
|
||||||
// avoid singular matrix if no water is present.
|
// avoid singular matrix if no water is present.
|
||||||
surfaceVolumeWater = Opm::max(surfaceVolumeWater, 1e-10);
|
surfaceVolumeWater = max(surfaceVolumeWater, 1e-10);
|
||||||
|
|
||||||
// Brine in water phase
|
// Brine in water phase
|
||||||
const LhsEval massBrine = surfaceVolumeWater
|
const LhsEval massBrine = surfaceVolumeWater
|
||||||
@ -249,8 +249,8 @@ public:
|
|||||||
else {
|
else {
|
||||||
flux[contiBrineEqIdx] =
|
flux[contiBrineEqIdx] =
|
||||||
extQuants.volumeFlux(waterPhaseIdx)
|
extQuants.volumeFlux(waterPhaseIdx)
|
||||||
*Opm::decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
|
*decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
|
||||||
*Opm::decay<Scalar>(up.fluidState().saltConcentration());
|
*decay<Scalar>(up.fluidState().saltConcentration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <dune/common/fvector.hh>
|
#include <dune/common/fvector.hh>
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -92,7 +93,7 @@ class BlackOilDiffusionModule<TypeTag, /*enableDiffusion=*/true>
|
|||||||
enum { numComponents = FluidSystem::numComponents };
|
enum { numComponents = FluidSystem::numComponents };
|
||||||
enum { conti0EqIdx = Indices::conti0EqIdx };
|
enum { conti0EqIdx = Indices::conti0EqIdx };
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
@ -270,7 +271,7 @@ protected:
|
|||||||
if(!FluidSystem::enableDiffusion())
|
if(!FluidSystem::enableDiffusion())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, timeIdx);
|
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, timeIdx);
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!FluidSystem::phaseIsActive(phaseIdx)) {
|
if (!FluidSystem::phaseIsActive(phaseIdx)) {
|
||||||
@ -424,7 +425,7 @@ protected:
|
|||||||
-
|
-
|
||||||
intQuantsInside.fluidState().moleFraction(phaseIdx, compIdx))
|
intQuantsInside.fluidState().moleFraction(phaseIdx, compIdx))
|
||||||
* diffusivity / faceArea; //opm-models expects pr area flux
|
* diffusivity / faceArea; //opm-models expects pr area flux
|
||||||
Opm::Valgrind::CheckDefined(moleFractionGradientNormal_[phaseIdx][compIdx]);
|
Valgrind::CheckDefined(moleFractionGradientNormal_[phaseIdx][compIdx]);
|
||||||
|
|
||||||
// use the arithmetic average for the effective
|
// use the arithmetic average for the effective
|
||||||
// diffusion coefficients.
|
// diffusion coefficients.
|
||||||
@ -434,7 +435,7 @@ protected:
|
|||||||
intQuantsOutside.effectiveDiffusionCoefficient(phaseIdx, compIdx))
|
intQuantsOutside.effectiveDiffusionCoefficient(phaseIdx, compIdx))
|
||||||
/ 2;
|
/ 2;
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(effectiveDiffusionCoefficient_[phaseIdx][compIdx]);
|
Valgrind::CheckDefined(effectiveDiffusionCoefficient_[phaseIdx][compIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
// energys have been disabled at compile time
|
// energys have been disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Opm::VtkBlackOilEnergyModule<TypeTag>::registerParameters();
|
VtkBlackOilEnergyModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
// energys have been disabled at compile time
|
// energys have been disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
model.addOutputModule(new Opm::VtkBlackOilEnergyModule<TypeTag>(simulator));
|
model.addOutputModule(new VtkBlackOilEnergyModule<TypeTag>(simulator));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool primaryVarApplies(unsigned pvIdx)
|
static bool primaryVarApplies(unsigned pvIdx)
|
||||||
@ -150,7 +150,7 @@ public:
|
|||||||
if (!enableEnergy)
|
if (!enableEnergy)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto& poro = Opm::decay<LhsEval>(intQuants.porosity());
|
const auto& poro = decay<LhsEval>(intQuants.porosity());
|
||||||
|
|
||||||
// accumulate the internal energy of the fluids
|
// accumulate the internal energy of the fluids
|
||||||
const auto& fs = intQuants.fluidState();
|
const auto& fs = intQuants.fluidState();
|
||||||
@ -158,16 +158,16 @@ public:
|
|||||||
if (!FluidSystem::phaseIsActive(phaseIdx))
|
if (!FluidSystem::phaseIsActive(phaseIdx))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const auto& u = Opm::decay<LhsEval>(fs.internalEnergy(phaseIdx));
|
const auto& u = decay<LhsEval>(fs.internalEnergy(phaseIdx));
|
||||||
const auto& S = Opm::decay<LhsEval>(fs.saturation(phaseIdx));
|
const auto& S = decay<LhsEval>(fs.saturation(phaseIdx));
|
||||||
const auto& rho = Opm::decay<LhsEval>(fs.density(phaseIdx));
|
const auto& rho = decay<LhsEval>(fs.density(phaseIdx));
|
||||||
|
|
||||||
storage[contiEnergyEqIdx] += poro*S*u*rho;
|
storage[contiEnergyEqIdx] += poro*S*u*rho;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the internal energy of the rock
|
// add the internal energy of the rock
|
||||||
Scalar refPoro = intQuants.referencePorosity();
|
Scalar refPoro = intQuants.referencePorosity();
|
||||||
const auto& uRock = Opm::decay<LhsEval>(intQuants.rockInternalEnergy());
|
const auto& uRock = decay<LhsEval>(intQuants.rockInternalEnergy());
|
||||||
storage[contiEnergyEqIdx] += (1.0 - refPoro)*uRock;
|
storage[contiEnergyEqIdx] += (1.0 - refPoro)*uRock;
|
||||||
storage[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
|
storage[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
|
||||||
}
|
}
|
||||||
@ -214,8 +214,8 @@ public:
|
|||||||
|
|
||||||
const auto& volFlux = extQuants.volumeFlux(phaseIdx);
|
const auto& volFlux = extQuants.volumeFlux(phaseIdx);
|
||||||
flux[contiEnergyEqIdx] +=
|
flux[contiEnergyEqIdx] +=
|
||||||
Opm::decay<UpstreamEval>(fs.enthalpy(phaseIdx))
|
decay<UpstreamEval>(fs.enthalpy(phaseIdx))
|
||||||
* Opm::decay<UpstreamEval>(fs.density(phaseIdx))
|
* decay<UpstreamEval>(fs.density(phaseIdx))
|
||||||
* volFlux;
|
* volFlux;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ public:
|
|||||||
static Scalar computeResidualError(const EqVector& resid)
|
static Scalar computeResidualError(const EqVector& resid)
|
||||||
{
|
{
|
||||||
// do not weight the residual of energy when it comes to convergence
|
// do not weight the residual of energy when it comes to convergence
|
||||||
return std::abs(Opm::scalarValue(resid[contiEnergyEqIdx]));
|
return std::abs(scalarValue(resid[contiEnergyEqIdx]));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class DofEntity>
|
template <class DofEntity>
|
||||||
@ -469,7 +469,7 @@ class BlackOilEnergyExtensiveQuantities
|
|||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
||||||
|
|
||||||
@ -496,28 +496,28 @@ public:
|
|||||||
Evaluation deltaT;
|
Evaluation deltaT;
|
||||||
if (elemCtx.focusDofIndex() == inIdx)
|
if (elemCtx.focusDofIndex() == inIdx)
|
||||||
deltaT =
|
deltaT =
|
||||||
Opm::decay<Scalar>(exFs.temperature(/*phaseIdx=*/0))
|
decay<Scalar>(exFs.temperature(/*phaseIdx=*/0))
|
||||||
- inFs.temperature(/*phaseIdx=*/0);
|
- inFs.temperature(/*phaseIdx=*/0);
|
||||||
else if (elemCtx.focusDofIndex() == exIdx)
|
else if (elemCtx.focusDofIndex() == exIdx)
|
||||||
deltaT =
|
deltaT =
|
||||||
exFs.temperature(/*phaseIdx=*/0)
|
exFs.temperature(/*phaseIdx=*/0)
|
||||||
- Opm::decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
- decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
||||||
else
|
else
|
||||||
deltaT =
|
deltaT =
|
||||||
Opm::decay<Scalar>(exFs.temperature(/*phaseIdx=*/0))
|
decay<Scalar>(exFs.temperature(/*phaseIdx=*/0))
|
||||||
- Opm::decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
- decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
||||||
|
|
||||||
Evaluation inLambda;
|
Evaluation inLambda;
|
||||||
if (elemCtx.focusDofIndex() == inIdx)
|
if (elemCtx.focusDofIndex() == inIdx)
|
||||||
inLambda = inIq.totalThermalConductivity();
|
inLambda = inIq.totalThermalConductivity();
|
||||||
else
|
else
|
||||||
inLambda = Opm::decay<Scalar>(inIq.totalThermalConductivity());
|
inLambda = decay<Scalar>(inIq.totalThermalConductivity());
|
||||||
|
|
||||||
Evaluation exLambda;
|
Evaluation exLambda;
|
||||||
if (elemCtx.focusDofIndex() == exIdx)
|
if (elemCtx.focusDofIndex() == exIdx)
|
||||||
exLambda = exIq.totalThermalConductivity();
|
exLambda = exIq.totalThermalConductivity();
|
||||||
else
|
else
|
||||||
exLambda = Opm::decay<Scalar>(exIq.totalThermalConductivity());
|
exLambda = decay<Scalar>(exIq.totalThermalConductivity());
|
||||||
|
|
||||||
auto distVec = elemCtx.pos(exIdx, timeIdx);
|
auto distVec = elemCtx.pos(exIdx, timeIdx);
|
||||||
distVec -= elemCtx.pos(inIdx, timeIdx);
|
distVec -= elemCtx.pos(inIdx, timeIdx);
|
||||||
@ -560,14 +560,14 @@ public:
|
|||||||
- inFs.temperature(/*phaseIdx=*/0);
|
- inFs.temperature(/*phaseIdx=*/0);
|
||||||
else
|
else
|
||||||
deltaT =
|
deltaT =
|
||||||
Opm::decay<Scalar>(boundaryFs.temperature(/*phaseIdx=*/0))
|
decay<Scalar>(boundaryFs.temperature(/*phaseIdx=*/0))
|
||||||
- Opm::decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
- decay<Scalar>(inFs.temperature(/*phaseIdx=*/0));
|
||||||
|
|
||||||
Evaluation lambda;
|
Evaluation lambda;
|
||||||
if (ctx.focusDofIndex() == inIdx)
|
if (ctx.focusDofIndex() == inIdx)
|
||||||
lambda = inIq.totalThermalConductivity();
|
lambda = inIq.totalThermalConductivity();
|
||||||
else
|
else
|
||||||
lambda = Opm::decay<Scalar>(inIq.totalThermalConductivity());
|
lambda = decay<Scalar>(inIq.totalThermalConductivity());
|
||||||
|
|
||||||
auto distVec = scvf.integrationPos();
|
auto distVec = scvf.integrationPos();
|
||||||
distVec -= ctx.pos(inIdx, timeIdx);
|
distVec -= ctx.pos(inIdx, timeIdx);
|
||||||
|
@ -83,10 +83,10 @@ class BlackOilExtboModule
|
|||||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
|
||||||
typedef Opm::MathToolbox<Evaluation> Toolbox;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
typedef typename Opm::Tabulated1DFunction<Scalar> TabulatedFunction;
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
||||||
typedef typename Opm::UniformXTabulated2DFunction<Scalar> Tabulated2DFunction;
|
using Tabulated2DFunction = UniformXTabulated2DFunction<Scalar>;
|
||||||
|
|
||||||
static constexpr unsigned zFractionIdx = Indices::zFractionIdx;
|
static constexpr unsigned zFractionIdx = Indices::zFractionIdx;
|
||||||
static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx;
|
static constexpr unsigned contiZfracEqIdx = Indices::contiZfracEqIdx;
|
||||||
@ -103,7 +103,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the solvent module
|
* \brief Initialize all internal data structures needed by the solvent module
|
||||||
*/
|
*/
|
||||||
static void initFromState(const Opm::EclipseState& eclState)
|
static void initFromState(const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
// some sanity checks: if extended BO is enabled, the PVTSOL keyword must be
|
// some sanity checks: if extended BO is enabled, the PVTSOL keyword must be
|
||||||
// present, if extended BO is disabled the keyword must not be present.
|
// present, if extended BO is disabled the keyword must not be present.
|
||||||
@ -267,7 +267,7 @@ public:
|
|||||||
// extBO have disabled at compile time
|
// extBO have disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Opm::VtkBlackOilExtboModule<TypeTag>::registerParameters();
|
//VtkBlackOilExtboModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -280,7 +280,7 @@ public:
|
|||||||
// extBO have disabled at compile time
|
// extBO have disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//model.addOutputModule(new Opm::VtkBlackOilExtboModule<TypeTag>(simulator));
|
//model.addOutputModule(new VtkBlackOilExtboModule<TypeTag>(simulator));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool primaryVarApplies(unsigned pvIdx)
|
static bool primaryVarApplies(unsigned pvIdx)
|
||||||
@ -393,8 +393,8 @@ public:
|
|||||||
else {
|
else {
|
||||||
flux[contiZfracEqIdx] =
|
flux[contiZfracEqIdx] =
|
||||||
extQuants.volumeFlux(gasPhaseIdx)
|
extQuants.volumeFlux(gasPhaseIdx)
|
||||||
* (Opm::decay<Scalar>(upGas.yVolume()))
|
* (decay<Scalar>(upGas.yVolume()))
|
||||||
* Opm::decay<Scalar>(fsGas.invB(gasPhaseIdx));
|
* decay<Scalar>(fsGas.invB(gasPhaseIdx));
|
||||||
}
|
}
|
||||||
if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
|
if (FluidSystem::enableDissolvedGas()) { // account for dissolved z in oil phase
|
||||||
unsigned upIdxOil = static_cast<unsigned>(extQuants.upstreamIndex(oilPhaseIdx));
|
unsigned upIdxOil = static_cast<unsigned>(extQuants.upstreamIndex(oilPhaseIdx));
|
||||||
@ -410,9 +410,9 @@ public:
|
|||||||
else {
|
else {
|
||||||
flux[contiZfracEqIdx] +=
|
flux[contiZfracEqIdx] +=
|
||||||
extQuants.volumeFlux(oilPhaseIdx)
|
extQuants.volumeFlux(oilPhaseIdx)
|
||||||
* Opm::decay<Scalar>(upOil.xVolume())
|
* decay<Scalar>(upOil.xVolume())
|
||||||
* Opm::decay<Scalar>(fsOil.Rs())
|
* decay<Scalar>(fsOil.Rs())
|
||||||
* Opm::decay<Scalar>(fsOil.invB(oilPhaseIdx));
|
* decay<Scalar>(fsOil.invB(oilPhaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -898,7 +898,7 @@ class BlackOilExtboExtensiveQuantities
|
|||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
|
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
|
||||||
static constexpr int dimWorld = GridView::dimensionworld;
|
static constexpr int dimWorld = GridView::dimensionworld;
|
||||||
|
@ -63,7 +63,7 @@ class BlackOilExtensiveQuantities
|
|||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
|
|
||||||
enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
|
enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
|
||||||
using DiffusionExtensiveQuantities = Opm::BlackOilDiffusionExtensiveQuantities<TypeTag, enableDiffusion>;
|
using DiffusionExtensiveQuantities = BlackOilDiffusionExtensiveQuantities<TypeTag, enableDiffusion>;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -72,9 +72,9 @@ class BlackOilFoamModule
|
|||||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using TabulatedFunction = typename Opm::Tabulated1DFunction<Scalar>;
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
||||||
|
|
||||||
static constexpr unsigned foamConcentrationIdx = Indices::foamConcentrationIdx;
|
static constexpr unsigned foamConcentrationIdx = Indices::foamConcentrationIdx;
|
||||||
static constexpr unsigned contiFoamEqIdx = Indices::contiFoamEqIdx;
|
static constexpr unsigned contiFoamEqIdx = Indices::contiFoamEqIdx;
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the foam module
|
* \brief Initialize all internal data structures needed by the foam module
|
||||||
*/
|
*/
|
||||||
static void initFromState(const Opm::EclipseState& eclState)
|
static void initFromState(const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
// some sanity checks: if foam is enabled, the FOAM keyword must be
|
// some sanity checks: if foam is enabled, the FOAM keyword must be
|
||||||
// present, if foam is disabled the keyword must not be present.
|
// present, if foam is disabled the keyword must not be present.
|
||||||
@ -147,7 +147,7 @@ public:
|
|||||||
setNumPvtRegions(numPvtRegions);
|
setNumPvtRegions(numPvtRegions);
|
||||||
|
|
||||||
// Get and check FOAMROCK data.
|
// Get and check FOAMROCK data.
|
||||||
const Opm::FoamConfig& foamConf = eclState.getInitConfig().getFoamConfig();
|
const FoamConfig& foamConf = eclState.getInitConfig().getFoamConfig();
|
||||||
if (numSatRegions != foamConf.size()) {
|
if (numSatRegions != foamConf.size()) {
|
||||||
throw std::runtime_error("Inconsistent sizes, number of saturation regions differ from the number of elements "
|
throw std::runtime_error("Inconsistent sizes, number of saturation regions differ from the number of elements "
|
||||||
"in FoamConfig, which typically corresponds to the number of records in FOAMROCK.");
|
"in FoamConfig, which typically corresponds to the number of records in FOAMROCK.");
|
||||||
@ -172,7 +172,7 @@ public:
|
|||||||
foamCoefficients_[satReg].ep_surf = rec.exponent();
|
foamCoefficients_[satReg].ep_surf = rec.exponent();
|
||||||
foamRockDensity_[satReg] = rec.rockDensity();
|
foamRockDensity_[satReg] = rec.rockDensity();
|
||||||
foamAllowDesorption_[satReg] = rec.allowDesorption();
|
foamAllowDesorption_[satReg] = rec.allowDesorption();
|
||||||
const auto& foamadsTable = foamadsTables.template getTable<Opm::FoamadsTable>(satReg);
|
const auto& foamadsTable = foamadsTables.template getTable<FoamadsTable>(satReg);
|
||||||
const auto& conc = foamadsTable.getFoamConcentrationColumn();
|
const auto& conc = foamadsTable.getFoamConcentrationColumn();
|
||||||
const auto& ads = foamadsTable.getAdsorbedFoamColumn();
|
const auto& ads = foamadsTable.getAdsorbedFoamColumn();
|
||||||
adsorbedFoamTable_[satReg].setXYContainers(conc, ads);
|
adsorbedFoamTable_[satReg].setXYContainers(conc, ads);
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
|
|
||||||
// Set data that vary with PVT region.
|
// Set data that vary with PVT region.
|
||||||
for (std::size_t pvtReg = 0; pvtReg < numPvtRegions; ++pvtReg) {
|
for (std::size_t pvtReg = 0; pvtReg < numPvtRegions; ++pvtReg) {
|
||||||
const auto& foammobTable = foammobTables.template getTable<Opm::FoammobTable>(pvtReg);
|
const auto& foammobTable = foammobTables.template getTable<FoammobTable>(pvtReg);
|
||||||
const auto& conc = foammobTable.getFoamConcentrationColumn();
|
const auto& conc = foammobTable.getFoamConcentrationColumn();
|
||||||
const auto& mobMult = foammobTable.getMobilityMultiplierColumn();
|
const auto& mobMult = foammobTable.getMobilityMultiplierColumn();
|
||||||
gasMobilityMultiplierTable_[pvtReg].setXYContainers(conc, mobMult);
|
gasMobilityMultiplierTable_[pvtReg].setXYContainers(conc, mobMult);
|
||||||
@ -231,7 +231,7 @@ public:
|
|||||||
// foam has been disabled at compile time
|
// foam has been disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Opm::VtkBlackOilFoamModule<TypeTag>::registerParameters();
|
//VtkBlackOilFoamModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -245,9 +245,9 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (enableVtkOutput) {
|
if (enableVtkOutput) {
|
||||||
Opm::OpmLog::warning("VTK output requested, currently unsupported by the foam module.");
|
OpmLog::warning("VTK output requested, currently unsupported by the foam module.");
|
||||||
}
|
}
|
||||||
//model.addOutputModule(new Opm::VtkBlackOilFoamModule<TypeTag>(simulator));
|
//model.addOutputModule(new VtkBlackOilFoamModule<TypeTag>(simulator));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool primaryVarApplies(unsigned pvIdx)
|
static bool primaryVarApplies(unsigned pvIdx)
|
||||||
@ -313,7 +313,7 @@ public:
|
|||||||
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
||||||
|
|
||||||
// Avoid singular matrix if no gas is present.
|
// Avoid singular matrix if no gas is present.
|
||||||
surfaceVolumeFreeGas = Opm::max(surfaceVolumeFreeGas, 1e-10);
|
surfaceVolumeFreeGas = max(surfaceVolumeFreeGas, 1e-10);
|
||||||
|
|
||||||
// Foam/surfactant in gas phase.
|
// Foam/surfactant in gas phase.
|
||||||
const LhsEval gasFoam = surfaceVolumeFreeGas
|
const LhsEval gasFoam = surfaceVolumeFreeGas
|
||||||
@ -355,8 +355,8 @@ public:
|
|||||||
} else {
|
} else {
|
||||||
flux[contiFoamEqIdx] =
|
flux[contiFoamEqIdx] =
|
||||||
extQuants.volumeFlux(gasPhaseIdx)
|
extQuants.volumeFlux(gasPhaseIdx)
|
||||||
*Opm::decay<Scalar>(up.fluidState().invB(gasPhaseIdx))
|
*decay<Scalar>(up.fluidState().invB(gasPhaseIdx))
|
||||||
*Opm::decay<Scalar>(up.foamConcentration());
|
*decay<Scalar>(up.foamConcentration());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -99,11 +99,11 @@ class BlackOilIntensiveQuantities
|
|||||||
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
||||||
static const bool waterEnabled = Indices::waterEnabled;
|
static const bool waterEnabled = Indices::waterEnabled;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
|
using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
|
||||||
using FluxIntensiveQuantities = typename FluxModule::FluxIntensiveQuantities;
|
using FluxIntensiveQuantities = typename FluxModule::FluxIntensiveQuantities;
|
||||||
using FluidState = Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, enableBrine, Indices::numPhases >;
|
using FluidState = BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, enableBrine, Indices::numPhases >;
|
||||||
using DiffusionIntensiveQuantities = Opm::BlackOilDiffusionIntensiveQuantities<TypeTag, enableDiffusion>;
|
using DiffusionIntensiveQuantities = BlackOilDiffusionIntensiveQuantities<TypeTag, enableDiffusion>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BlackOilIntensiveQuantities()
|
BlackOilIntensiveQuantities()
|
||||||
@ -168,8 +168,8 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(Sg);
|
Valgrind::CheckDefined(Sg);
|
||||||
Opm::Valgrind::CheckDefined(Sw);
|
Valgrind::CheckDefined(Sw);
|
||||||
|
|
||||||
Evaluation So = 1.0 - Sw - Sg;
|
Evaluation So = 1.0 - Sw - Sg;
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ public:
|
|||||||
// calculate relative permeabilities. note that we store the result into the
|
// calculate relative permeabilities. note that we store the result into the
|
||||||
// mobility_ class attribute. the division by the phase viscosity happens later.
|
// mobility_ class attribute. the division by the phase viscosity happens later.
|
||||||
MaterialLaw::relativePermeabilities(mobility_, materialParams, fluidState_);
|
MaterialLaw::relativePermeabilities(mobility_, materialParams, fluidState_);
|
||||||
Opm::Valgrind::CheckDefined(mobility_);
|
Valgrind::CheckDefined(mobility_);
|
||||||
|
|
||||||
// update the Saturation functions for the blackoil solvent module.
|
// update the Saturation functions for the blackoil solvent module.
|
||||||
asImp_().solventPostSatFuncUpdate_(elemCtx, dofIdx, timeIdx);
|
asImp_().solventPostSatFuncUpdate_(elemCtx, dofIdx, timeIdx);
|
||||||
@ -221,7 +221,7 @@ public:
|
|||||||
|
|
||||||
Evaluation SoMax = 0.0;
|
Evaluation SoMax = 0.0;
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
|
||||||
SoMax = Opm::max(fluidState_.saturation(oilPhaseIdx),
|
SoMax = max(fluidState_.saturation(oilPhaseIdx),
|
||||||
elemCtx.problem().maxOilSaturation(globalSpaceIdx));
|
elemCtx.problem().maxOilSaturation(globalSpaceIdx));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ public:
|
|||||||
oilPhaseIdx,
|
oilPhaseIdx,
|
||||||
pvtRegionIdx,
|
pvtRegionIdx,
|
||||||
SoMax);
|
SoMax);
|
||||||
fluidState_.setRs(Opm::min(RsMax, RsSat));
|
fluidState_.setRs(min(RsMax, RsSat));
|
||||||
}
|
}
|
||||||
else if (compositionSwitchEnabled)
|
else if (compositionSwitchEnabled)
|
||||||
fluidState_.setRs(0.0);
|
fluidState_.setRs(0.0);
|
||||||
@ -249,7 +249,7 @@ public:
|
|||||||
gasPhaseIdx,
|
gasPhaseIdx,
|
||||||
pvtRegionIdx,
|
pvtRegionIdx,
|
||||||
SoMax);
|
SoMax);
|
||||||
fluidState_.setRv(Opm::min(RvMax, RvSat));
|
fluidState_.setRv(min(RvMax, RvSat));
|
||||||
}
|
}
|
||||||
else if (compositionSwitchEnabled)
|
else if (compositionSwitchEnabled)
|
||||||
fluidState_.setRv(0.0);
|
fluidState_.setRv(0.0);
|
||||||
@ -260,7 +260,7 @@ public:
|
|||||||
|
|
||||||
// oil phase, we can directly set the composition of the oil phase
|
// oil phase, we can directly set the composition of the oil phase
|
||||||
const auto& Rs = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
|
const auto& Rs = priVars.makeEvaluation(Indices::compositionSwitchIdx, timeIdx);
|
||||||
fluidState_.setRs(Opm::min(RsMax, Rs));
|
fluidState_.setRs(min(RsMax, Rs));
|
||||||
|
|
||||||
if (FluidSystem::enableVaporizedOil()) {
|
if (FluidSystem::enableVaporizedOil()) {
|
||||||
// the gas phase is not present, but we need to compute its "composition"
|
// the gas phase is not present, but we need to compute its "composition"
|
||||||
@ -272,7 +272,7 @@ public:
|
|||||||
pvtRegionIdx,
|
pvtRegionIdx,
|
||||||
SoMax);
|
SoMax);
|
||||||
|
|
||||||
fluidState_.setRv(Opm::min(RvMax, RvSat));
|
fluidState_.setRv(min(RvMax, RvSat));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fluidState_.setRv(0.0);
|
fluidState_.setRv(0.0);
|
||||||
@ -291,7 +291,7 @@ public:
|
|||||||
pvtRegionIdx,
|
pvtRegionIdx,
|
||||||
SoMax);
|
SoMax);
|
||||||
|
|
||||||
fluidState_.setRs(Opm::min(RsMax, RsSat));
|
fluidState_.setRs(min(RsMax, RsSat));
|
||||||
} else {
|
} else {
|
||||||
fluidState_.setRs(0.0);
|
fluidState_.setRs(0.0);
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ public:
|
|||||||
else
|
else
|
||||||
mobility_[phaseIdx] /= mu;
|
mobility_[phaseIdx] /= mu;
|
||||||
}
|
}
|
||||||
Opm::Valgrind::CheckDefined(mobility_);
|
Valgrind::CheckDefined(mobility_);
|
||||||
|
|
||||||
// calculate the phase densities
|
// calculate the phase densities
|
||||||
Evaluation rho;
|
Evaluation rho;
|
||||||
@ -398,14 +398,14 @@ public:
|
|||||||
if (!FluidSystem::phaseIsActive(phaseIdx))
|
if (!FluidSystem::phaseIsActive(phaseIdx))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
assert(Opm::isfinite(fluidState_.density(phaseIdx)));
|
assert(isfinite(fluidState_.density(phaseIdx)));
|
||||||
assert(Opm::isfinite(fluidState_.saturation(phaseIdx)));
|
assert(isfinite(fluidState_.saturation(phaseIdx)));
|
||||||
assert(Opm::isfinite(fluidState_.temperature(phaseIdx)));
|
assert(isfinite(fluidState_.temperature(phaseIdx)));
|
||||||
assert(Opm::isfinite(fluidState_.pressure(phaseIdx)));
|
assert(isfinite(fluidState_.pressure(phaseIdx)));
|
||||||
assert(Opm::isfinite(fluidState_.invB(phaseIdx)));
|
assert(isfinite(fluidState_.invB(phaseIdx)));
|
||||||
}
|
}
|
||||||
assert(Opm::isfinite(fluidState_.Rs()));
|
assert(isfinite(fluidState_.Rs()));
|
||||||
assert(Opm::isfinite(fluidState_.Rv()));
|
assert(isfinite(fluidState_.Rv()));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,14 +80,14 @@ class BlackOilLocalResidual : public GetPropType<TypeTag, Properties::DiscLocalR
|
|||||||
static constexpr bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
static constexpr bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||||
static constexpr bool enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>();
|
static constexpr bool enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>();
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using SolventModule = BlackOilSolventModule<TypeTag>;
|
using SolventModule = BlackOilSolventModule<TypeTag>;
|
||||||
using ExtboModule = BlackOilExtboModule<TypeTag>;
|
using ExtboModule = BlackOilExtboModule<TypeTag>;
|
||||||
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
||||||
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
||||||
using FoamModule = BlackOilFoamModule<TypeTag>;
|
using FoamModule = BlackOilFoamModule<TypeTag>;
|
||||||
using BrineModule = BlackOilBrineModule<TypeTag>;
|
using BrineModule = BlackOilBrineModule<TypeTag>;
|
||||||
using DiffusionModule = Opm::BlackOilDiffusionModule<TypeTag, enableDiffusion>;
|
using DiffusionModule = BlackOilDiffusionModule<TypeTag, enableDiffusion>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
@ -110,7 +110,7 @@ public:
|
|||||||
if (Indices::numPhases == 3) { // add trivial equation for the pseudo phase
|
if (Indices::numPhases == 3) { // add trivial equation for the pseudo phase
|
||||||
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
||||||
if (timeIdx == 0)
|
if (timeIdx == 0)
|
||||||
storage[conti0EqIdx + activeCompIdx] = Opm::variable<LhsEval>(0.0, conti0EqIdx + activeCompIdx);
|
storage[conti0EqIdx + activeCompIdx] = variable<LhsEval>(0.0, conti0EqIdx + activeCompIdx);
|
||||||
else
|
else
|
||||||
storage[conti0EqIdx + activeCompIdx] = 0.0;
|
storage[conti0EqIdx + activeCompIdx] = 0.0;
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ public:
|
|||||||
const ExtensiveQuantities& extQuants,
|
const ExtensiveQuantities& extQuants,
|
||||||
const FluidState& upFs)
|
const FluidState& upFs)
|
||||||
{
|
{
|
||||||
const auto& invB = Opm::getInvB_<FluidSystem, FluidState, UpEval>(upFs, phaseIdx, pvtRegionIdx);
|
const auto& invB = getInvB_<FluidSystem, FluidState, UpEval>(upFs, phaseIdx, pvtRegionIdx);
|
||||||
const auto& surfaceVolumeFlux = invB*extQuants.volumeFlux(phaseIdx);
|
const auto& surfaceVolumeFlux = invB*extQuants.volumeFlux(phaseIdx);
|
||||||
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ public:
|
|||||||
if (phaseIdx == oilPhaseIdx) {
|
if (phaseIdx == oilPhaseIdx) {
|
||||||
// dissolved gas (in the oil phase).
|
// dissolved gas (in the oil phase).
|
||||||
if (FluidSystem::enableDissolvedGas()) {
|
if (FluidSystem::enableDissolvedGas()) {
|
||||||
const auto& Rs = Opm::BlackOil::getRs_<FluidSystem, FluidState, UpEval>(upFs, pvtRegionIdx);
|
const auto& Rs = BlackOil::getRs_<FluidSystem, FluidState, UpEval>(upFs, pvtRegionIdx);
|
||||||
|
|
||||||
unsigned activeGasCompIdx = Indices::canonicalToActiveComponentIndex(gasCompIdx);
|
unsigned activeGasCompIdx = Indices::canonicalToActiveComponentIndex(gasCompIdx);
|
||||||
if (blackoilConserveSurfaceVolume)
|
if (blackoilConserveSurfaceVolume)
|
||||||
@ -262,7 +262,7 @@ public:
|
|||||||
else if (phaseIdx == gasPhaseIdx) {
|
else if (phaseIdx == gasPhaseIdx) {
|
||||||
// vaporized oil (in the gas phase).
|
// vaporized oil (in the gas phase).
|
||||||
if (FluidSystem::enableVaporizedOil()) {
|
if (FluidSystem::enableVaporizedOil()) {
|
||||||
const auto& Rv = Opm::BlackOil::getRv_<FluidSystem, FluidState, UpEval>(upFs, pvtRegionIdx);
|
const auto& Rv = BlackOil::getRv_<FluidSystem, FluidState, UpEval>(upFs, pvtRegionIdx);
|
||||||
|
|
||||||
unsigned activeOilCompIdx = Indices::canonicalToActiveComponentIndex(oilCompIdx);
|
unsigned activeOilCompIdx = Indices::canonicalToActiveComponentIndex(oilCompIdx);
|
||||||
if (blackoilConserveSurfaceVolume)
|
if (blackoilConserveSurfaceVolume)
|
||||||
|
@ -83,49 +83,49 @@ struct BlackOilModel { using InheritsFrom = std::tuple<VtkComposition,
|
|||||||
|
|
||||||
//! Set the local residual function
|
//! Set the local residual function
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct LocalResidual<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilLocalResidual<TypeTag>; };
|
struct LocalResidual<TypeTag, TTag::BlackOilModel> { using type = BlackOilLocalResidual<TypeTag>; };
|
||||||
|
|
||||||
//! Use the black-oil specific newton method
|
//! Use the black-oil specific newton method
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonMethod<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilNewtonMethod<TypeTag>; };
|
struct NewtonMethod<TypeTag, TTag::BlackOilModel> { using type = BlackOilNewtonMethod<TypeTag>; };
|
||||||
|
|
||||||
//! The Model property
|
//! The Model property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Model<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilModel<TypeTag>; };
|
struct Model<TypeTag, TTag::BlackOilModel> { using type = BlackOilModel<TypeTag>; };
|
||||||
|
|
||||||
//! The Problem property
|
//! The Problem property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct BaseProblem<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilProblem<TypeTag>; };
|
struct BaseProblem<TypeTag, TTag::BlackOilModel> { using type = BlackOilProblem<TypeTag>; };
|
||||||
|
|
||||||
//! the RateVector property
|
//! the RateVector property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct RateVector<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilRateVector<TypeTag>; };
|
struct RateVector<TypeTag, TTag::BlackOilModel> { using type = BlackOilRateVector<TypeTag>; };
|
||||||
|
|
||||||
//! the BoundaryRateVector property
|
//! the BoundaryRateVector property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct BoundaryRateVector<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilBoundaryRateVector<TypeTag>; };
|
struct BoundaryRateVector<TypeTag, TTag::BlackOilModel> { using type = BlackOilBoundaryRateVector<TypeTag>; };
|
||||||
|
|
||||||
//! the PrimaryVariables property
|
//! the PrimaryVariables property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct PrimaryVariables<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilPrimaryVariables<TypeTag>; };
|
struct PrimaryVariables<TypeTag, TTag::BlackOilModel> { using type = BlackOilPrimaryVariables<TypeTag>; };
|
||||||
|
|
||||||
//! the IntensiveQuantities property
|
//! the IntensiveQuantities property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct IntensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilIntensiveQuantities<TypeTag>; };
|
struct IntensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = BlackOilIntensiveQuantities<TypeTag>; };
|
||||||
|
|
||||||
//! the ExtensiveQuantities property
|
//! the ExtensiveQuantities property
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ExtensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilExtensiveQuantities<TypeTag>; };
|
struct ExtensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = BlackOilExtensiveQuantities<TypeTag>; };
|
||||||
|
|
||||||
//! Use the the velocity module which is aware of the black-oil specific model extensions
|
//! Use the the velocity module which is aware of the black-oil specific model extensions
|
||||||
//! (i.e., the polymer and solvent extensions)
|
//! (i.e., the polymer and solvent extensions)
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct FluxModule<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilDarcyFluxModule<TypeTag>; };
|
struct FluxModule<TypeTag, TTag::BlackOilModel> { using type = BlackOilDarcyFluxModule<TypeTag>; };
|
||||||
|
|
||||||
//! The indices required by the model
|
//! The indices required by the model
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Indices<TypeTag, TTag::BlackOilModel>
|
struct Indices<TypeTag, TTag::BlackOilModel>
|
||||||
{ using type = Opm::BlackOilIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
|
{ using type = BlackOilIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
|
||||||
getPropValue<TypeTag, Properties::EnableExtbo>(),
|
getPropValue<TypeTag, Properties::EnableExtbo>(),
|
||||||
getPropValue<TypeTag, Properties::EnablePolymer>(),
|
getPropValue<TypeTag, Properties::EnablePolymer>(),
|
||||||
getPropValue<TypeTag, Properties::EnableEnergy>(),
|
getPropValue<TypeTag, Properties::EnableEnergy>(),
|
||||||
@ -142,7 +142,7 @@ private:
|
|||||||
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using type = Opm::BlackOilFluidSystem<Scalar>;
|
using type = BlackOilFluidSystem<Scalar>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// by default, all ECL extension modules are disabled
|
// by default, all ECL extension modules are disabled
|
||||||
@ -286,7 +286,7 @@ class BlackOilModel
|
|||||||
using ExtboModule = BlackOilExtboModule<TypeTag>;
|
using ExtboModule = BlackOilExtboModule<TypeTag>;
|
||||||
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
||||||
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
using EnergyModule = BlackOilEnergyModule<TypeTag>;
|
||||||
using DiffusionModule = Opm::BlackOilDiffusionModule<TypeTag, enableDiffusion>;
|
using DiffusionModule = BlackOilDiffusionModule<TypeTag, enableDiffusion>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BlackOilModel(Simulator& simulator)
|
BlackOilModel(Simulator& simulator)
|
||||||
@ -307,11 +307,11 @@ public:
|
|||||||
DiffusionModule::registerParameters();
|
DiffusionModule::registerParameters();
|
||||||
|
|
||||||
// register runtime parameters of the VTK output modules
|
// register runtime parameters of the VTK output modules
|
||||||
Opm::VtkBlackOilModule<TypeTag>::registerParameters();
|
VtkBlackOilModule<TypeTag>::registerParameters();
|
||||||
Opm::VtkCompositionModule<TypeTag>::registerParameters();
|
VtkCompositionModule<TypeTag>::registerParameters();
|
||||||
|
|
||||||
if (enableDiffusion)
|
if (enableDiffusion)
|
||||||
Opm::VtkDiffusionModule<TypeTag>::registerParameters();
|
VtkDiffusionModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -596,11 +596,11 @@ protected:
|
|||||||
PolymerModule::registerOutputModules(*this, this->simulator_);
|
PolymerModule::registerOutputModules(*this, this->simulator_);
|
||||||
EnergyModule::registerOutputModules(*this, this->simulator_);
|
EnergyModule::registerOutputModules(*this, this->simulator_);
|
||||||
|
|
||||||
this->addOutputModule(new Opm::VtkBlackOilModule<TypeTag>(this->simulator_));
|
this->addOutputModule(new VtkBlackOilModule<TypeTag>(this->simulator_));
|
||||||
this->addOutputModule(new Opm::VtkCompositionModule<TypeTag>(this->simulator_));
|
this->addOutputModule(new VtkCompositionModule<TypeTag>(this->simulator_));
|
||||||
|
|
||||||
if (enableDiffusion)
|
if (enableDiffusion)
|
||||||
this->addOutputModule(new Opm::VtkDiffusionModule<TypeTag>(this->simulator_));
|
this->addOutputModule(new VtkDiffusionModule<TypeTag>(this->simulator_));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -225,7 +225,7 @@ public:
|
|||||||
succeeded = comm.min(succeeded);
|
succeeded = comm.min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("A process did not succeed in adapting the primary variables");
|
throw NumericalIssue("A process did not succeed in adapting the primary variables");
|
||||||
|
|
||||||
numPriVarsSwitched_ = comm.sum(numPriVarsSwitched_);
|
numPriVarsSwitched_ = comm.sum(numPriVarsSwitched_);
|
||||||
}
|
}
|
||||||
@ -249,8 +249,8 @@ protected:
|
|||||||
static constexpr bool enableBrine = Indices::saltConcentrationIdx >= 0;
|
static constexpr bool enableBrine = Indices::saltConcentrationIdx >= 0;
|
||||||
|
|
||||||
currentValue.checkDefined();
|
currentValue.checkDefined();
|
||||||
Opm::Valgrind::CheckDefined(update);
|
Valgrind::CheckDefined(update);
|
||||||
Opm::Valgrind::CheckDefined(currentResidual);
|
Valgrind::CheckDefined(currentResidual);
|
||||||
|
|
||||||
// saturation delta for each phase
|
// saturation delta for each phase
|
||||||
Scalar deltaSw = 0.0;
|
Scalar deltaSw = 0.0;
|
||||||
@ -296,7 +296,7 @@ protected:
|
|||||||
// limit pressure delta
|
// limit pressure delta
|
||||||
if (pvIdx == Indices::pressureSwitchIdx) {
|
if (pvIdx == Indices::pressureSwitchIdx) {
|
||||||
if (std::abs(delta) > dpMaxRel_*currentValue[pvIdx])
|
if (std::abs(delta) > dpMaxRel_*currentValue[pvIdx])
|
||||||
delta = Opm::signum(delta)*dpMaxRel_*currentValue[pvIdx];
|
delta = signum(delta)*dpMaxRel_*currentValue[pvIdx];
|
||||||
}
|
}
|
||||||
// water saturation delta
|
// water saturation delta
|
||||||
else if (pvIdx == Indices::waterSaturationIdx)
|
else if (pvIdx == Indices::waterSaturationIdx)
|
||||||
|
@ -75,10 +75,10 @@ class BlackOilPolymerModule
|
|||||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using TabulatedFunction = typename Opm::Tabulated1DFunction<Scalar>;
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
||||||
using TabulatedTwoDFunction = typename Opm::IntervalTabulated2DFunction<Scalar>;
|
using TabulatedTwoDFunction = IntervalTabulated2DFunction<Scalar>;
|
||||||
|
|
||||||
static constexpr unsigned polymerConcentrationIdx = Indices::polymerConcentrationIdx;
|
static constexpr unsigned polymerConcentrationIdx = Indices::polymerConcentrationIdx;
|
||||||
static constexpr unsigned polymerMoleWeightIdx = Indices::polymerMoleWeightIdx;
|
static constexpr unsigned polymerMoleWeightIdx = Indices::polymerMoleWeightIdx;
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the polymer module
|
* \brief Initialize all internal data structures needed by the polymer module
|
||||||
*/
|
*/
|
||||||
static void initFromState(const Opm::EclipseState& eclState)
|
static void initFromState(const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
// some sanity checks: if polymers are enabled, the POLYMER keyword must be
|
// some sanity checks: if polymers are enabled, the POLYMER keyword must be
|
||||||
// present, if polymers are disabled the keyword must not be present.
|
// present, if polymers are disabled the keyword must not be present.
|
||||||
@ -155,7 +155,7 @@ public:
|
|||||||
if (!plyrockTables.empty()) {
|
if (!plyrockTables.empty()) {
|
||||||
assert(numSatRegions == plyrockTables.size());
|
assert(numSatRegions == plyrockTables.size());
|
||||||
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
||||||
const auto& plyrockTable = plyrockTables.template getTable<Opm::PlyrockTable>(satRegionIdx);
|
const auto& plyrockTable = plyrockTables.template getTable<PlyrockTable>(satRegionIdx);
|
||||||
setPlyrock(satRegionIdx,
|
setPlyrock(satRegionIdx,
|
||||||
plyrockTable.getDeadPoreVolumeColumn()[0],
|
plyrockTable.getDeadPoreVolumeColumn()[0],
|
||||||
plyrockTable.getResidualResistanceFactorColumn()[0],
|
plyrockTable.getResidualResistanceFactorColumn()[0],
|
||||||
@ -173,7 +173,7 @@ public:
|
|||||||
if (!plyadsTables.empty()) {
|
if (!plyadsTables.empty()) {
|
||||||
assert(numSatRegions == plyadsTables.size());
|
assert(numSatRegions == plyadsTables.size());
|
||||||
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
||||||
const auto& plyadsTable = plyadsTables.template getTable<Opm::PlyadsTable>(satRegionIdx);
|
const auto& plyadsTable = plyadsTables.template getTable<PlyadsTable>(satRegionIdx);
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& c = plyadsTable.getPolymerConcentrationColumn();
|
const auto& c = plyadsTable.getPolymerConcentrationColumn();
|
||||||
const auto& ads = plyadsTable.getAdsorbedPolymerColumn();
|
const auto& ads = plyadsTable.getAdsorbedPolymerColumn();
|
||||||
@ -193,14 +193,14 @@ public:
|
|||||||
if (!plyviscTables.empty()) {
|
if (!plyviscTables.empty()) {
|
||||||
// different viscosity model is used for POLYMW
|
// different viscosity model is used for POLYMW
|
||||||
if (enablePolymerMolarWeight) {
|
if (enablePolymerMolarWeight) {
|
||||||
Opm::OpmLog::warning("PLYVISC should not be used in POLYMW runs, "
|
OpmLog::warning("PLYVISC should not be used in POLYMW runs, "
|
||||||
"it will have no effect. A viscosity model based on PLYVMH is used instead.\n");
|
"it will have no effect. A viscosity model based on PLYVMH is used instead.\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
assert(numPvtRegions == plyviscTables.size());
|
assert(numPvtRegions == plyviscTables.size());
|
||||||
for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) {
|
for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) {
|
||||||
const auto& plyadsTable = plyviscTables.template getTable<Opm::PlyviscTable>(pvtRegionIdx);
|
const auto& plyadsTable = plyviscTables.template getTable<PlyviscTable>(pvtRegionIdx);
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& c = plyadsTable.getPolymerConcentrationColumn();
|
const auto& c = plyadsTable.getPolymerConcentrationColumn();
|
||||||
const auto& visc = plyadsTable.getViscosityMultiplierColumn();
|
const auto& visc = plyadsTable.getViscosityMultiplierColumn();
|
||||||
@ -218,7 +218,7 @@ public:
|
|||||||
setNumMixRegions(numMixRegions);
|
setNumMixRegions(numMixRegions);
|
||||||
if (!plymaxTables.empty()) {
|
if (!plymaxTables.empty()) {
|
||||||
for (unsigned mixRegionIdx = 0; mixRegionIdx < numMixRegions; ++ mixRegionIdx) {
|
for (unsigned mixRegionIdx = 0; mixRegionIdx < numMixRegions; ++ mixRegionIdx) {
|
||||||
const auto& plymaxTable = plymaxTables.template getTable<Opm::PlymaxTable>(mixRegionIdx);
|
const auto& plymaxTable = plymaxTables.template getTable<PlymaxTable>(mixRegionIdx);
|
||||||
setPlymax(mixRegionIdx, plymaxTable.getPolymerConcentrationColumn()[0]);
|
setPlymax(mixRegionIdx, plymaxTable.getPolymerConcentrationColumn()[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ public:
|
|||||||
|
|
||||||
if (!eclState.getTableManager().getPlmixparTable().empty()) {
|
if (!eclState.getTableManager().getPlmixparTable().empty()) {
|
||||||
if (enablePolymerMolarWeight) {
|
if (enablePolymerMolarWeight) {
|
||||||
Opm::OpmLog::warning("PLMIXPAR should not be used in POLYMW runs, it will have no effect.\n");
|
OpmLog::warning("PLMIXPAR should not be used in POLYMW runs, it will have no effect.\n");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const auto& plmixparTable = eclState.getTableManager().getPlmixparTable();
|
const auto& plmixparTable = eclState.getTableManager().getPlmixparTable();
|
||||||
@ -246,7 +246,7 @@ public:
|
|||||||
hasShrate_ = eclState.getTableManager().useShrate();
|
hasShrate_ = eclState.getTableManager().useShrate();
|
||||||
|
|
||||||
if ((hasPlyshlog_ || hasShrate_) && enablePolymerMolarWeight) {
|
if ((hasPlyshlog_ || hasShrate_) && enablePolymerMolarWeight) {
|
||||||
Opm::OpmLog::warning("PLYSHLOG and SHRATE should not be used in POLYMW runs, they will have no effect.\n");
|
OpmLog::warning("PLYSHLOG and SHRATE should not be used in POLYMW runs, they will have no effect.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasPlyshlog_ && !enablePolymerMolarWeight) {
|
if (hasPlyshlog_ && !enablePolymerMolarWeight) {
|
||||||
@ -255,14 +255,14 @@ public:
|
|||||||
plyshlogShearEffectRefMultiplier_.resize(numPvtRegions);
|
plyshlogShearEffectRefMultiplier_.resize(numPvtRegions);
|
||||||
plyshlogShearEffectRefLogVelocity_.resize(numPvtRegions);
|
plyshlogShearEffectRefLogVelocity_.resize(numPvtRegions);
|
||||||
for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) {
|
for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) {
|
||||||
const auto& plyshlogTable = plyshlogTables.template getTable<Opm::PlyshlogTable>(pvtRegionIdx);
|
const auto& plyshlogTable = plyshlogTables.template getTable<PlyshlogTable>(pvtRegionIdx);
|
||||||
|
|
||||||
Scalar plyshlogRefPolymerConcentration = plyshlogTable.getRefPolymerConcentration();
|
Scalar plyshlogRefPolymerConcentration = plyshlogTable.getRefPolymerConcentration();
|
||||||
auto waterVelocity = plyshlogTable.getWaterVelocityColumn().vectorCopy();
|
auto waterVelocity = plyshlogTable.getWaterVelocityColumn().vectorCopy();
|
||||||
auto shearMultiplier = plyshlogTable.getShearMultiplierColumn().vectorCopy();
|
auto shearMultiplier = plyshlogTable.getShearMultiplierColumn().vectorCopy();
|
||||||
|
|
||||||
// do the unit version here for the waterVelocity
|
// do the unit version here for the waterVelocity
|
||||||
Opm::UnitSystem unitSystem = eclState.getDeckUnitSystem();
|
UnitSystem unitSystem = eclState.getDeckUnitSystem();
|
||||||
double siFactor = hasShrate_? unitSystem.parse("1/Time").getSIScaling() : unitSystem.parse("Length/Time").getSIScaling();
|
double siFactor = hasShrate_? unitSystem.parse("1/Time").getSIScaling() : unitSystem.parse("Length/Time").getSIScaling();
|
||||||
for (size_t i = 0; i < waterVelocity.size(); ++i) {
|
for (size_t i = 0; i < waterVelocity.size(); ++i) {
|
||||||
waterVelocity[i] *= siFactor;
|
waterVelocity[i] *= siFactor;
|
||||||
@ -507,7 +507,7 @@ public:
|
|||||||
// polymers have been disabled at compile time
|
// polymers have been disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Opm::VtkBlackOilPolymerModule<TypeTag>::registerParameters();
|
VtkBlackOilPolymerModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -520,7 +520,7 @@ public:
|
|||||||
// polymers have been disabled at compile time
|
// polymers have been disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
model.addOutputModule(new Opm::VtkBlackOilPolymerModule<TypeTag>(simulator));
|
model.addOutputModule(new VtkBlackOilPolymerModule<TypeTag>(simulator));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool primaryVarApplies(unsigned pvIdx)
|
static bool primaryVarApplies(unsigned pvIdx)
|
||||||
@ -602,7 +602,7 @@ public:
|
|||||||
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
||||||
|
|
||||||
// avoid singular matrix if no water is present.
|
// avoid singular matrix if no water is present.
|
||||||
surfaceVolumeWater = Opm::max(surfaceVolumeWater, 1e-10);
|
surfaceVolumeWater = max(surfaceVolumeWater, 1e-10);
|
||||||
|
|
||||||
// polymer in water phase
|
// polymer in water phase
|
||||||
const LhsEval massPolymer = surfaceVolumeWater
|
const LhsEval massPolymer = surfaceVolumeWater
|
||||||
@ -621,7 +621,7 @@ public:
|
|||||||
|
|
||||||
// tracking the polymer molecular weight
|
// tracking the polymer molecular weight
|
||||||
if (enablePolymerMolarWeight) {
|
if (enablePolymerMolarWeight) {
|
||||||
accumulationPolymer = Opm::max(accumulationPolymer, 1e-10);
|
accumulationPolymer = max(accumulationPolymer, 1e-10);
|
||||||
|
|
||||||
storage[contiPolymerMolarWeightEqIdx] += accumulationPolymer
|
storage[contiPolymerMolarWeightEqIdx] += accumulationPolymer
|
||||||
* Toolbox::template decay<LhsEval> (intQuants.polymerMoleWeight());
|
* Toolbox::template decay<LhsEval> (intQuants.polymerMoleWeight());
|
||||||
@ -660,14 +660,14 @@ public:
|
|||||||
else {
|
else {
|
||||||
flux[contiPolymerEqIdx] =
|
flux[contiPolymerEqIdx] =
|
||||||
extQuants.volumeFlux(waterPhaseIdx)
|
extQuants.volumeFlux(waterPhaseIdx)
|
||||||
*Opm::decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
|
*decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
|
||||||
*Opm::decay<Scalar>(up.polymerViscosityCorrection())
|
*decay<Scalar>(up.polymerViscosityCorrection())
|
||||||
/Opm::decay<Scalar>(extQuants.polymerShearFactor())
|
/decay<Scalar>(extQuants.polymerShearFactor())
|
||||||
*Opm::decay<Scalar>(up.polymerConcentration());
|
*decay<Scalar>(up.polymerConcentration());
|
||||||
|
|
||||||
// modify water
|
// modify water
|
||||||
flux[contiWaterEqIdx] /=
|
flux[contiWaterEqIdx] /=
|
||||||
Opm::decay<Scalar>(extQuants.waterShearFactor());
|
decay<Scalar>(extQuants.waterShearFactor());
|
||||||
}
|
}
|
||||||
|
|
||||||
// flux related to transport of polymer molecular weight
|
// flux related to transport of polymer molecular weight
|
||||||
@ -677,7 +677,7 @@ public:
|
|||||||
flux[contiPolymerEqIdx]*up.polymerMoleWeight();
|
flux[contiPolymerEqIdx]*up.polymerMoleWeight();
|
||||||
else
|
else
|
||||||
flux[contiPolymerMolarWeightEqIdx] =
|
flux[contiPolymerMolarWeightEqIdx] =
|
||||||
flux[contiPolymerEqIdx]*Opm::decay<Scalar>(up.polymerMoleWeight());
|
flux[contiPolymerEqIdx]*decay<Scalar>(up.polymerMoleWeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -835,10 +835,10 @@ public:
|
|||||||
unsigned pvtnumRegionIdx,
|
unsigned pvtnumRegionIdx,
|
||||||
const Evaluation& v0)
|
const Evaluation& v0)
|
||||||
{
|
{
|
||||||
using ToolboxLocal = Opm::MathToolbox<Evaluation>;
|
using ToolboxLocal = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
const auto& viscosityMultiplierTable = plyviscViscosityMultiplierTable_[pvtnumRegionIdx];
|
const auto& viscosityMultiplierTable = plyviscViscosityMultiplierTable_[pvtnumRegionIdx];
|
||||||
Scalar viscosityMultiplier = viscosityMultiplierTable.eval(Opm::scalarValue(polymerConcentration), /*extrapolate=*/true);
|
Scalar viscosityMultiplier = viscosityMultiplierTable.eval(scalarValue(polymerConcentration), /*extrapolate=*/true);
|
||||||
|
|
||||||
const Scalar eps = 1e-14;
|
const Scalar eps = 1e-14;
|
||||||
// return 1.0 if the polymer has no effect on the water.
|
// return 1.0 if the polymer has no effect on the water.
|
||||||
@ -846,7 +846,7 @@ public:
|
|||||||
return ToolboxLocal::createConstant(v0, 1.0);
|
return ToolboxLocal::createConstant(v0, 1.0);
|
||||||
|
|
||||||
const std::vector<Scalar>& shearEffectRefLogVelocity = plyshlogShearEffectRefLogVelocity_[pvtnumRegionIdx];
|
const std::vector<Scalar>& shearEffectRefLogVelocity = plyshlogShearEffectRefLogVelocity_[pvtnumRegionIdx];
|
||||||
auto v0AbsLog = Opm::log(Opm::abs(v0));
|
auto v0AbsLog = log(abs(v0));
|
||||||
// return 1.0 if the velocity /sharte is smaller than the first velocity entry.
|
// return 1.0 if the velocity /sharte is smaller than the first velocity entry.
|
||||||
if (v0AbsLog < shearEffectRefLogVelocity[0])
|
if (v0AbsLog < shearEffectRefLogVelocity[0])
|
||||||
return ToolboxLocal::createConstant(v0, 1.0);
|
return ToolboxLocal::createConstant(v0, 1.0);
|
||||||
@ -862,7 +862,7 @@ public:
|
|||||||
std::vector<Scalar> shearEffectMultiplier(numTableEntries, 1.0);
|
std::vector<Scalar> shearEffectMultiplier(numTableEntries, 1.0);
|
||||||
for (size_t i = 0; i < numTableEntries; ++i) {
|
for (size_t i = 0; i < numTableEntries; ++i) {
|
||||||
shearEffectMultiplier[i] = (1.0 + (viscosityMultiplier - 1.0)*shearEffectRefMultiplier[i]) / viscosityMultiplier;
|
shearEffectMultiplier[i] = (1.0 + (viscosityMultiplier - 1.0)*shearEffectRefMultiplier[i]) / viscosityMultiplier;
|
||||||
shearEffectMultiplier[i] = Opm::log(shearEffectMultiplier[i]);
|
shearEffectMultiplier[i] = log(shearEffectMultiplier[i]);
|
||||||
}
|
}
|
||||||
// store the logarithmic velocity and logarithmic multipliers in a table for easy look up and
|
// store the logarithmic velocity and logarithmic multipliers in a table for easy look up and
|
||||||
// linear interpolation in the logarithmic space.
|
// linear interpolation in the logarithmic space.
|
||||||
@ -890,7 +890,7 @@ public:
|
|||||||
auto f = F(u);
|
auto f = F(u);
|
||||||
auto df = dF(u);
|
auto df = dF(u);
|
||||||
u -= f/df;
|
u -= f/df;
|
||||||
if (std::abs(Opm::scalarValue(f)) < 1e-12) {
|
if (std::abs(scalarValue(f)) < 1e-12) {
|
||||||
converged = true;
|
converged = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -900,7 +900,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return the shear factor
|
// return the shear factor
|
||||||
return Opm::exp(logShearEffectMultiplier.eval(u, /*extrapolate=*/true));
|
return exp(logShearEffectMultiplier.eval(u, /*extrapolate=*/true));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1214,7 +1214,7 @@ class BlackOilPolymerExtensiveQuantities
|
|||||||
static constexpr int dimWorld = GridView::dimensionworld;
|
static constexpr int dimWorld = GridView::dimensionworld;
|
||||||
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
|
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
using PolymerModule = BlackOilPolymerModule<TypeTag>;
|
||||||
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
||||||
using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
|
using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
|
||||||
@ -1274,7 +1274,7 @@ public:
|
|||||||
const Scalar& Swcr = scaledDrainageInfo.Swcr;
|
const Scalar& Swcr = scaledDrainageInfo.Swcr;
|
||||||
|
|
||||||
// guard against zero porosity and no mobile water
|
// guard against zero porosity and no mobile water
|
||||||
Evaluation denom = Opm::max(poroAvg * (Sw - Swcr), 1e-12);
|
Evaluation denom = max(poroAvg * (Sw - Swcr), 1e-12);
|
||||||
Evaluation waterVolumeVelocity = extQuants.volumeFlux(waterPhaseIdx) / denom;
|
Evaluation waterVolumeVelocity = extQuants.volumeFlux(waterPhaseIdx) / denom;
|
||||||
|
|
||||||
// if shrate is specified. Compute shrate based on the water velocity
|
// if shrate is specified. Compute shrate based on the water velocity
|
||||||
@ -1287,8 +1287,8 @@ public:
|
|||||||
// compute permeability from transmissibility.
|
// compute permeability from transmissibility.
|
||||||
Scalar absPerm = trans / faceArea * dist.two_norm();
|
Scalar absPerm = trans / faceArea * dist.two_norm();
|
||||||
waterVolumeVelocity *=
|
waterVolumeVelocity *=
|
||||||
PolymerModule::shrate(pvtnumRegionIdx)*Opm::sqrt(poroAvg*Sw / (relWater*absPerm));
|
PolymerModule::shrate(pvtnumRegionIdx)*sqrt(poroAvg*Sw / (relWater*absPerm));
|
||||||
assert(Opm::isfinite(waterVolumeVelocity));
|
assert(isfinite(waterVolumeVelocity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
|
|||||||
enum { waterCompIdx = FluidSystem::waterCompIdx };
|
enum { waterCompIdx = FluidSystem::waterCompIdx };
|
||||||
enum { oilCompIdx = FluidSystem::oilCompIdx };
|
enum { oilCompIdx = FluidSystem::oilCompIdx };
|
||||||
|
|
||||||
using Toolbox = typename Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using ComponentVector = Dune::FieldVector<Scalar, numComponents>;
|
using ComponentVector = Dune::FieldVector<Scalar, numComponents>;
|
||||||
using SolventModule = BlackOilSolventModule<TypeTag, enableSolvent>;
|
using SolventModule = BlackOilSolventModule<TypeTag, enableSolvent>;
|
||||||
using ExtboModule = BlackOilExtboModule<TypeTag, enableExtbo>;
|
using ExtboModule = BlackOilExtboModule<TypeTag, enableExtbo>;
|
||||||
@ -130,7 +130,7 @@ public:
|
|||||||
BlackOilPrimaryVariables()
|
BlackOilPrimaryVariables()
|
||||||
: ParentType()
|
: ParentType()
|
||||||
{
|
{
|
||||||
Opm::Valgrind::SetUndefined(*this);
|
Valgrind::SetUndefined(*this);
|
||||||
pvtRegionIdx_ = 0;
|
pvtRegionIdx_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
BlackOilPrimaryVariables(Scalar value)
|
BlackOilPrimaryVariables(Scalar value)
|
||||||
: ParentType(value)
|
: ParentType(value)
|
||||||
{
|
{
|
||||||
Opm::Valgrind::SetUndefined(primaryVarsMeaning_);
|
Valgrind::SetUndefined(primaryVarsMeaning_);
|
||||||
pvtRegionIdx_ = 0;
|
pvtRegionIdx_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,13 +190,13 @@ public:
|
|||||||
{
|
{
|
||||||
using ConstEvaluation = typename std::remove_reference<typename FluidState::Scalar>::type;
|
using ConstEvaluation = typename std::remove_reference<typename FluidState::Scalar>::type;
|
||||||
using FsEvaluation = typename std::remove_const<ConstEvaluation>::type;
|
using FsEvaluation = typename std::remove_const<ConstEvaluation>::type;
|
||||||
using FsToolbox = typename Opm::MathToolbox<FsEvaluation>;
|
using FsToolbox = MathToolbox<FsEvaluation>;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// make sure the temperature is the same in all fluid phases
|
// make sure the temperature is the same in all fluid phases
|
||||||
for (unsigned phaseIdx = 1; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 1; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
Opm::Valgrind::CheckDefined(fluidState.temperature(0));
|
Valgrind::CheckDefined(fluidState.temperature(0));
|
||||||
Opm::Valgrind::CheckDefined(fluidState.temperature(phaseIdx));
|
Valgrind::CheckDefined(fluidState.temperature(phaseIdx));
|
||||||
|
|
||||||
assert(fluidState.temperature(0) == fluidState.temperature(phaseIdx));
|
assert(fluidState.temperature(0) == fluidState.temperature(phaseIdx));
|
||||||
}
|
}
|
||||||
@ -216,8 +216,8 @@ public:
|
|||||||
paramCache.setMaxOilSat(FsToolbox::value(fluidState.saturation(oilPhaseIdx)));
|
paramCache.setMaxOilSat(FsToolbox::value(fluidState.saturation(oilPhaseIdx)));
|
||||||
|
|
||||||
// create a mutable fluid state with well defined densities based on the input
|
// create a mutable fluid state with well defined densities based on the input
|
||||||
using NcpFlash = Opm::NcpFlash<Scalar, FluidSystem>;
|
using NcpFlash = NcpFlash<Scalar, FluidSystem>;
|
||||||
using FlashFluidState = Opm::CompositionalFluidState<Scalar, FluidSystem>;
|
using FlashFluidState = CompositionalFluidState<Scalar, FluidSystem>;
|
||||||
FlashFluidState fsFlash;
|
FlashFluidState fsFlash;
|
||||||
fsFlash.setTemperature(FsToolbox::value(fluidState.temperature(/*phaseIdx=*/0)));
|
fsFlash.setTemperature(FsToolbox::value(fluidState.temperature(/*phaseIdx=*/0)));
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
{
|
{
|
||||||
using ConstEvaluation = typename std::remove_reference<typename FluidState::Scalar>::type;
|
using ConstEvaluation = typename std::remove_reference<typename FluidState::Scalar>::type;
|
||||||
using FsEvaluation = typename std::remove_const<ConstEvaluation>::type;
|
using FsEvaluation = typename std::remove_const<ConstEvaluation>::type;
|
||||||
using FsToolbox = typename Opm::MathToolbox<FsEvaluation>;
|
using FsToolbox = MathToolbox<FsEvaluation>;
|
||||||
|
|
||||||
bool gasPresent = FluidSystem::phaseIsActive(gasPhaseIdx)?(fluidState.saturation(gasPhaseIdx) > 0.0):false;
|
bool gasPresent = FluidSystem::phaseIsActive(gasPhaseIdx)?(fluidState.saturation(gasPhaseIdx) > 0.0):false;
|
||||||
bool oilPresent = FluidSystem::phaseIsActive(oilPhaseIdx)?(fluidState.saturation(oilPhaseIdx) > 0.0):false;
|
bool oilPresent = FluidSystem::phaseIsActive(oilPhaseIdx)?(fluidState.saturation(oilPhaseIdx) > 0.0):false;
|
||||||
@ -320,7 +320,7 @@ public:
|
|||||||
(*this)[compositionSwitchIdx] = FsToolbox::value(fluidState.saturation(gasPhaseIdx));
|
(*this)[compositionSwitchIdx] = FsToolbox::value(fluidState.saturation(gasPhaseIdx));
|
||||||
}
|
}
|
||||||
else if (primaryVarsMeaning() == Sw_po_Rs) {
|
else if (primaryVarsMeaning() == Sw_po_Rs) {
|
||||||
const auto& Rs = Opm::BlackOil::getRs_<FluidSystem, FluidState, Scalar>(fluidState, pvtRegionIdx_);
|
const auto& Rs = BlackOil::getRs_<FluidSystem, FluidState, Scalar>(fluidState, pvtRegionIdx_);
|
||||||
|
|
||||||
if (waterEnabled)
|
if (waterEnabled)
|
||||||
(*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
(*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
||||||
@ -331,7 +331,7 @@ public:
|
|||||||
else {
|
else {
|
||||||
assert(primaryVarsMeaning() == Sw_pg_Rv);
|
assert(primaryVarsMeaning() == Sw_pg_Rv);
|
||||||
|
|
||||||
const auto& Rv = Opm::BlackOil::getRv_<FluidSystem, FluidState, Scalar>(fluidState, pvtRegionIdx_);
|
const auto& Rv = BlackOil::getRv_<FluidSystem, FluidState, Scalar>(fluidState, pvtRegionIdx_);
|
||||||
if (waterEnabled)
|
if (waterEnabled)
|
||||||
(*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
(*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
||||||
|
|
||||||
@ -678,11 +678,11 @@ public:
|
|||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// check the "real" primary variables
|
// check the "real" primary variables
|
||||||
for (unsigned i = 0; i < this->size(); ++i)
|
for (unsigned i = 0; i < this->size(); ++i)
|
||||||
Opm::Valgrind::CheckDefined((*this)[i]);
|
Valgrind::CheckDefined((*this)[i]);
|
||||||
|
|
||||||
// check the "pseudo" primary variables
|
// check the "pseudo" primary variables
|
||||||
Opm::Valgrind::CheckDefined(primaryVarsMeaning_);
|
Valgrind::CheckDefined(primaryVarsMeaning_);
|
||||||
Opm::Valgrind::CheckDefined(pvtRegionIdx_);
|
Valgrind::CheckDefined(pvtRegionIdx_);
|
||||||
#endif // NDEBUG
|
#endif // NDEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -748,7 +748,7 @@ private:
|
|||||||
Scalar Sw,
|
Scalar Sw,
|
||||||
const MaterialLawParams& matParams) const
|
const MaterialLawParams& matParams) const
|
||||||
{
|
{
|
||||||
using SatOnlyFluidState = Opm::SimpleModularFluidState<Scalar,
|
using SatOnlyFluidState = SimpleModularFluidState<Scalar,
|
||||||
numPhases,
|
numPhases,
|
||||||
numComponents,
|
numComponents,
|
||||||
FluidSystem,
|
FluidSystem,
|
||||||
|
@ -71,12 +71,12 @@ class BlackOilRateVector
|
|||||||
enum { enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>() };
|
enum { enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>() };
|
||||||
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
|
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
|
||||||
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
|
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using ParentType = Dune::FieldVector<Evaluation, numEq>;
|
using ParentType = Dune::FieldVector<Evaluation, numEq>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BlackOilRateVector() : ParentType()
|
BlackOilRateVector() : ParentType()
|
||||||
{ Opm::Valgrind::SetUndefined(*this); }
|
{ Valgrind::SetUndefined(*this); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar)
|
* \copydoc ImmiscibleRateVector::ImmiscibleRateVector(Scalar)
|
||||||
|
@ -78,10 +78,10 @@ class BlackOilSolventModule
|
|||||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using SolventPvt = Opm::SolventPvt<Scalar>;
|
using SolventPvt = ::Opm::SolventPvt<Scalar>;
|
||||||
|
|
||||||
using TabulatedFunction = typename Opm::Tabulated1DFunction<Scalar>;
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
||||||
|
|
||||||
static constexpr unsigned solventSaturationIdx = Indices::solventSaturationIdx;
|
static constexpr unsigned solventSaturationIdx = Indices::solventSaturationIdx;
|
||||||
static constexpr unsigned contiSolventEqIdx = Indices::contiSolventEqIdx;
|
static constexpr unsigned contiSolventEqIdx = Indices::contiSolventEqIdx;
|
||||||
@ -96,7 +96,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Initialize all internal data structures needed by the solvent module
|
* \brief Initialize all internal data structures needed by the solvent module
|
||||||
*/
|
*/
|
||||||
static void initFromState(const Opm::EclipseState& eclState, const Schedule& schedule)
|
static void initFromState(const EclipseState& eclState, const Schedule& schedule)
|
||||||
{
|
{
|
||||||
// some sanity checks: if solvents are enabled, the SOLVENT keyword must be
|
// some sanity checks: if solvents are enabled, the SOLVENT keyword must be
|
||||||
// present, if solvents are disabled the keyword must not be present.
|
// present, if solvents are disabled the keyword must not be present.
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
unsigned numSatRegions = tableManager.getTabdims().getNumSatTables();
|
unsigned numSatRegions = tableManager.getTabdims().getNumSatTables();
|
||||||
setNumSatRegions(numSatRegions);
|
setNumSatRegions(numSatRegions);
|
||||||
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
||||||
const auto& ssfnTable = ssfnTables.template getTable<Opm::SsfnTable>(satRegionIdx);
|
const auto& ssfnTable = ssfnTables.template getTable<SsfnTable>(satRegionIdx);
|
||||||
ssfnKrg_[satRegionIdx].setXYContainers(ssfnTable.getSolventFractionColumn(),
|
ssfnKrg_[satRegionIdx].setXYContainers(ssfnTable.getSolventFractionColumn(),
|
||||||
ssfnTable.getGasRelPermMultiplierColumn(),
|
ssfnTable.getGasRelPermMultiplierColumn(),
|
||||||
/*sortInput=*/true);
|
/*sortInput=*/true);
|
||||||
@ -141,7 +141,7 @@ public:
|
|||||||
// resize the attributes of the object
|
// resize the attributes of the object
|
||||||
sof2Krn_.resize(numSatRegions);
|
sof2Krn_.resize(numSatRegions);
|
||||||
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
for (unsigned satRegionIdx = 0; satRegionIdx < numSatRegions; ++ satRegionIdx) {
|
||||||
const auto& sof2Table = sof2Tables.template getTable<Opm::Sof2Table>(satRegionIdx);
|
const auto& sof2Table = sof2Tables.template getTable<Sof2Table>(satRegionIdx);
|
||||||
sof2Krn_[satRegionIdx].setXYContainers(sof2Table.getSoColumn(),
|
sof2Krn_[satRegionIdx].setXYContainers(sof2Table.getSoColumn(),
|
||||||
sof2Table.getKroColumn(),
|
sof2Table.getKroColumn(),
|
||||||
/*sortInput=*/true);
|
/*sortInput=*/true);
|
||||||
@ -159,7 +159,7 @@ public:
|
|||||||
// resize the attributes of the object
|
// resize the attributes of the object
|
||||||
misc_.resize(numMiscRegions);
|
misc_.resize(numMiscRegions);
|
||||||
for (unsigned miscRegionIdx = 0; miscRegionIdx < numMiscRegions; ++miscRegionIdx) {
|
for (unsigned miscRegionIdx = 0; miscRegionIdx < numMiscRegions; ++miscRegionIdx) {
|
||||||
const auto& miscTable = miscTables.template getTable<Opm::MiscTable>(miscRegionIdx);
|
const auto& miscTable = miscTables.template getTable<MiscTable>(miscRegionIdx);
|
||||||
|
|
||||||
// solventFraction = Ss / (Ss + Sg);
|
// solventFraction = Ss / (Ss + Sg);
|
||||||
const auto& solventFraction = miscTable.getSolventFractionColumn();
|
const auto& solventFraction = miscTable.getSolventFractionColumn();
|
||||||
@ -179,7 +179,7 @@ public:
|
|||||||
assert(numMiscRegions == pmiscTables.size());
|
assert(numMiscRegions == pmiscTables.size());
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
||||||
const auto& pmiscTable = pmiscTables.template getTable<Opm::PmiscTable>(regionIdx);
|
const auto& pmiscTable = pmiscTables.template getTable<PmiscTable>(regionIdx);
|
||||||
|
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& po = pmiscTable.getOilPhasePressureColumn();
|
const auto& po = pmiscTable.getOilPhasePressureColumn();
|
||||||
@ -209,7 +209,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numSatRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numSatRegions; ++regionIdx) {
|
||||||
const Opm::MsfnTable& msfnTable = msfnTables.template getTable<Opm::MsfnTable>(regionIdx);
|
const MsfnTable& msfnTable = msfnTables.template getTable<MsfnTable>(regionIdx);
|
||||||
|
|
||||||
// Copy data
|
// Copy data
|
||||||
// Ssg = Ss + Sg;
|
// Ssg = Ss + Sg;
|
||||||
@ -239,7 +239,7 @@ public:
|
|||||||
assert(numMiscRegions == sorwmisTables.size());
|
assert(numMiscRegions == sorwmisTables.size());
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
||||||
const auto& sorwmisTable = sorwmisTables.template getTable<Opm::SorwmisTable>(regionIdx);
|
const auto& sorwmisTable = sorwmisTables.template getTable<SorwmisTable>(regionIdx);
|
||||||
|
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& sw = sorwmisTable.getWaterSaturationColumn();
|
const auto& sw = sorwmisTable.getWaterSaturationColumn();
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
assert(numMiscRegions ==sgcwmisTables.size());
|
assert(numMiscRegions ==sgcwmisTables.size());
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
||||||
const auto& sgcwmisTable = sgcwmisTables.template getTable<Opm::SgcwmisTable>(regionIdx);
|
const auto& sgcwmisTable = sgcwmisTables.template getTable<SgcwmisTable>(regionIdx);
|
||||||
|
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& sw = sgcwmisTable.getWaterSaturationColumn();
|
const auto& sw = sgcwmisTable.getWaterSaturationColumn();
|
||||||
@ -308,7 +308,7 @@ public:
|
|||||||
|
|
||||||
assert(numMiscRegions == tlpmixparTables.size());
|
assert(numMiscRegions == tlpmixparTables.size());
|
||||||
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
||||||
const auto& tlpmixparTable = tlpmixparTables.template getTable<Opm::TlpmixpaTable>(regionIdx);
|
const auto& tlpmixparTable = tlpmixparTables.template getTable<TlpmixpaTable>(regionIdx);
|
||||||
|
|
||||||
// Copy data
|
// Copy data
|
||||||
const auto& po = tlpmixparTable.getOilPhasePressureColumn();
|
const auto& po = tlpmixparTable.getOilPhasePressureColumn();
|
||||||
@ -475,7 +475,7 @@ public:
|
|||||||
// solvents have disabled at compile time
|
// solvents have disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Opm::VtkBlackOilSolventModule<TypeTag>::registerParameters();
|
VtkBlackOilSolventModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -488,7 +488,7 @@ public:
|
|||||||
// solvents have disabled at compile time
|
// solvents have disabled at compile time
|
||||||
return;
|
return;
|
||||||
|
|
||||||
model.addOutputModule(new Opm::VtkBlackOilSolventModule<TypeTag>(simulator));
|
model.addOutputModule(new VtkBlackOilSolventModule<TypeTag>(simulator));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool primaryVarApplies(unsigned pvIdx)
|
static bool primaryVarApplies(unsigned pvIdx)
|
||||||
@ -582,7 +582,7 @@ public:
|
|||||||
else
|
else
|
||||||
flux[contiSolventEqIdx] =
|
flux[contiSolventEqIdx] =
|
||||||
extQuants.solventVolumeFlux()
|
extQuants.solventVolumeFlux()
|
||||||
*Opm::decay<Scalar>(up.solventInverseFormationVolumeFactor());
|
*decay<Scalar>(up.solventInverseFormationVolumeFactor());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (upIdx == inIdx)
|
if (upIdx == inIdx)
|
||||||
@ -592,7 +592,7 @@ public:
|
|||||||
else
|
else
|
||||||
flux[contiSolventEqIdx] =
|
flux[contiSolventEqIdx] =
|
||||||
extQuants.solventVolumeFlux()
|
extQuants.solventVolumeFlux()
|
||||||
*Opm::decay<Scalar>(up.solventDensity());
|
*decay<Scalar>(up.solventDensity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,7 +1321,7 @@ class BlackOilSolventExtensiveQuantities
|
|||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
|
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
|
||||||
static constexpr int dimWorld = GridView::dimensionworld;
|
static constexpr int dimWorld = GridView::dimensionworld;
|
||||||
@ -1341,7 +1341,7 @@ public:
|
|||||||
unsigned timeIdx)
|
unsigned timeIdx)
|
||||||
{
|
{
|
||||||
const auto& gradCalc = elemCtx.gradientCalculator();
|
const auto& gradCalc = elemCtx.gradientCalculator();
|
||||||
Opm::PressureCallback<TypeTag> pressureCallback(elemCtx);
|
PressureCallback<TypeTag> pressureCallback(elemCtx);
|
||||||
|
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
||||||
const auto& faceNormal = scvf.normal();
|
const auto& faceNormal = scvf.normal();
|
||||||
@ -1356,7 +1356,7 @@ public:
|
|||||||
elemCtx,
|
elemCtx,
|
||||||
scvfIdx,
|
scvfIdx,
|
||||||
pressureCallback);
|
pressureCallback);
|
||||||
Opm::Valgrind::CheckDefined(solventPGrad);
|
Valgrind::CheckDefined(solventPGrad);
|
||||||
|
|
||||||
// correct the pressure gradients by the gravitational acceleration
|
// correct the pressure gradients by the gravitational acceleration
|
||||||
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) {
|
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) {
|
||||||
@ -1402,8 +1402,8 @@ public:
|
|||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
|
||||||
solventPGrad[dimIdx] += f[dimIdx];
|
solventPGrad[dimIdx] += f[dimIdx];
|
||||||
|
|
||||||
if (!Opm::isfinite(solventPGrad[dimIdx]))
|
if (!isfinite(solventPGrad[dimIdx]))
|
||||||
throw Opm::NumericalIssue("Non-finite potential gradient for solvent 'phase'");
|
throw NumericalIssue("Non-finite potential gradient for solvent 'phase'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1430,7 +1430,7 @@ public:
|
|||||||
if (solventUpstreamDofIdx_ == i)
|
if (solventUpstreamDofIdx_ == i)
|
||||||
solventVolumeFlux_ = solventPGradNormal*up.solventMobility();
|
solventVolumeFlux_ = solventPGradNormal*up.solventMobility();
|
||||||
else
|
else
|
||||||
solventVolumeFlux_ = solventPGradNormal*Opm::scalarValue(up.solventMobility());
|
solventVolumeFlux_ = solventPGradNormal*scalarValue(up.solventMobility());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1472,7 +1472,7 @@ public:
|
|||||||
pressureExterior += distZ*g*rhoAvg;
|
pressureExterior += distZ*g*rhoAvg;
|
||||||
|
|
||||||
Evaluation pressureDiffSolvent = pressureExterior - pressureInterior;
|
Evaluation pressureDiffSolvent = pressureExterior - pressureInterior;
|
||||||
if (std::abs(Opm::scalarValue(pressureDiffSolvent)) > thpres) {
|
if (std::abs(scalarValue(pressureDiffSolvent)) > thpres) {
|
||||||
if (pressureDiffSolvent < 0.0)
|
if (pressureDiffSolvent < 0.0)
|
||||||
pressureDiffSolvent += thpres;
|
pressureDiffSolvent += thpres;
|
||||||
else
|
else
|
||||||
@ -1508,7 +1508,7 @@ public:
|
|||||||
*pressureDiffSolvent;
|
*pressureDiffSolvent;
|
||||||
else
|
else
|
||||||
solventVolumeFlux_ =
|
solventVolumeFlux_ =
|
||||||
Opm::scalarValue(up.solventMobility())
|
scalarValue(up.solventMobility())
|
||||||
*(-trans/faceArea)
|
*(-trans/faceArea)
|
||||||
*pressureDiffSolvent;
|
*pressureDiffSolvent;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ class DarcyExtensiveQuantities
|
|||||||
enum { dimWorld = GridView::dimensionworld };
|
enum { dimWorld = GridView::dimensionworld };
|
||||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||||
|
|
||||||
using Toolbox = typename Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using ParameterCache = typename FluidSystem::template ParameterCache<Evaluation>;
|
using ParameterCache = typename FluidSystem::template ParameterCache<Evaluation>;
|
||||||
using EvalDimVector = Dune::FieldVector<Evaluation, dimWorld>;
|
using EvalDimVector = Dune::FieldVector<Evaluation, dimWorld>;
|
||||||
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
||||||
@ -186,7 +186,7 @@ protected:
|
|||||||
unsigned timeIdx)
|
unsigned timeIdx)
|
||||||
{
|
{
|
||||||
const auto& gradCalc = elemCtx.gradientCalculator();
|
const auto& gradCalc = elemCtx.gradientCalculator();
|
||||||
Opm::PressureCallback<TypeTag> pressureCallback(elemCtx);
|
PressureCallback<TypeTag> pressureCallback(elemCtx);
|
||||||
|
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(faceIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(faceIdx);
|
||||||
const auto& faceNormal = scvf.normal();
|
const auto& faceNormal = scvf.normal();
|
||||||
@ -200,7 +200,7 @@ protected:
|
|||||||
// calculate the "raw" pressure gradient
|
// calculate the "raw" pressure gradient
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
||||||
Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ protected:
|
|||||||
elemCtx,
|
elemCtx,
|
||||||
faceIdx,
|
faceIdx,
|
||||||
pressureCallback);
|
pressureCallback);
|
||||||
Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// correct the pressure gradients by the gravitational acceleration
|
// correct the pressure gradients by the gravitational acceleration
|
||||||
@ -280,21 +280,21 @@ protected:
|
|||||||
potentialGrad_[phaseIdx][dimIdx] += f[dimIdx];
|
potentialGrad_[phaseIdx][dimIdx] += f[dimIdx];
|
||||||
|
|
||||||
for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) {
|
for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) {
|
||||||
if (!Opm::isfinite(potentialGrad_[phaseIdx][dimIdx])) {
|
if (!isfinite(potentialGrad_[phaseIdx][dimIdx])) {
|
||||||
throw Opm::NumericalIssue("Non-finite potential gradient for phase '"
|
throw NumericalIssue("Non-finite potential gradient for phase '"
|
||||||
+std::string(FluidSystem::phaseName(phaseIdx))+"'");
|
+std::string(FluidSystem::phaseName(phaseIdx))+"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::Valgrind::SetUndefined(K_);
|
Valgrind::SetUndefined(K_);
|
||||||
elemCtx.problem().intersectionIntrinsicPermeability(K_, elemCtx, faceIdx, timeIdx);
|
elemCtx.problem().intersectionIntrinsicPermeability(K_, elemCtx, faceIdx, timeIdx);
|
||||||
Opm::Valgrind::CheckDefined(K_);
|
Valgrind::CheckDefined(K_);
|
||||||
|
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
||||||
Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,12 +335,12 @@ protected:
|
|||||||
const FluidState& fluidState)
|
const FluidState& fluidState)
|
||||||
{
|
{
|
||||||
const auto& gradCalc = elemCtx.gradientCalculator();
|
const auto& gradCalc = elemCtx.gradientCalculator();
|
||||||
Opm::BoundaryPressureCallback<TypeTag, FluidState> pressureCallback(elemCtx, fluidState);
|
BoundaryPressureCallback<TypeTag, FluidState> pressureCallback(elemCtx, fluidState);
|
||||||
|
|
||||||
// calculate the pressure gradient
|
// calculate the pressure gradient
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
||||||
Opm::Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
Valgrind::SetUndefined(potentialGrad_[phaseIdx]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +349,7 @@ protected:
|
|||||||
elemCtx,
|
elemCtx,
|
||||||
boundaryFaceIdx,
|
boundaryFaceIdx,
|
||||||
pressureCallback);
|
pressureCallback);
|
||||||
Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx);
|
||||||
@ -384,7 +384,7 @@ protected:
|
|||||||
Evaluation rhoIn = intQuantsIn.fluidState().density(phaseIdx);
|
Evaluation rhoIn = intQuantsIn.fluidState().density(phaseIdx);
|
||||||
Evaluation pStatIn = - gTimesDist*rhoIn;
|
Evaluation pStatIn = - gTimesDist*rhoIn;
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(pStatIn);
|
Valgrind::CheckDefined(pStatIn);
|
||||||
// compute the hydrostatic gradient between the control volume and face integration
|
// compute the hydrostatic gradient between the control volume and face integration
|
||||||
// point. This gradient exhibitis the same direction as the vector between the
|
// point. This gradient exhibitis the same direction as the vector between the
|
||||||
// control volume center and face integration point (-distVecIn / absDist) and the
|
// control volume center and face integration point (-distVecIn / absDist) and the
|
||||||
@ -397,10 +397,10 @@ protected:
|
|||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
||||||
potentialGrad_[phaseIdx][dimIdx] += f[dimIdx];
|
potentialGrad_[phaseIdx][dimIdx] += f[dimIdx];
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
Valgrind::CheckDefined(potentialGrad_[phaseIdx]);
|
||||||
for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) {
|
for (unsigned dimIdx = 0; dimIdx < potentialGrad_[phaseIdx].size(); ++dimIdx) {
|
||||||
if (!Opm::isfinite(potentialGrad_[phaseIdx][dimIdx])) {
|
if (!isfinite(potentialGrad_[phaseIdx][dimIdx])) {
|
||||||
throw Opm::NumericalIssue("Non finite potential gradient for phase '"
|
throw NumericalIssue("Non finite potential gradient for phase '"
|
||||||
+std::string(FluidSystem::phaseName(phaseIdx))+"'");
|
+std::string(FluidSystem::phaseName(phaseIdx))+"'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -414,7 +414,7 @@ protected:
|
|||||||
|
|
||||||
Scalar kr[numPhases];
|
Scalar kr[numPhases];
|
||||||
MaterialLaw::relativePermeabilities(kr, matParams, fluidState);
|
MaterialLaw::relativePermeabilities(kr, matParams, fluidState);
|
||||||
Opm::Valgrind::CheckDefined(kr);
|
Valgrind::CheckDefined(kr);
|
||||||
|
|
||||||
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx))
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx))
|
||||||
@ -447,7 +447,7 @@ protected:
|
|||||||
mobility_[phaseIdx] = Toolbox::value(intQuantsIn.mobility(phaseIdx));
|
mobility_[phaseIdx] = Toolbox::value(intQuantsIn.mobility(phaseIdx));
|
||||||
else
|
else
|
||||||
mobility_[phaseIdx] = intQuantsIn.mobility(phaseIdx);
|
mobility_[phaseIdx] = intQuantsIn.mobility(phaseIdx);
|
||||||
Opm::Valgrind::CheckDefined(mobility_[phaseIdx]);
|
Valgrind::CheckDefined(mobility_[phaseIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ protected:
|
|||||||
{
|
{
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
||||||
const DimVector& normal = scvf.normal();
|
const DimVector& normal = scvf.normal();
|
||||||
Opm::Valgrind::CheckDefined(normal);
|
Valgrind::CheckDefined(normal);
|
||||||
|
|
||||||
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
||||||
filterVelocity_[phaseIdx] = 0.0;
|
filterVelocity_[phaseIdx] = 0.0;
|
||||||
@ -470,7 +470,7 @@ protected:
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
asImp_().calculateFilterVelocity_(phaseIdx);
|
asImp_().calculateFilterVelocity_(phaseIdx);
|
||||||
Opm::Valgrind::CheckDefined(filterVelocity_[phaseIdx]);
|
Valgrind::CheckDefined(filterVelocity_[phaseIdx]);
|
||||||
|
|
||||||
volumeFlux_[phaseIdx] = 0.0;
|
volumeFlux_[phaseIdx] = 0.0;
|
||||||
for (unsigned i = 0; i < normal.size(); ++i)
|
for (unsigned i = 0; i < normal.size(); ++i)
|
||||||
@ -490,7 +490,7 @@ protected:
|
|||||||
{
|
{
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).boundaryFace(boundaryFaceIdx);
|
||||||
const DimVector& normal = scvf.normal();
|
const DimVector& normal = scvf.normal();
|
||||||
Opm::Valgrind::CheckDefined(normal);
|
Valgrind::CheckDefined(normal);
|
||||||
|
|
||||||
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
||||||
@ -500,7 +500,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
asImp_().calculateFilterVelocity_(phaseIdx);
|
asImp_().calculateFilterVelocity_(phaseIdx);
|
||||||
Opm::Valgrind::CheckDefined(filterVelocity_[phaseIdx]);
|
Valgrind::CheckDefined(filterVelocity_[phaseIdx]);
|
||||||
volumeFlux_[phaseIdx] = 0.0;
|
volumeFlux_[phaseIdx] = 0.0;
|
||||||
for (unsigned i = 0; i < normal.size(); ++i)
|
for (unsigned i = 0; i < normal.size(); ++i)
|
||||||
volumeFlux_[phaseIdx] += filterVelocity_[phaseIdx][i] * normal[i];
|
volumeFlux_[phaseIdx] += filterVelocity_[phaseIdx][i] * normal[i];
|
||||||
@ -510,7 +510,7 @@ protected:
|
|||||||
void calculateFilterVelocity_(unsigned phaseIdx)
|
void calculateFilterVelocity_(unsigned phaseIdx)
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
assert(Opm::isfinite(mobility_[phaseIdx]));
|
assert(isfinite(mobility_[phaseIdx]));
|
||||||
for (unsigned i = 0; i < K_.M(); ++ i)
|
for (unsigned i = 0; i < K_.M(); ++ i)
|
||||||
for (unsigned j = 0; j < K_.N(); ++ j)
|
for (unsigned j = 0; j < K_.N(); ++ j)
|
||||||
assert(std::isfinite(K_[i][j]));
|
assert(std::isfinite(K_[i][j]));
|
||||||
@ -521,7 +521,7 @@ protected:
|
|||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned i = 0; i < filterVelocity_[phaseIdx].size(); ++ i)
|
for (unsigned i = 0; i < filterVelocity_[phaseIdx].size(); ++ i)
|
||||||
assert(Opm::isfinite(filterVelocity_[phaseIdx][i]));
|
assert(isfinite(filterVelocity_[phaseIdx][i]));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ class ForchheimerExtensiveQuantities
|
|||||||
enum { dimWorld = GridView::dimensionworld };
|
enum { dimWorld = GridView::dimensionworld };
|
||||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
using DimVector = Dune::FieldVector<Scalar, dimWorld>;
|
||||||
using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
|
using DimEvalVector = Dune::FieldVector<Evaluation, dimWorld>;
|
||||||
@ -271,16 +271,16 @@ protected:
|
|||||||
if (focusDofIdx == i) {
|
if (focusDofIdx == i) {
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(intQuantsIn.ergunCoefficient() +
|
(intQuantsIn.ergunCoefficient() +
|
||||||
Opm::getValue(intQuantsEx.ergunCoefficient()))/2;
|
getValue(intQuantsEx.ergunCoefficient()))/2;
|
||||||
}
|
}
|
||||||
else if (focusDofIdx == j)
|
else if (focusDofIdx == j)
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(Opm::getValue(intQuantsIn.ergunCoefficient()) +
|
(getValue(intQuantsIn.ergunCoefficient()) +
|
||||||
intQuantsEx.ergunCoefficient())/2;
|
intQuantsEx.ergunCoefficient())/2;
|
||||||
else
|
else
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(Opm::getValue(intQuantsIn.ergunCoefficient()) +
|
(getValue(intQuantsIn.ergunCoefficient()) +
|
||||||
Opm::getValue(intQuantsEx.ergunCoefficient()))/2;
|
getValue(intQuantsEx.ergunCoefficient()))/2;
|
||||||
|
|
||||||
// obtain the mobility to passability ratio for each phase.
|
// obtain the mobility to passability ratio for each phase.
|
||||||
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
for (unsigned phaseIdx=0; phaseIdx < numPhases; phaseIdx++) {
|
||||||
@ -298,9 +298,9 @@ protected:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
density_[phaseIdx] =
|
density_[phaseIdx] =
|
||||||
Opm::getValue(up.fluidState().density(phaseIdx));
|
getValue(up.fluidState().density(phaseIdx));
|
||||||
mobilityPassabilityRatio_[phaseIdx] =
|
mobilityPassabilityRatio_[phaseIdx] =
|
||||||
Opm::getValue(up.mobilityPassabilityRatio(phaseIdx));
|
getValue(up.mobilityPassabilityRatio(phaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -325,7 +325,7 @@ protected:
|
|||||||
if (focusDofIdx == i)
|
if (focusDofIdx == i)
|
||||||
ergunCoefficient_ = intQuantsIn.ergunCoefficient();
|
ergunCoefficient_ = intQuantsIn.ergunCoefficient();
|
||||||
else
|
else
|
||||||
ergunCoefficient_ = Opm::getValue(intQuantsIn.ergunCoefficient());
|
ergunCoefficient_ = getValue(intQuantsIn.ergunCoefficient());
|
||||||
|
|
||||||
// calculate the square root of the intrinsic permeability
|
// calculate the square root of the intrinsic permeability
|
||||||
assert(isDiagonal_(this->K_));
|
assert(isDiagonal_(this->K_));
|
||||||
@ -343,9 +343,9 @@ protected:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
density_[phaseIdx] =
|
density_[phaseIdx] =
|
||||||
Opm::getValue(intQuantsIn.fluidState().density(phaseIdx));
|
getValue(intQuantsIn.fluidState().density(phaseIdx));
|
||||||
mobilityPassabilityRatio_[phaseIdx] =
|
mobilityPassabilityRatio_[phaseIdx] =
|
||||||
Opm::getValue(intQuantsIn.mobilityPassabilityRatio(phaseIdx));
|
getValue(intQuantsIn.mobilityPassabilityRatio(phaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,22 +366,22 @@ protected:
|
|||||||
|
|
||||||
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
const auto& scvf = elemCtx.stencil(timeIdx).interiorFace(scvfIdx);
|
||||||
const auto& normal = scvf.normal();
|
const auto& normal = scvf.normal();
|
||||||
Opm::Valgrind::CheckDefined(normal);
|
Valgrind::CheckDefined(normal);
|
||||||
|
|
||||||
// obtain the Ergun coefficient from the intensive quantity object. Until a
|
// obtain the Ergun coefficient from the intensive quantity object. Until a
|
||||||
// better method comes along, we use arithmetic averaging.
|
// better method comes along, we use arithmetic averaging.
|
||||||
if (focusDofIdx == i)
|
if (focusDofIdx == i)
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(intQuantsI.ergunCoefficient() +
|
(intQuantsI.ergunCoefficient() +
|
||||||
Opm::getValue(intQuantsJ.ergunCoefficient())) / 2;
|
getValue(intQuantsJ.ergunCoefficient())) / 2;
|
||||||
else if (focusDofIdx == j)
|
else if (focusDofIdx == j)
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(Opm::getValue(intQuantsI.ergunCoefficient()) +
|
(getValue(intQuantsI.ergunCoefficient()) +
|
||||||
intQuantsJ.ergunCoefficient()) / 2;
|
intQuantsJ.ergunCoefficient()) / 2;
|
||||||
else
|
else
|
||||||
ergunCoefficient_ =
|
ergunCoefficient_ =
|
||||||
(Opm::getValue(intQuantsI.ergunCoefficient()) +
|
(getValue(intQuantsI.ergunCoefficient()) +
|
||||||
Opm::getValue(intQuantsJ.ergunCoefficient())) / 2;
|
getValue(intQuantsJ.ergunCoefficient())) / 2;
|
||||||
|
|
||||||
///////////////
|
///////////////
|
||||||
// calculate the weights of the upstream and the downstream control volumes
|
// calculate the weights of the upstream and the downstream control volumes
|
||||||
@ -449,7 +449,7 @@ protected:
|
|||||||
unsigned newtonIter = 0;
|
unsigned newtonIter = 0;
|
||||||
while (deltaV.one_norm() > 1e-11) {
|
while (deltaV.one_norm() > 1e-11) {
|
||||||
if (newtonIter >= 50)
|
if (newtonIter >= 50)
|
||||||
throw Opm::NumericalIssue("Could not determine Forchheimer velocity within "
|
throw NumericalIssue("Could not determine Forchheimer velocity within "
|
||||||
+std::to_string(newtonIter)+" iterations");
|
+std::to_string(newtonIter)+" iterations");
|
||||||
++newtonIter;
|
++newtonIter;
|
||||||
|
|
||||||
@ -506,7 +506,7 @@ protected:
|
|||||||
const auto& alpha = density*mobilityPassabilityRatio*ergunCoefficient_*absVel;
|
const auto& alpha = density*mobilityPassabilityRatio*ergunCoefficient_*absVel;
|
||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
||||||
residual[dimIdx] += sqrtK_[dimIdx]*alpha*velocity[dimIdx];
|
residual[dimIdx] += sqrtK_[dimIdx]*alpha*velocity[dimIdx];
|
||||||
Opm::Valgrind::CheckDefined(residual);
|
Valgrind::CheckDefined(residual);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gradForchheimerResid_(DimEvalVector& residual,
|
void gradForchheimerResid_(DimEvalVector& residual,
|
||||||
|
@ -89,8 +89,8 @@ public:
|
|||||||
// normal or in the opposite one
|
// normal or in the opposite one
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
if (!elemCtx.model().phaseIsConsidered(phaseIdx)) {
|
||||||
Opm::Valgrind::SetUndefined(upstreamScvIdx_[phaseIdx]);
|
Valgrind::SetUndefined(upstreamScvIdx_[phaseIdx]);
|
||||||
Opm::Valgrind::SetUndefined(downstreamScvIdx_[phaseIdx]);
|
Valgrind::SetUndefined(downstreamScvIdx_[phaseIdx]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,11 +83,11 @@ struct NumComponents<TypeTag, TTag::MultiPhaseBaseModel> { static constexpr int
|
|||||||
|
|
||||||
//! The type of the base base class for actual problems
|
//! The type of the base base class for actual problems
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct BaseProblem<TypeTag, TTag::MultiPhaseBaseModel> { using type = Opm::MultiPhaseBaseProblem<TypeTag>; };
|
struct BaseProblem<TypeTag, TTag::MultiPhaseBaseModel> { using type = MultiPhaseBaseProblem<TypeTag>; };
|
||||||
|
|
||||||
//! By default, use the Darcy relation to determine the phase velocity
|
//! By default, use the Darcy relation to determine the phase velocity
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct FluxModule<TypeTag, TTag::MultiPhaseBaseModel> { using type = Opm::DarcyFluxModule<TypeTag>; };
|
struct FluxModule<TypeTag, TTag::MultiPhaseBaseModel> { using type = DarcyFluxModule<TypeTag>; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Set the material law to the null law by default.
|
* \brief Set the material law to the null law by default.
|
||||||
@ -98,10 +98,10 @@ struct MaterialLaw<TypeTag, TTag::MultiPhaseBaseModel>
|
|||||||
private:
|
private:
|
||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
using Traits = Opm::NullMaterialTraits<Scalar, FluidSystem::numPhases>;
|
using Traits = NullMaterialTraits<Scalar, FluidSystem::numPhases>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using type = Opm::NullMaterial<Traits>;
|
using type = NullMaterial<Traits>;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -116,7 +116,7 @@ struct MaterialLawParams<TypeTag, TTag::MultiPhaseBaseModel>
|
|||||||
//! by default
|
//! by default
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct SolidEnergyLaw<TypeTag, TTag::MultiPhaseBaseModel>
|
struct SolidEnergyLaw<TypeTag, TTag::MultiPhaseBaseModel>
|
||||||
{ using type = Opm::NullSolidEnergyLaw<GetPropType<TypeTag, Properties::Scalar>>; };
|
{ using type = NullSolidEnergyLaw<GetPropType<TypeTag, Properties::Scalar>>; };
|
||||||
|
|
||||||
//! extract the type of the parameter objects for the solid energy storage law from the
|
//! extract the type of the parameter objects for the solid energy storage law from the
|
||||||
//! law itself
|
//! law itself
|
||||||
@ -127,7 +127,7 @@ struct SolidEnergyLawParams<TypeTag, TTag::MultiPhaseBaseModel>
|
|||||||
//! set the thermal conduction law to a dummy one by default
|
//! set the thermal conduction law to a dummy one by default
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ThermalConductionLaw<TypeTag, TTag::MultiPhaseBaseModel>
|
struct ThermalConductionLaw<TypeTag, TTag::MultiPhaseBaseModel>
|
||||||
{ using type = Opm::NullThermalConductionLaw<GetPropType<TypeTag, Properties::Scalar>>; };
|
{ using type = NullThermalConductionLaw<GetPropType<TypeTag, Properties::Scalar>>; };
|
||||||
|
|
||||||
//! extract the type of the parameter objects for the thermal conduction law from the law
|
//! extract the type of the parameter objects for the thermal conduction law from the law
|
||||||
//! itself
|
//! itself
|
||||||
@ -182,8 +182,8 @@ public:
|
|||||||
ParentType::registerParameters();
|
ParentType::registerParameters();
|
||||||
|
|
||||||
// register runtime parameters of the VTK output modules
|
// register runtime parameters of the VTK output modules
|
||||||
Opm::VtkMultiPhaseModule<TypeTag>::registerParameters();
|
VtkMultiPhaseModule<TypeTag>::registerParameters();
|
||||||
Opm::VtkTemperatureModule<TypeTag>::registerParameters();
|
VtkTemperatureModule<TypeTag>::registerParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -257,8 +257,8 @@ public:
|
|||||||
ParentType::registerOutputModules_();
|
ParentType::registerOutputModules_();
|
||||||
|
|
||||||
// add the VTK output modules which make sense for all multi-phase models
|
// add the VTK output modules which make sense for all multi-phase models
|
||||||
this->addOutputModule(new Opm::VtkMultiPhaseModule<TypeTag>(this->simulator_));
|
this->addOutputModule(new VtkMultiPhaseModule<TypeTag>(this->simulator_));
|
||||||
this->addOutputModule(new Opm::VtkTemperatureModule<TypeTag>(this->simulator_));
|
this->addOutputModule(new VtkTemperatureModule<TypeTag>(this->simulator_));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -54,7 +54,7 @@ class MultiPhaseBaseProblem
|
|||||||
, public GetPropType<TypeTag, Properties::FluxModule>::FluxBaseProblem
|
, public GetPropType<TypeTag, Properties::FluxModule>::FluxBaseProblem
|
||||||
{
|
{
|
||||||
//! \cond SKIP_THIS
|
//! \cond SKIP_THIS
|
||||||
using ParentType = Opm::FvBaseProblem<TypeTag>;
|
using ParentType = FvBaseProblem<TypeTag>;
|
||||||
|
|
||||||
using Implementation = GetPropType<TypeTag, Properties::Problem>;
|
using Implementation = GetPropType<TypeTag, Properties::Problem>;
|
||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
// you have off-main diagonal entries in your permeabilities!
|
// you have off-main diagonal entries in your permeabilities!
|
||||||
for (unsigned i = 0; i < dimWorld; ++i)
|
for (unsigned i = 0; i < dimWorld; ++i)
|
||||||
for (unsigned j = 0; j < dimWorld; ++j)
|
for (unsigned j = 0; j < dimWorld; ++j)
|
||||||
result[i][j] = Opm::harmonicMean(K1[i][j], K2[i][j]);
|
result[i][j] = harmonicMean(K1[i][j], K2[i][j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -305,7 +305,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
unsigned markForGridAdaptation()
|
unsigned markForGridAdaptation()
|
||||||
{
|
{
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
unsigned numMarked = 0;
|
unsigned numMarked = 0;
|
||||||
ElementContext elemCtx( this->simulator() );
|
ElementContext elemCtx( this->simulator() );
|
||||||
|
@ -54,7 +54,7 @@ class TemperatureCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
TemperatureCallback(const ElementContext& elemCtx)
|
TemperatureCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -90,11 +90,11 @@ class PressureCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
PressureCallback(const ElementContext& elemCtx)
|
PressureCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{ Opm::Valgrind::SetUndefined(phaseIdx_); }
|
{ Valgrind::SetUndefined(phaseIdx_); }
|
||||||
|
|
||||||
PressureCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
PressureCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -114,7 +114,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ class BoundaryPressureCallback
|
|||||||
using IQRawFluidState = decltype(std::declval<IntensiveQuantities>().fluidState());
|
using IQRawFluidState = decltype(std::declval<IntensiveQuantities>().fluidState());
|
||||||
using IQFluidState = typename std::remove_const<typename std::remove_reference<IQRawFluidState>::type>::type;
|
using IQFluidState = typename std::remove_const<typename std::remove_reference<IQRawFluidState>::type>::type;
|
||||||
using IQScalar = typename IQFluidState::Scalar;
|
using IQScalar = typename IQFluidState::Scalar;
|
||||||
using Toolbox = Opm::MathToolbox<IQScalar>;
|
using Toolbox = MathToolbox<IQScalar>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = IQScalar;
|
using ResultType = IQScalar;
|
||||||
@ -146,7 +146,7 @@ public:
|
|||||||
BoundaryPressureCallback(const ElementContext& elemCtx, const FluidState& boundaryFs)
|
BoundaryPressureCallback(const ElementContext& elemCtx, const FluidState& boundaryFs)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
, boundaryFs_(boundaryFs)
|
, boundaryFs_(boundaryFs)
|
||||||
{ Opm::Valgrind::SetUndefined(phaseIdx_); }
|
{ Valgrind::SetUndefined(phaseIdx_); }
|
||||||
|
|
||||||
BoundaryPressureCallback(const ElementContext& elemCtx,
|
BoundaryPressureCallback(const ElementContext& elemCtx,
|
||||||
const FluidState& boundaryFs,
|
const FluidState& boundaryFs,
|
||||||
@ -169,13 +169,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().pressure(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
IQScalar boundaryValue() const
|
IQScalar boundaryValue() const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return boundaryFs_.pressure(phaseIdx_);
|
return boundaryFs_.pressure(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,11 +201,11 @@ class DensityCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
DensityCallback(const ElementContext& elemCtx)
|
DensityCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{ Opm::Valgrind::SetUndefined(phaseIdx_); }
|
{ Valgrind::SetUndefined(phaseIdx_); }
|
||||||
|
|
||||||
DensityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
DensityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -225,7 +225,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().density(phaseIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().density(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -249,11 +249,11 @@ class MolarDensityCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = decltype(std::declval<IQFluidState>().molarDensity(0));
|
using ResultType = decltype(std::declval<IQFluidState>().molarDensity(0));
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
MolarDensityCallback(const ElementContext& elemCtx)
|
MolarDensityCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{ Opm::Valgrind::SetUndefined(phaseIdx_); }
|
{ Valgrind::SetUndefined(phaseIdx_); }
|
||||||
|
|
||||||
MolarDensityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
MolarDensityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -273,7 +273,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().molarDensity(phaseIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().molarDensity(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,11 +298,11 @@ class ViscosityCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
ViscosityCallback(const ElementContext& elemCtx)
|
ViscosityCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{ Opm::Valgrind::SetUndefined(phaseIdx_); }
|
{ Valgrind::SetUndefined(phaseIdx_); }
|
||||||
|
|
||||||
ViscosityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
ViscosityCallback(const ElementContext& elemCtx, unsigned phaseIdx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -322,7 +322,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().viscosity(phaseIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().viscosity(phaseIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ class VelocityCallback
|
|||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultFieldType = typename ResultType::field_type;
|
using ResultFieldType = typename ResultType::field_type;
|
||||||
using ResultFieldValueType = typename Opm::MathToolbox<ResultFieldType>::ValueType;
|
using ResultFieldValueType = typename MathToolbox<ResultFieldType>::ValueType;
|
||||||
|
|
||||||
VelocityCallback(const ElementContext& elemCtx)
|
VelocityCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -382,11 +382,11 @@ class VelocityComponentCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
VelocityComponentCallback(const ElementContext& elemCtx)
|
VelocityComponentCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{ Opm::Valgrind::SetUndefined(dimIdx_); }
|
{ Valgrind::SetUndefined(dimIdx_); }
|
||||||
|
|
||||||
VelocityComponentCallback(const ElementContext& elemCtx, unsigned dimIdx)
|
VelocityComponentCallback(const ElementContext& elemCtx, unsigned dimIdx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
@ -406,7 +406,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(dimIdx_);
|
Valgrind::CheckDefined(dimIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).velocityCenter()[dimIdx_];
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).velocityCenter()[dimIdx_];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -431,13 +431,13 @@ class MoleFractionCallback
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
using ResultType = typename std::remove_const<typename std::remove_reference<ResultRawType>::type>::type;
|
||||||
using ResultValueType = typename Opm::MathToolbox<ResultType>::ValueType;
|
using ResultValueType = typename MathToolbox<ResultType>::ValueType;
|
||||||
|
|
||||||
MoleFractionCallback(const ElementContext& elemCtx)
|
MoleFractionCallback(const ElementContext& elemCtx)
|
||||||
: elemCtx_(elemCtx)
|
: elemCtx_(elemCtx)
|
||||||
{
|
{
|
||||||
Opm::Valgrind::SetUndefined(phaseIdx_);
|
Valgrind::SetUndefined(phaseIdx_);
|
||||||
Opm::Valgrind::SetUndefined(compIdx_);
|
Valgrind::SetUndefined(compIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
MoleFractionCallback(const ElementContext& elemCtx, unsigned phaseIdx, unsigned compIdx)
|
MoleFractionCallback(const ElementContext& elemCtx, unsigned phaseIdx, unsigned compIdx)
|
||||||
@ -466,8 +466,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
ResultType operator()(unsigned dofIdx) const
|
ResultType operator()(unsigned dofIdx) const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(phaseIdx_);
|
Valgrind::CheckDefined(phaseIdx_);
|
||||||
Opm::Valgrind::CheckDefined(compIdx_);
|
Valgrind::CheckDefined(compIdx_);
|
||||||
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().moleFraction(phaseIdx_, compIdx_);
|
return elemCtx_.intensiveQuantities(dofIdx, /*timeIdx=*/0).fluidState().moleFraction(phaseIdx_, compIdx_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ struct AutoDiffLocalLinearizer {};
|
|||||||
// set the properties to be spliced in
|
// set the properties to be spliced in
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct LocalLinearizer<TypeTag, TTag::AutoDiffLocalLinearizer>
|
struct LocalLinearizer<TypeTag, TTag::AutoDiffLocalLinearizer>
|
||||||
{ using type = Opm::FvBaseAdLocalLinearizer<TypeTag>; };
|
{ using type = FvBaseAdLocalLinearizer<TypeTag>; };
|
||||||
|
|
||||||
//! Set the function evaluation w.r.t. the primary variables
|
//! Set the function evaluation w.r.t. the primary variables
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -69,7 +69,7 @@ private:
|
|||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using type = Opm::DenseAd::Evaluation<Scalar, numEq>;
|
using type = DenseAd::Evaluation<Scalar, numEq>;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
@ -286,7 +286,7 @@ protected:
|
|||||||
// with regard to the focus variable 'pvIdx' of the degree of freedom
|
// with regard to the focus variable 'pvIdx' of the degree of freedom
|
||||||
// 'focusDofIdx'
|
// 'focusDofIdx'
|
||||||
jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = resid[dofIdx][eqIdx].derivative(pvIdx);
|
jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = resid[dofIdx][eqIdx].derivative(pvIdx);
|
||||||
Opm::Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]);
|
Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ namespace Opm::Properties {
|
|||||||
|
|
||||||
//! Set the default type for the time manager
|
//! Set the default type for the time manager
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Simulator<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::Simulator<TypeTag>; };
|
struct Simulator<TypeTag, TTag::FvBaseDiscretization> { using type = ::Opm::Simulator<TypeTag>; };
|
||||||
|
|
||||||
//! Mapper for the grid view's vertices.
|
//! Mapper for the grid view's vertices.
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -109,20 +109,20 @@ struct BorderListCreator<TypeTag, TTag::FvBaseDiscretization>
|
|||||||
using DofMapper = GetPropType<TypeTag, Properties::DofMapper>;
|
using DofMapper = GetPropType<TypeTag, Properties::DofMapper>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
public:
|
public:
|
||||||
using type = Opm::Linear::NullBorderListCreator<GridView, DofMapper>;
|
using type = Linear::NullBorderListCreator<GridView, DofMapper>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct DiscLocalResidual<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseLocalResidual<TypeTag>; };
|
struct DiscLocalResidual<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseLocalResidual<TypeTag>; };
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct DiscIntensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseIntensiveQuantities<TypeTag>; };
|
struct DiscIntensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseIntensiveQuantities<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct DiscExtensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseExtensiveQuantities<TypeTag>; };
|
struct DiscExtensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseExtensiveQuantities<TypeTag>; };
|
||||||
|
|
||||||
//! Calculates the gradient of any quantity given the index of a flux approximation point
|
//! Calculates the gradient of any quantity given the index of a flux approximation point
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct GradientCalculator<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseGradientCalculator<TypeTag>; };
|
struct GradientCalculator<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseGradientCalculator<TypeTag>; };
|
||||||
|
|
||||||
//! The maximum allowed number of timestep divisions for the
|
//! The maximum allowed number of timestep divisions for the
|
||||||
//! Newton solver
|
//! Newton solver
|
||||||
@ -164,7 +164,7 @@ struct BoundaryRateVector<TypeTag, TTag::FvBaseDiscretization>
|
|||||||
* \brief The class which represents constraints.
|
* \brief The class which represents constraints.
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Constraints<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseConstraints<TypeTag>; };
|
struct Constraints<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseConstraints<TypeTag>; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The type for storing a residual for an element.
|
* \brief The type for storing a residual for an element.
|
||||||
@ -184,7 +184,7 @@ struct GlobalEqVector<TypeTag, TTag::FvBaseDiscretization>
|
|||||||
* \brief An object representing a local set of primary variables.
|
* \brief An object representing a local set of primary variables.
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct PrimaryVariables<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBasePrimaryVariables<TypeTag>; };
|
struct PrimaryVariables<TypeTag, TTag::FvBaseDiscretization> { using type = FvBasePrimaryVariables<TypeTag>; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The type of a solution for the whole grid at a fixed time.
|
* \brief The type of a solution for the whole grid at a fixed time.
|
||||||
@ -199,23 +199,23 @@ struct SolutionVector<TypeTag, TTag::FvBaseDiscretization>
|
|||||||
* This should almost certainly be overloaded by the model...
|
* This should almost certainly be overloaded by the model...
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct IntensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseIntensiveQuantities<TypeTag>; };
|
struct IntensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseIntensiveQuantities<TypeTag>; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The element context
|
* \brief The element context
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ElementContext<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseElementContext<TypeTag>; };
|
struct ElementContext<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseElementContext<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct BoundaryContext<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseBoundaryContext<TypeTag>; };
|
struct BoundaryContext<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseBoundaryContext<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ConstraintsContext<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseConstraintsContext<TypeTag>; };
|
struct ConstraintsContext<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseConstraintsContext<TypeTag>; };
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The OpenMP threads manager
|
* \brief The OpenMP threads manager
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ThreadManager<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::ThreadManager<TypeTag>; };
|
struct ThreadManager<TypeTag, TTag::FvBaseDiscretization> { using type = ::Opm::ThreadManager<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct ThreadsPerProcess<TypeTag, TTag::FvBaseDiscretization> { static constexpr int value = 1; };
|
struct ThreadsPerProcess<TypeTag, TTag::FvBaseDiscretization> { static constexpr int value = 1; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -225,7 +225,7 @@ struct UseLinearizationLock<TypeTag, TTag::FvBaseDiscretization> { static conste
|
|||||||
* \brief Linearizer for the global system of equations.
|
* \brief Linearizer for the global system of equations.
|
||||||
*/
|
*/
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Linearizer<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBaseLinearizer<TypeTag>; };
|
struct Linearizer<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseLinearizer<TypeTag>; };
|
||||||
|
|
||||||
//! use an unlimited time step size by default
|
//! use an unlimited time step size by default
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -370,12 +370,12 @@ class FvBaseDiscretization
|
|||||||
historySize = getPropValue<TypeTag, Properties::TimeDiscHistorySize>(),
|
historySize = getPropValue<TypeTag, Properties::TimeDiscHistorySize>(),
|
||||||
};
|
};
|
||||||
|
|
||||||
using IntensiveQuantitiesVector = std::vector<IntensiveQuantities, Opm::aligned_allocator<IntensiveQuantities, alignof(IntensiveQuantities)> >;
|
using IntensiveQuantitiesVector = std::vector<IntensiveQuantities, aligned_allocator<IntensiveQuantities, alignof(IntensiveQuantities)> >;
|
||||||
|
|
||||||
using Element = typename GridView::template Codim<0>::Entity;
|
using Element = typename GridView::template Codim<0>::Entity;
|
||||||
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using VectorBlock = Dune::FieldVector<Evaluation, numEq>;
|
using VectorBlock = Dune::FieldVector<Evaluation, numEq>;
|
||||||
using EvalEqVector = Dune::FieldVector<Evaluation, numEq>;
|
using EvalEqVector = Dune::FieldVector<Evaluation, numEq>;
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ public:
|
|||||||
NewtonMethod::registerParameters();
|
NewtonMethod::registerParameters();
|
||||||
|
|
||||||
// register runtime parameters of the output modules
|
// register runtime parameters of the output modules
|
||||||
Opm::VtkPrimaryVarsModule<TypeTag>::registerParameters();
|
VtkPrimaryVarsModule<TypeTag>::registerParameters();
|
||||||
|
|
||||||
EWOMS_REGISTER_PARAM(TypeTag, bool, EnableGridAdaptation, "Enable adaptive grid refinement/coarsening");
|
EWOMS_REGISTER_PARAM(TypeTag, bool, EnableGridAdaptation, "Enable adaptive grid refinement/coarsening");
|
||||||
EWOMS_REGISTER_PARAM(TypeTag, bool, EnableVtkOutput, "Global switch for turning on writing VTK files");
|
EWOMS_REGISTER_PARAM(TypeTag, bool, EnableVtkOutput, "Global switch for turning on writing VTK files");
|
||||||
@ -1050,7 +1050,7 @@ public:
|
|||||||
boundaryCtx,
|
boundaryCtx,
|
||||||
faceIdx,
|
faceIdx,
|
||||||
/*timeIdx=*/0);
|
/*timeIdx=*/0);
|
||||||
Opm::Valgrind::CheckDefined(values);
|
Valgrind::CheckDefined(values);
|
||||||
|
|
||||||
unsigned dofIdx = boundaryCtx.interiorScvIndex(faceIdx, /*timeIdx=*/0);
|
unsigned dofIdx = boundaryCtx.interiorScvIndex(faceIdx, /*timeIdx=*/0);
|
||||||
const auto& insideIntQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
const auto& insideIntQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
||||||
@ -1075,7 +1075,7 @@ public:
|
|||||||
elemCtx,
|
elemCtx,
|
||||||
dofIdx,
|
dofIdx,
|
||||||
/*timeIdx=*/0);
|
/*timeIdx=*/0);
|
||||||
Opm::Valgrind::CheckDefined(values);
|
Valgrind::CheckDefined(values);
|
||||||
|
|
||||||
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
||||||
Scalar dofVolume =
|
Scalar dofVolume =
|
||||||
@ -1257,7 +1257,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool update()
|
bool update()
|
||||||
{
|
{
|
||||||
Opm::TimerGuard prePostProcessGuard(prePostProcessTimer_);
|
TimerGuard prePostProcessGuard(prePostProcessTimer_);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned timeIdx = 0; timeIdx < historySize; ++timeIdx) {
|
for (unsigned timeIdx = 0; timeIdx < historySize; ++timeIdx) {
|
||||||
@ -1859,16 +1859,16 @@ public:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const Opm::Timer& prePostProcessTimer() const
|
const Timer& prePostProcessTimer() const
|
||||||
{ return prePostProcessTimer_; }
|
{ return prePostProcessTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& linearizeTimer() const
|
const Timer& linearizeTimer() const
|
||||||
{ return linearizeTimer_; }
|
{ return linearizeTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& solveTimer() const
|
const Timer& solveTimer() const
|
||||||
{ return solveTimer_; }
|
{ return solveTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& updateTimer() const
|
const Timer& updateTimer() const
|
||||||
{ return updateTimer_; }
|
{ return updateTimer_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1909,7 +1909,7 @@ protected:
|
|||||||
void registerOutputModules_()
|
void registerOutputModules_()
|
||||||
{
|
{
|
||||||
// add the output modules available on all model
|
// add the output modules available on all model
|
||||||
auto *mod = new Opm::VtkPrimaryVarsModule<TypeTag>(simulator_);
|
auto *mod = new VtkPrimaryVarsModule<TypeTag>(simulator_);
|
||||||
this->outputModules_.push_back(mod);
|
this->outputModules_.push_back(mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1946,10 +1946,10 @@ protected:
|
|||||||
|
|
||||||
NewtonMethod newtonMethod_;
|
NewtonMethod newtonMethod_;
|
||||||
|
|
||||||
Opm::Timer prePostProcessTimer_;
|
Timer prePostProcessTimer_;
|
||||||
Opm::Timer linearizeTimer_;
|
Timer linearizeTimer_;
|
||||||
Opm::Timer solveTimer_;
|
Timer solveTimer_;
|
||||||
Opm::Timer updateTimer_;
|
Timer updateTimer_;
|
||||||
|
|
||||||
// calculates the local jacobian matrix for a given element
|
// calculates the local jacobian matrix for a given element
|
||||||
std::vector<LocalLinearizer> localLinearizer_;
|
std::vector<LocalLinearizer> localLinearizer_;
|
||||||
|
@ -103,10 +103,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *operator new(size_t size)
|
static void *operator new(size_t size)
|
||||||
{ return Opm::aligned_alloc(alignof(FvBaseElementContext), size); }
|
{ return aligned_alloc(alignof(FvBaseElementContext), size); }
|
||||||
|
|
||||||
static void operator delete(void *ptr)
|
static void operator delete(void *ptr)
|
||||||
{ Opm::aligned_free(ptr); }
|
{ aligned_free(ptr); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Construct all volume and extensive quantities of an element
|
* \brief Construct all volume and extensive quantities of an element
|
||||||
@ -597,8 +597,8 @@ protected:
|
|||||||
|
|
||||||
GradientCalculator gradientCalculator_;
|
GradientCalculator gradientCalculator_;
|
||||||
|
|
||||||
std::vector<DofStore_, Opm::aligned_allocator<DofStore_, alignof(DofStore_)> > dofVars_;
|
std::vector<DofStore_, aligned_allocator<DofStore_, alignof(DofStore_)> > dofVars_;
|
||||||
std::vector<ExtensiveQuantities, Opm::aligned_allocator<ExtensiveQuantities, alignof(ExtensiveQuantities)> > extensiveQuantities_;
|
std::vector<ExtensiveQuantities, aligned_allocator<ExtensiveQuantities, alignof(ExtensiveQuantities)> > extensiveQuantities_;
|
||||||
|
|
||||||
const Simulator *simulatorPtr_;
|
const Simulator *simulatorPtr_;
|
||||||
const Element *elemPtr_;
|
const Element *elemPtr_;
|
||||||
|
@ -73,7 +73,7 @@ public:
|
|||||||
extrusionFactor_ =
|
extrusionFactor_ =
|
||||||
(elemCtx.intensiveQuantities(interiorScvIdx_, timeIdx).extrusionFactor()
|
(elemCtx.intensiveQuantities(interiorScvIdx_, timeIdx).extrusionFactor()
|
||||||
+ elemCtx.intensiveQuantities(exteriorScvIdx_, timeIdx).extrusionFactor()) / 2;
|
+ elemCtx.intensiveQuantities(exteriorScvIdx_, timeIdx).extrusionFactor()) / 2;
|
||||||
Opm::Valgrind::CheckDefined(extrusionFactor_);
|
Valgrind::CheckDefined(extrusionFactor_);
|
||||||
assert(extrusionFactor_ > 0);
|
assert(extrusionFactor_ > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ public:
|
|||||||
exteriorScvIdx_ = static_cast<unsigned short>(dofIdx);
|
exteriorScvIdx_ = static_cast<unsigned short>(dofIdx);
|
||||||
|
|
||||||
extrusionFactor_ = context.intensiveQuantities(bfIdx, timeIdx).extrusionFactor();
|
extrusionFactor_ = context.intensiveQuantities(bfIdx, timeIdx).extrusionFactor();
|
||||||
Opm::Valgrind::CheckDefined(extrusionFactor_);
|
Valgrind::CheckDefined(extrusionFactor_);
|
||||||
assert(extrusionFactor_ > 0);
|
assert(extrusionFactor_ > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ struct BaseEpsilon { using type = UndefinedProperty; };
|
|||||||
// set the properties to be spliced in
|
// set the properties to be spliced in
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct LocalLinearizer<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
|
struct LocalLinearizer<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
|
||||||
{ using type = Opm::FvBaseFdLocalLinearizer<TypeTag>; };
|
{ using type = FvBaseFdLocalLinearizer<TypeTag>; };
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Evaluation<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
|
struct Evaluation<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
|
||||||
@ -282,7 +282,7 @@ public:
|
|||||||
unsigned globalIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
unsigned globalIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
||||||
Scalar pvWeight = elemCtx.model().primaryVarWeight(globalIdx, pvIdx);
|
Scalar pvWeight = elemCtx.model().primaryVarWeight(globalIdx, pvIdx);
|
||||||
assert(pvWeight > 0 && std::isfinite(pvWeight));
|
assert(pvWeight > 0 && std::isfinite(pvWeight));
|
||||||
Opm::Valgrind::CheckDefined(pvWeight);
|
Valgrind::CheckDefined(pvWeight);
|
||||||
|
|
||||||
return baseEpsilon()/pvWeight;
|
return baseEpsilon()/pvWeight;
|
||||||
}
|
}
|
||||||
@ -476,7 +476,7 @@ protected:
|
|||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned i = 0; i < derivResidual_.size(); ++i)
|
for (unsigned i = 0; i < derivResidual_.size(); ++i)
|
||||||
Opm::Valgrind::CheckDefined(derivResidual_[i]);
|
Valgrind::CheckDefined(derivResidual_[i]);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ protected:
|
|||||||
// regard to the primary variable 'pvIdx' of the degree of freedom
|
// regard to the primary variable 'pvIdx' of the degree of freedom
|
||||||
// 'focusDofIdx'
|
// 'focusDofIdx'
|
||||||
jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = derivResidual_[dofIdx][eqIdx];
|
jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx] = derivResidual_[dofIdx][eqIdx];
|
||||||
Opm::Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]);
|
Valgrind::CheckDefined(jacobian_[dofIdx][focusDofIdx][eqIdx][pvIdx]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,12 +116,12 @@ public:
|
|||||||
if (i == focusDofIdx)
|
if (i == focusDofIdx)
|
||||||
value = quantityCallback(i)*interiorDistance;
|
value = quantityCallback(i)*interiorDistance;
|
||||||
else
|
else
|
||||||
value = Opm::getValue(quantityCallback(i))*interiorDistance;
|
value = getValue(quantityCallback(i))*interiorDistance;
|
||||||
|
|
||||||
if (j == focusDofIdx)
|
if (j == focusDofIdx)
|
||||||
value += quantityCallback(j)*exteriorDistance;
|
value += quantityCallback(j)*exteriorDistance;
|
||||||
else
|
else
|
||||||
value += Opm::getValue(quantityCallback(j))*exteriorDistance;
|
value += getValue(quantityCallback(j))*exteriorDistance;
|
||||||
|
|
||||||
value /= interiorDistance + exteriorDistance;
|
value /= interiorDistance + exteriorDistance;
|
||||||
|
|
||||||
@ -165,9 +165,9 @@ public:
|
|||||||
value[k] *= interiorDistance;
|
value[k] *= interiorDistance;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const auto& dofVal = Opm::getValue(quantityCallback(i));
|
const auto& dofVal = getValue(quantityCallback(i));
|
||||||
for (int k = 0; k < dofVal.size(); ++k)
|
for (int k = 0; k < dofVal.size(); ++k)
|
||||||
value[k] = Opm::getValue(dofVal[k])*interiorDistance;
|
value[k] = getValue(dofVal[k])*interiorDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == focusDofIdx) {
|
if (j == focusDofIdx) {
|
||||||
@ -178,7 +178,7 @@ public:
|
|||||||
else {
|
else {
|
||||||
const auto& dofVal = quantityCallback(j);
|
const auto& dofVal = quantityCallback(j);
|
||||||
for (int k = 0; k < dofVal.size(); ++k)
|
for (int k = 0; k < dofVal.size(); ++k)
|
||||||
value[k] += Opm::getValue(dofVal[k])*exteriorDistance;
|
value[k] += getValue(dofVal[k])*exteriorDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
Scalar totDistance = interiorDistance + exteriorDistance;
|
Scalar totDistance = interiorDistance + exteriorDistance;
|
||||||
@ -218,18 +218,18 @@ public:
|
|||||||
Evaluation deltay;
|
Evaluation deltay;
|
||||||
if (i == focusIdx) {
|
if (i == focusIdx) {
|
||||||
deltay =
|
deltay =
|
||||||
Opm::getValue(quantityCallback(j))
|
getValue(quantityCallback(j))
|
||||||
- quantityCallback(i);
|
- quantityCallback(i);
|
||||||
}
|
}
|
||||||
else if (j == focusIdx) {
|
else if (j == focusIdx) {
|
||||||
deltay =
|
deltay =
|
||||||
quantityCallback(j)
|
quantityCallback(j)
|
||||||
- Opm::getValue(quantityCallback(i));
|
- getValue(quantityCallback(i));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
deltay =
|
deltay =
|
||||||
Opm::getValue(quantityCallback(j))
|
getValue(quantityCallback(j))
|
||||||
- Opm::getValue(quantityCallback(i));
|
- getValue(quantityCallback(i));
|
||||||
|
|
||||||
Scalar distSquared = 0.0;
|
Scalar distSquared = 0.0;
|
||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
|
||||||
@ -296,8 +296,8 @@ public:
|
|||||||
deltay = quantityCallback.boundaryValue() - quantityCallback(face.interiorIndex());
|
deltay = quantityCallback.boundaryValue() - quantityCallback(face.interiorIndex());
|
||||||
else
|
else
|
||||||
deltay =
|
deltay =
|
||||||
Opm::getValue(quantityCallback.boundaryValue())
|
getValue(quantityCallback.boundaryValue())
|
||||||
- Opm::getValue(quantityCallback(face.interiorIndex()));
|
- getValue(quantityCallback(face.interiorIndex()));
|
||||||
|
|
||||||
const auto& boundaryFacePos = face.integrationPos();
|
const auto& boundaryFacePos = face.integrationPos();
|
||||||
const auto& interiorPos = stencil.subControlVolume(face.interiorIndex()).center();
|
const auto& interiorPos = stencil.subControlVolume(face.interiorIndex()).center();
|
||||||
|
@ -89,7 +89,7 @@ class FvBaseLinearizer
|
|||||||
|
|
||||||
using GridCommHandleFactory = GetPropType<TypeTag, Properties::GridCommHandleFactory>;
|
using GridCommHandleFactory = GetPropType<TypeTag, Properties::GridCommHandleFactory>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using Element = typename GridView::template Codim<0>::Entity;
|
using Element = typename GridView::template Codim<0>::Entity;
|
||||||
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
using ElementIterator = typename GridView::template Codim<0>::Iterator;
|
||||||
@ -219,7 +219,7 @@ public:
|
|||||||
succeeded = gridView_().comm().min(succeeded);
|
succeeded = gridView_().comm().min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("A process did not succeed in linearizing the system");
|
throw NumericalIssue("A process did not succeed in linearizing the system");
|
||||||
}
|
}
|
||||||
|
|
||||||
void finalize()
|
void finalize()
|
||||||
@ -252,7 +252,7 @@ public:
|
|||||||
succeeded = comm.min(succeeded);
|
succeeded = comm.min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("linearization of an auxilary equation failed");
|
throw NumericalIssue("linearization of an auxilary equation failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ private:
|
|||||||
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
||||||
enum { extensiveStorageTerm = getPropValue<TypeTag, Properties::ExtensiveStorageTerm>() };
|
enum { extensiveStorageTerm = getPropValue<TypeTag, Properties::ExtensiveStorageTerm>() };
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using EvalVector = Dune::FieldVector<Evaluation, numEq>;
|
using EvalVector = Dune::FieldVector<Evaluation, numEq>;
|
||||||
|
|
||||||
// copying the local residual class is not a good idea
|
// copying the local residual class is not a good idea
|
||||||
@ -86,7 +86,7 @@ private:
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using LocalEvalBlockVector = Dune::BlockVector<EvalVector, Opm::aligned_allocator<EvalVector, alignof(EvalVector)> >;
|
using LocalEvalBlockVector = Dune::BlockVector<EvalVector, aligned_allocator<EvalVector, alignof(EvalVector)> >;
|
||||||
|
|
||||||
FvBaseLocalResidual()
|
FvBaseLocalResidual()
|
||||||
{ }
|
{ }
|
||||||
@ -182,7 +182,7 @@ public:
|
|||||||
Scalar dofVolume = elemCtx.dofTotalVolume(dofIdx, /*timeIdx=*/0);
|
Scalar dofVolume = elemCtx.dofTotalVolume(dofIdx, /*timeIdx=*/0);
|
||||||
|
|
||||||
assert(std::isfinite(dofVolume));
|
assert(std::isfinite(dofVolume));
|
||||||
Opm::Valgrind::CheckDefined(dofVolume);
|
Valgrind::CheckDefined(dofVolume);
|
||||||
|
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
||||||
residual[dofIdx][eqIdx] /= dofVolume;
|
residual[dofIdx][eqIdx] /= dofVolume;
|
||||||
@ -283,8 +283,8 @@ public:
|
|||||||
size_t numPrimaryDof = elemCtx.numPrimaryDof(/*timeIdx=*/0);
|
size_t numPrimaryDof = elemCtx.numPrimaryDof(/*timeIdx=*/0);
|
||||||
for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) {
|
for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) {
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
||||||
Opm::Valgrind::CheckDefined(storage[dofIdx][eqIdx]);
|
Valgrind::CheckDefined(storage[dofIdx][eqIdx]);
|
||||||
assert(Opm::isfinite(storage[dofIdx][eqIdx]));
|
assert(isfinite(storage[dofIdx][eqIdx]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -311,19 +311,19 @@ public:
|
|||||||
unsigned i = face.interiorIndex();
|
unsigned i = face.interiorIndex();
|
||||||
unsigned j = face.exteriorIndex();
|
unsigned j = face.exteriorIndex();
|
||||||
|
|
||||||
Opm::Valgrind::SetUndefined(flux);
|
Valgrind::SetUndefined(flux);
|
||||||
asImp_().computeFlux(flux, /*context=*/elemCtx, scvfIdx, timeIdx);
|
asImp_().computeFlux(flux, /*context=*/elemCtx, scvfIdx, timeIdx);
|
||||||
Opm::Valgrind::CheckDefined(flux);
|
Valgrind::CheckDefined(flux);
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
||||||
assert(Opm::isfinite(flux[eqIdx]));
|
assert(isfinite(flux[eqIdx]));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Scalar alpha = elemCtx.extensiveQuantities(scvfIdx, timeIdx).extrusionFactor();
|
Scalar alpha = elemCtx.extensiveQuantities(scvfIdx, timeIdx).extrusionFactor();
|
||||||
alpha *= face.area();
|
alpha *= face.area();
|
||||||
Opm::Valgrind::CheckDefined(alpha);
|
Valgrind::CheckDefined(alpha);
|
||||||
assert(alpha > 0.0);
|
assert(alpha > 0.0);
|
||||||
assert(Opm::isfinite(alpha));
|
assert(isfinite(alpha));
|
||||||
|
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
|
||||||
flux[eqIdx] *= alpha;
|
flux[eqIdx] *= alpha;
|
||||||
@ -342,7 +342,7 @@ public:
|
|||||||
// volume i and into sub-control volume j, we need to add the flux to finite
|
// volume i and into sub-control volume j, we need to add the flux to finite
|
||||||
// volume i and subtract it from finite volume j
|
// volume i and subtract it from finite volume j
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
||||||
assert(Opm::isfinite(flux[eqIdx]));
|
assert(isfinite(flux[eqIdx]));
|
||||||
residual[i][eqIdx] += flux[eqIdx];
|
residual[i][eqIdx] += flux[eqIdx];
|
||||||
residual[j][eqIdx] -= flux[eqIdx];
|
residual[j][eqIdx] -= flux[eqIdx];
|
||||||
}
|
}
|
||||||
@ -353,8 +353,8 @@ public:
|
|||||||
size_t numDof = elemCtx.numDof(timeIdx);
|
size_t numDof = elemCtx.numDof(timeIdx);
|
||||||
for (unsigned i=0; i < numDof; i++) {
|
for (unsigned i=0; i < numDof; i++) {
|
||||||
for (unsigned j = 0; j < numEq; ++ j) {
|
for (unsigned j = 0; j < numEq; ++ j) {
|
||||||
assert(Opm::isfinite(residual[i][j]));
|
assert(isfinite(residual[i][j]));
|
||||||
Opm::Valgrind::CheckDefined(residual[i][j]);
|
Valgrind::CheckDefined(residual[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -445,8 +445,8 @@ protected:
|
|||||||
size_t numDof = elemCtx.numDof(/*timeIdx=*/0);
|
size_t numDof = elemCtx.numDof(/*timeIdx=*/0);
|
||||||
for (unsigned i=0; i < numDof; i++) {
|
for (unsigned i=0; i < numDof; i++) {
|
||||||
for (unsigned j = 0; j < numEq; ++ j) {
|
for (unsigned j = 0; j < numEq; ++ j) {
|
||||||
assert(Opm::isfinite(residual[i][j]));
|
assert(isfinite(residual[i][j]));
|
||||||
Opm::Valgrind::CheckDefined(residual[i][j]);
|
Valgrind::CheckDefined(residual[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -464,9 +464,9 @@ protected:
|
|||||||
{
|
{
|
||||||
BoundaryRateVector values;
|
BoundaryRateVector values;
|
||||||
|
|
||||||
Opm::Valgrind::SetUndefined(values);
|
Valgrind::SetUndefined(values);
|
||||||
boundaryCtx.problem().boundary(values, boundaryCtx, boundaryFaceIdx, timeIdx);
|
boundaryCtx.problem().boundary(values, boundaryCtx, boundaryFaceIdx, timeIdx);
|
||||||
Opm::Valgrind::CheckDefined(values);
|
Valgrind::CheckDefined(values);
|
||||||
|
|
||||||
const auto& stencil = boundaryCtx.stencil(timeIdx);
|
const auto& stencil = boundaryCtx.stencil(timeIdx);
|
||||||
unsigned dofIdx = stencil.boundaryFace(boundaryFaceIdx).interiorIndex();
|
unsigned dofIdx = stencil.boundaryFace(boundaryFaceIdx).interiorIndex();
|
||||||
@ -476,8 +476,8 @@ protected:
|
|||||||
stencil.boundaryFace(boundaryFaceIdx).area()
|
stencil.boundaryFace(boundaryFaceIdx).area()
|
||||||
* insideIntQuants.extrusionFactor();
|
* insideIntQuants.extrusionFactor();
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(values[eqIdx]);
|
Valgrind::CheckDefined(values[eqIdx]);
|
||||||
assert(Opm::isfinite(values[eqIdx]));
|
assert(isfinite(values[eqIdx]));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
||||||
@ -504,13 +504,13 @@ protected:
|
|||||||
for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) {
|
for (unsigned dofIdx=0; dofIdx < numPrimaryDof; dofIdx++) {
|
||||||
Scalar extrusionFactor =
|
Scalar extrusionFactor =
|
||||||
elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0).extrusionFactor();
|
elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0).extrusionFactor();
|
||||||
Opm::Valgrind::CheckDefined(extrusionFactor);
|
Valgrind::CheckDefined(extrusionFactor);
|
||||||
assert(Opm::isfinite(extrusionFactor));
|
assert(isfinite(extrusionFactor));
|
||||||
assert(extrusionFactor > 0.0);
|
assert(extrusionFactor > 0.0);
|
||||||
Scalar scvVolume =
|
Scalar scvVolume =
|
||||||
elemCtx.stencil(/*timeIdx=*/0).subControlVolume(dofIdx).volume() * extrusionFactor;
|
elemCtx.stencil(/*timeIdx=*/0).subControlVolume(dofIdx).volume() * extrusionFactor;
|
||||||
Opm::Valgrind::CheckDefined(scvVolume);
|
Valgrind::CheckDefined(scvVolume);
|
||||||
assert(Opm::isfinite(scvVolume));
|
assert(isfinite(scvVolume));
|
||||||
assert(scvVolume > 0.0);
|
assert(scvVolume > 0.0);
|
||||||
|
|
||||||
// if the model uses extensive quantities in its storage term, and we use
|
// if the model uses extensive quantities in its storage term, and we use
|
||||||
@ -528,9 +528,9 @@ protected:
|
|||||||
asImp_().computeStorage(tmp, elemCtx, dofIdx, /*timeIdx=*/0);
|
asImp_().computeStorage(tmp, elemCtx, dofIdx, /*timeIdx=*/0);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
Opm::Valgrind::CheckDefined(tmp);
|
Valgrind::CheckDefined(tmp);
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
||||||
assert(Opm::isfinite(tmp[eqIdx]));
|
assert(isfinite(tmp[eqIdx]));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (elemCtx.enableStorageCache()) {
|
if (elemCtx.enableStorageCache()) {
|
||||||
@ -559,7 +559,7 @@ protected:
|
|||||||
tmp2[eqIdx] = Toolbox::value(tmp[eqIdx]);
|
tmp2[eqIdx] = Toolbox::value(tmp[eqIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(tmp2);
|
Valgrind::CheckDefined(tmp2);
|
||||||
|
|
||||||
model.updateCachedStorage(globalDofIdx, /*timeIdx=*/1, tmp2);
|
model.updateCachedStorage(globalDofIdx, /*timeIdx=*/1, tmp2);
|
||||||
}
|
}
|
||||||
@ -568,7 +568,7 @@ protected:
|
|||||||
// if the storage term is cached and we're not looking at the first
|
// if the storage term is cached and we're not looking at the first
|
||||||
// iteration of the time step, we take the cached data.
|
// iteration of the time step, we take the cached data.
|
||||||
tmp2 = model.cachedStorage(globalDofIdx, /*timeIdx=*/1);
|
tmp2 = model.cachedStorage(globalDofIdx, /*timeIdx=*/1);
|
||||||
Opm::Valgrind::CheckDefined(tmp2);
|
Valgrind::CheckDefined(tmp2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -576,7 +576,7 @@ protected:
|
|||||||
// we re-calculate it from scratch.
|
// we re-calculate it from scratch.
|
||||||
tmp2 = 0.0;
|
tmp2 = 0.0;
|
||||||
asImp_().computeStorage(tmp2, elemCtx, dofIdx, /*timeIdx=*/1);
|
asImp_().computeStorage(tmp2, elemCtx, dofIdx, /*timeIdx=*/1);
|
||||||
Opm::Valgrind::CheckDefined(tmp2);
|
Valgrind::CheckDefined(tmp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the implicit Euler time discretization
|
// Use the implicit Euler time discretization
|
||||||
@ -589,7 +589,7 @@ protected:
|
|||||||
residual[dofIdx][eqIdx] += tmp[eqIdx];
|
residual[dofIdx][eqIdx] += tmp[eqIdx];
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(residual[dofIdx]);
|
Valgrind::CheckDefined(residual[dofIdx]);
|
||||||
|
|
||||||
// deal with the source term
|
// deal with the source term
|
||||||
asImp_().computeSource(sourceRate, elemCtx, dofIdx, /*timeIdx=*/0);
|
asImp_().computeSource(sourceRate, elemCtx, dofIdx, /*timeIdx=*/0);
|
||||||
@ -602,7 +602,7 @@ protected:
|
|||||||
dofIdx != elemCtx.focusDofIndex())
|
dofIdx != elemCtx.focusDofIndex())
|
||||||
{
|
{
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx)
|
||||||
residual[dofIdx][eqIdx] -= Opm::scalarValue(sourceRate[eqIdx])*scvVolume;
|
residual[dofIdx][eqIdx] -= scalarValue(sourceRate[eqIdx])*scvVolume;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
for (unsigned eqIdx = 0; eqIdx < numEq; ++eqIdx) {
|
||||||
@ -611,7 +611,7 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::Valgrind::CheckDefined(residual[dofIdx]);
|
Valgrind::CheckDefined(residual[dofIdx]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined NDEBUG
|
#if !defined NDEBUG
|
||||||
@ -619,8 +619,8 @@ protected:
|
|||||||
size_t numDof = elemCtx.numDof(/*timeIdx=*/0);
|
size_t numDof = elemCtx.numDof(/*timeIdx=*/0);
|
||||||
for (unsigned i=0; i < numDof; i++) {
|
for (unsigned i=0; i < numDof; i++) {
|
||||||
for (unsigned j = 0; j < numEq; ++ j) {
|
for (unsigned j = 0; j < numEq; ++ j) {
|
||||||
assert(Opm::isfinite(residual[i][j]));
|
assert(isfinite(residual[i][j]));
|
||||||
Opm::Valgrind::CheckDefined(residual[i][j]);
|
Valgrind::CheckDefined(residual[i][j]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,7 +66,7 @@ class FvBaseNewtonConvergenceWriter
|
|||||||
using NewtonMethod = GetPropType<TypeTag, Properties::NewtonMethod>;
|
using NewtonMethod = GetPropType<TypeTag, Properties::NewtonMethod>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FvBaseNewtonConvergenceWriter(NewtonMethod& nm)
|
FvBaseNewtonConvergenceWriter(NewtonMethod& nm)
|
||||||
|
@ -57,7 +57,7 @@ struct DiscNewtonMethod { using type = UndefinedProperty; };
|
|||||||
// set default values
|
// set default values
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct DiscNewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
|
struct DiscNewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
|
||||||
{ using type = Opm::FvBaseNewtonMethod<TypeTag>; };
|
{ using type = FvBaseNewtonMethod<TypeTag>; };
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
|
struct NewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
|
||||||
@ -65,7 +65,7 @@ struct NewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
|
|||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonConvergenceWriter<TypeTag, TTag::FvBaseNewtonMethod>
|
struct NewtonConvergenceWriter<TypeTag, TTag::FvBaseNewtonMethod>
|
||||||
{ using type = Opm::FvBaseNewtonConvergenceWriter<TypeTag>; };
|
{ using type = FvBaseNewtonConvergenceWriter<TypeTag>; };
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
@ -82,14 +82,13 @@ namespace Opm {
|
|||||||
template <class TypeTag>
|
template <class TypeTag>
|
||||||
class FvBaseNewtonMethod : public NewtonMethod<TypeTag>
|
class FvBaseNewtonMethod : public NewtonMethod<TypeTag>
|
||||||
{
|
{
|
||||||
using ParentType = Opm::NewtonMethod<TypeTag>;
|
using ParentType = NewtonMethod<TypeTag>;
|
||||||
using Implementation = GetPropType<TypeTag, Properties::NewtonMethod>;
|
using Implementation = GetPropType<TypeTag, Properties::NewtonMethod>;
|
||||||
|
|
||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||||
using Model = GetPropType<TypeTag, Properties::Model>;
|
using Model = GetPropType<TypeTag, Properties::Model>;
|
||||||
using Linearizer = GetPropType<TypeTag, Properties::Linearizer>;
|
using Linearizer = GetPropType<TypeTag, Properties::Linearizer>;
|
||||||
using NewtonMethod = GetPropType<TypeTag, Properties::NewtonMethod>;
|
|
||||||
using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>;
|
using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>;
|
||||||
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
|
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
|
||||||
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
|
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
|
||||||
@ -102,7 +101,7 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Opm::NewtonMethod<TypeTag>;
|
friend class NewtonMethod<TypeTag>;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Update the current solution with a delta vector.
|
* \brief Update the current solution with a delta vector.
|
||||||
|
@ -55,13 +55,13 @@ class FvBasePrimaryVariables
|
|||||||
|
|
||||||
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
using ParentType = Dune::FieldVector<Scalar, numEq>;
|
using ParentType = Dune::FieldVector<Scalar, numEq>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FvBasePrimaryVariables()
|
FvBasePrimaryVariables()
|
||||||
: ParentType()
|
: ParentType()
|
||||||
{ Opm::Valgrind::SetUndefined(*this); }
|
{ Valgrind::SetUndefined(*this); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Construction from a scalar value
|
* \brief Construction from a scalar value
|
||||||
@ -122,7 +122,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void checkDefined() const
|
void checkDefined() const
|
||||||
{
|
{
|
||||||
Opm::Valgrind::CheckDefined(*static_cast<const ParentType*>(this));
|
Valgrind::CheckDefined(*static_cast<const ParentType*>(this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ private:
|
|||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
|
|
||||||
static const int vtkOutputFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkOutputFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkOutputFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkOutputFormat>;
|
||||||
|
|
||||||
using Model = GetPropType<TypeTag, Properties::Model>;
|
using Model = GetPropType<TypeTag, Properties::Model>;
|
||||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||||
|
@ -169,7 +169,7 @@ public:
|
|||||||
#else
|
#else
|
||||||
using QuantityConstType = typename std::remove_reference<typename QuantityCallback::ResultType>::type;
|
using QuantityConstType = typename std::remove_reference<typename QuantityCallback::ResultType>::type;
|
||||||
using QuantityType = typename std::remove_const<QuantityConstType>::type;
|
using QuantityType = typename std::remove_const<QuantityConstType>::type;
|
||||||
using Toolbox = Opm::MathToolbox<QuantityType>;
|
using Toolbox = MathToolbox<QuantityType>;
|
||||||
|
|
||||||
// If the user does not want to use two-point gradients, we
|
// If the user does not want to use two-point gradients, we
|
||||||
// use P1 finite element gradients..
|
// use P1 finite element gradients..
|
||||||
@ -218,7 +218,7 @@ public:
|
|||||||
using RawFieldType = decltype(std::declval<QuantityType>()[0]);
|
using RawFieldType = decltype(std::declval<QuantityType>()[0]);
|
||||||
using FieldType = typename std::remove_const<typename std::remove_reference<RawFieldType>::type>::type;
|
using FieldType = typename std::remove_const<typename std::remove_reference<RawFieldType>::type>::type;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<FieldType>;
|
using Toolbox = MathToolbox<FieldType>;
|
||||||
|
|
||||||
// If the user does not want to use two-point gradients, we
|
// If the user does not want to use two-point gradients, we
|
||||||
// use P1 finite element gradients..
|
// use P1 finite element gradients..
|
||||||
@ -287,7 +287,7 @@ public:
|
|||||||
const auto& dofVal = quantityCallback(vertIdx);
|
const auto& dofVal = quantityCallback(vertIdx);
|
||||||
const auto& tmp = p1Gradient_[fapIdx][vertIdx];
|
const auto& tmp = p1Gradient_[fapIdx][vertIdx];
|
||||||
for (int dimIdx = 0; dimIdx < dim; ++ dimIdx)
|
for (int dimIdx = 0; dimIdx < dim; ++ dimIdx)
|
||||||
quantityGrad[dimIdx] += Opm::scalarValue(dofVal)*tmp[dimIdx];
|
quantityGrad[dimIdx] += scalarValue(dofVal)*tmp[dimIdx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,7 +61,7 @@ private:
|
|||||||
using CoordScalar = typename GridView::ctype;
|
using CoordScalar = typename GridView::ctype;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using type = Opm::VcfvStencil<CoordScalar, GridView>;
|
using type = VcfvStencil<CoordScalar, GridView>;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Mapper for the degrees of freedoms.
|
//! Mapper for the degrees of freedoms.
|
||||||
@ -70,23 +70,23 @@ struct DofMapper<TypeTag, TTag::VcfvDiscretization> { using type = GetPropType<T
|
|||||||
|
|
||||||
//! The concrete class which manages the spatial discretization
|
//! The concrete class which manages the spatial discretization
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Discretization<TypeTag, TTag::VcfvDiscretization> { using type = Opm::VcfvDiscretization<TypeTag>; };
|
struct Discretization<TypeTag, TTag::VcfvDiscretization> { using type = VcfvDiscretization<TypeTag>; };
|
||||||
|
|
||||||
//! The base class for the output modules (decides whether to write
|
//! The base class for the output modules (decides whether to write
|
||||||
//! element or vertex based fields)
|
//! element or vertex based fields)
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct DiscBaseOutputModule<TypeTag, TTag::VcfvDiscretization>
|
struct DiscBaseOutputModule<TypeTag, TTag::VcfvDiscretization>
|
||||||
{ using type = Opm::VcfvBaseOutputModule<TypeTag>; };
|
{ using type = VcfvBaseOutputModule<TypeTag>; };
|
||||||
|
|
||||||
//! Calculates the gradient of any quantity given the index of a flux approximation point
|
//! Calculates the gradient of any quantity given the index of a flux approximation point
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct GradientCalculator<TypeTag, TTag::VcfvDiscretization>
|
struct GradientCalculator<TypeTag, TTag::VcfvDiscretization>
|
||||||
{ using type = Opm::P1FeGradientCalculator<TypeTag>; };
|
{ using type = P1FeGradientCalculator<TypeTag>; };
|
||||||
|
|
||||||
//! The class to create grid communication handles
|
//! The class to create grid communication handles
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct GridCommHandleFactory<TypeTag, TTag::VcfvDiscretization>
|
struct GridCommHandleFactory<TypeTag, TTag::VcfvDiscretization>
|
||||||
{ using type = Opm::VcfvGridCommHandleFactory<TypeTag>; };
|
{ using type = VcfvGridCommHandleFactory<TypeTag>; };
|
||||||
|
|
||||||
//! Use two-point gradients by default for the vertex centered finite volume scheme.
|
//! Use two-point gradients by default for the vertex centered finite volume scheme.
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -118,7 +118,7 @@ struct BorderListCreator<TypeTag, TTag::VcfvDiscretization>
|
|||||||
using VertexMapper = GetPropType<TypeTag, Properties::VertexMapper>;
|
using VertexMapper = GetPropType<TypeTag, Properties::VertexMapper>;
|
||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
public:
|
public:
|
||||||
using type = Opm::Linear::VertexBorderListFromGrid<GridView, VertexMapper>;
|
using type = Linear::VertexBorderListFromGrid<GridView, VertexMapper>;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! For the vertex centered finite volume method, ghost and overlap elements must _not_
|
//! For the vertex centered finite volume method, ghost and overlap elements must _not_
|
||||||
|
@ -73,7 +73,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/1, ElementType::cube>
|
|||||||
enum { numScv = 2 };
|
enum { numScv = 2 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static void init()
|
static void init()
|
||||||
{
|
{
|
||||||
@ -112,7 +112,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/1, ElementType::simplex>
|
|||||||
enum { numScv = 2 };
|
enum { numScv = 2 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static const ScvLocalGeometry& get(unsigned scvIdx OPM_UNUSED)
|
static const ScvLocalGeometry& get(unsigned scvIdx OPM_UNUSED)
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/2, ElementType::simplex>
|
|||||||
enum { numScv = 3 };
|
enum { numScv = 3 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static const ScvLocalGeometry& get(unsigned scvIdx)
|
static const ScvLocalGeometry& get(unsigned scvIdx)
|
||||||
{ return scvGeoms_[scvIdx]; }
|
{ return scvGeoms_[scvIdx]; }
|
||||||
@ -182,7 +182,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/2, ElementType::cube>
|
|||||||
enum { numScv = 4 };
|
enum { numScv = 4 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static const ScvLocalGeometry& get(unsigned scvIdx)
|
static const ScvLocalGeometry& get(unsigned scvIdx)
|
||||||
{ return scvGeoms_[scvIdx]; }
|
{ return scvGeoms_[scvIdx]; }
|
||||||
@ -243,7 +243,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/3, ElementType::simplex>
|
|||||||
enum { numScv = 4 };
|
enum { numScv = 4 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static const ScvLocalGeometry& get(unsigned scvIdx)
|
static const ScvLocalGeometry& get(unsigned scvIdx)
|
||||||
{ return scvGeoms_[scvIdx]; }
|
{ return scvGeoms_[scvIdx]; }
|
||||||
@ -322,7 +322,7 @@ class VcfvScvGeometries<Scalar, /*dim=*/3, ElementType::cube>
|
|||||||
enum { numScv = 8 };
|
enum { numScv = 8 };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
static const ScvLocalGeometry& get(unsigned scvIdx)
|
static const ScvLocalGeometry& get(unsigned scvIdx)
|
||||||
{ return scvGeoms_[scvIdx]; }
|
{ return scvGeoms_[scvIdx]; }
|
||||||
@ -484,7 +484,7 @@ private:
|
|||||||
using LocalPosition = Dune::FieldVector<CoordScalar,dim>;
|
using LocalPosition = Dune::FieldVector<CoordScalar,dim>;
|
||||||
using IntersectionIterator = typename GridView::IntersectionIterator;
|
using IntersectionIterator = typename GridView::IntersectionIterator;
|
||||||
|
|
||||||
using ScvLocalGeometry = Opm::QuadrialteralQuadratureGeometry<Scalar, dim>;
|
using ScvLocalGeometry = QuadrialteralQuadratureGeometry<Scalar, dim>;
|
||||||
|
|
||||||
#if HAVE_DUNE_LOCALFUNCTIONS
|
#if HAVE_DUNE_LOCALFUNCTIONS
|
||||||
using LocalFiniteElementCache = Dune::PQkLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
|
using LocalFiniteElementCache = Dune::PQkLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
|
||||||
|
@ -89,7 +89,7 @@ class VtkBlackOilEnergyModule : public BaseOutputModule<TypeTag>
|
|||||||
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||||
@ -165,20 +165,20 @@ public:
|
|||||||
|
|
||||||
if (rockInternalEnergyOutput_())
|
if (rockInternalEnergyOutput_())
|
||||||
rockInternalEnergy_[globalDofIdx] =
|
rockInternalEnergy_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.rockInternalEnergy());
|
scalarValue(intQuants.rockInternalEnergy());
|
||||||
|
|
||||||
if (totalThermalConductivityOutput_())
|
if (totalThermalConductivityOutput_())
|
||||||
totalThermalConductivity_[globalDofIdx] =
|
totalThermalConductivity_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.totalThermalConductivity());
|
scalarValue(intQuants.totalThermalConductivity());
|
||||||
|
|
||||||
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) {
|
||||||
if (fluidInternalEnergiesOutput_())
|
if (fluidInternalEnergiesOutput_())
|
||||||
fluidInternalEnergies_[phaseIdx][globalDofIdx] =
|
fluidInternalEnergies_[phaseIdx][globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.fluidState().internalEnergy(phaseIdx));
|
scalarValue(intQuants.fluidState().internalEnergy(phaseIdx));
|
||||||
|
|
||||||
if (fluidEnthalpiesOutput_())
|
if (fluidEnthalpiesOutput_())
|
||||||
fluidEnthalpies_[phaseIdx][globalDofIdx] =
|
fluidEnthalpies_[phaseIdx][globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.fluidState().enthalpy(phaseIdx));
|
scalarValue(intQuants.fluidState().enthalpy(phaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ class VtkBlackOilModule : public BaseOutputModule<TypeTag>
|
|||||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
|
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
|
||||||
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
|
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
|
||||||
@ -225,14 +225,14 @@ public:
|
|||||||
const auto& primaryVars = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0);
|
const auto& primaryVars = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0);
|
||||||
|
|
||||||
unsigned pvtRegionIdx = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0).pvtRegionIndex();
|
unsigned pvtRegionIdx = elemCtx.primaryVars(dofIdx, /*timeIdx=*/0).pvtRegionIndex();
|
||||||
Scalar SoMax = std::max(Opm::getValue(fs.saturation(oilPhaseIdx)),
|
Scalar SoMax = std::max(getValue(fs.saturation(oilPhaseIdx)),
|
||||||
elemCtx.problem().maxOilSaturation(globalDofIdx));
|
elemCtx.problem().maxOilSaturation(globalDofIdx));
|
||||||
|
|
||||||
if (FluidSystem::phaseIsActive(gasPhaseIdx) && FluidSystem::phaseIsActive(oilPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(gasPhaseIdx) && FluidSystem::phaseIsActive(oilPhaseIdx)) {
|
||||||
Scalar x_oG = Opm::getValue(fs.moleFraction(oilPhaseIdx, gasCompIdx));
|
Scalar x_oG = getValue(fs.moleFraction(oilPhaseIdx, gasCompIdx));
|
||||||
Scalar x_gO = Opm::getValue(fs.moleFraction(gasPhaseIdx, oilCompIdx));
|
Scalar x_gO = getValue(fs.moleFraction(gasPhaseIdx, oilCompIdx));
|
||||||
Scalar X_oG = Opm::getValue(fs.massFraction(oilPhaseIdx, gasCompIdx));
|
Scalar X_oG = getValue(fs.massFraction(oilPhaseIdx, gasCompIdx));
|
||||||
Scalar X_gO = Opm::getValue(fs.massFraction(gasPhaseIdx, oilCompIdx));
|
Scalar X_gO = getValue(fs.massFraction(gasPhaseIdx, oilCompIdx));
|
||||||
Scalar Rs = FluidSystem::convertXoGToRs(X_oG, pvtRegionIdx);
|
Scalar Rs = FluidSystem::convertXoGToRs(X_oG, pvtRegionIdx);
|
||||||
Scalar Rv = FluidSystem::convertXgOToRv(X_gO, pvtRegionIdx);
|
Scalar Rv = FluidSystem::convertXgOToRv(X_gO, pvtRegionIdx);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class VtkBlackOilPolymerModule : public BaseOutputModule<TypeTag>
|
|||||||
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
|
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
|
||||||
|
|
||||||
@ -181,27 +181,27 @@ public:
|
|||||||
|
|
||||||
if (polymerConcentrationOutput_())
|
if (polymerConcentrationOutput_())
|
||||||
polymerConcentration_[globalDofIdx] =
|
polymerConcentration_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.polymerConcentration());
|
scalarValue(intQuants.polymerConcentration());
|
||||||
|
|
||||||
if (polymerDeadPoreVolumeOutput_())
|
if (polymerDeadPoreVolumeOutput_())
|
||||||
polymerDeadPoreVolume_[globalDofIdx] =
|
polymerDeadPoreVolume_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.polymerDeadPoreVolume());
|
scalarValue(intQuants.polymerDeadPoreVolume());
|
||||||
|
|
||||||
if (polymerRockDensityOutput_())
|
if (polymerRockDensityOutput_())
|
||||||
polymerRockDensity_[globalDofIdx] =
|
polymerRockDensity_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.polymerRockDensity());
|
scalarValue(intQuants.polymerRockDensity());
|
||||||
|
|
||||||
if (polymerAdsorptionOutput_())
|
if (polymerAdsorptionOutput_())
|
||||||
polymerAdsorption_[globalDofIdx] =
|
polymerAdsorption_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.polymerAdsorption());
|
scalarValue(intQuants.polymerAdsorption());
|
||||||
|
|
||||||
if (polymerViscosityCorrectionOutput_())
|
if (polymerViscosityCorrectionOutput_())
|
||||||
polymerViscosityCorrection_[globalDofIdx] =
|
polymerViscosityCorrection_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.polymerViscosityCorrection());
|
scalarValue(intQuants.polymerViscosityCorrection());
|
||||||
|
|
||||||
if (waterViscosityCorrectionOutput_())
|
if (waterViscosityCorrectionOutput_())
|
||||||
waterViscosityCorrection_[globalDofIdx] =
|
waterViscosityCorrection_[globalDofIdx] =
|
||||||
Opm::scalarValue(intQuants.waterViscosityCorrection());
|
scalarValue(intQuants.waterViscosityCorrection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ class VtkBlackOilSolventModule : public BaseOutputModule<TypeTag>
|
|||||||
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
|
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
if (!enableSolvent)
|
if (!enableSolvent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) {
|
for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) {
|
||||||
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
const auto& intQuants = elemCtx.intensiveQuantities(dofIdx, /*timeIdx=*/0);
|
||||||
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
||||||
|
@ -108,7 +108,7 @@ class VtkCompositionModule : public BaseOutputModule<TypeTag>
|
|||||||
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
using ComponentBuffer = typename ParentType::ComponentBuffer;
|
using ComponentBuffer = typename ParentType::ComponentBuffer;
|
||||||
using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer;
|
using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer;
|
||||||
@ -168,7 +168,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void processElement(const ElementContext& elemCtx)
|
void processElement(const ElementContext& elemCtx)
|
||||||
{
|
{
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
|
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
|
||||||
return;
|
return;
|
||||||
|
@ -87,13 +87,13 @@ class VtkDiffusionModule : public BaseOutputModule<TypeTag>
|
|||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
||||||
|
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer;
|
using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer;
|
||||||
using PhaseBuffer = typename ParentType::PhaseBuffer;
|
using PhaseBuffer = typename ParentType::PhaseBuffer;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||||
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
||||||
|
@ -137,7 +137,7 @@ class VtkMultiPhaseModule : public BaseOutputModule<TypeTag>
|
|||||||
using DiscBaseOutputModule = GetPropType<TypeTag, Properties::DiscBaseOutputModule>;
|
using DiscBaseOutputModule = GetPropType<TypeTag, Properties::DiscBaseOutputModule>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
enum { dimWorld = GridView::dimensionworld };
|
enum { dimWorld = GridView::dimensionworld };
|
||||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||||
@ -247,7 +247,7 @@ public:
|
|||||||
const auto& fs = intQuants.fluidState();
|
const auto& fs = intQuants.fluidState();
|
||||||
|
|
||||||
if (extrusionFactorOutput_()) extrusionFactor_[I] = intQuants.extrusionFactor();
|
if (extrusionFactorOutput_()) extrusionFactor_[I] = intQuants.extrusionFactor();
|
||||||
if (porosityOutput_()) porosity_[I] = Opm::getValue(intQuants.porosity());
|
if (porosityOutput_()) porosity_[I] = getValue(intQuants.porosity());
|
||||||
|
|
||||||
if (intrinsicPermeabilityOutput_()) {
|
if (intrinsicPermeabilityOutput_()) {
|
||||||
const auto& K = problem.intrinsicPermeability(elemCtx, i, /*timeIdx=*/0);
|
const auto& K = problem.intrinsicPermeability(elemCtx, i, /*timeIdx=*/0);
|
||||||
@ -261,19 +261,19 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (pressureOutput_())
|
if (pressureOutput_())
|
||||||
pressure_[phaseIdx][I] = Opm::getValue(fs.pressure(phaseIdx));
|
pressure_[phaseIdx][I] = getValue(fs.pressure(phaseIdx));
|
||||||
if (densityOutput_())
|
if (densityOutput_())
|
||||||
density_[phaseIdx][I] = Opm::getValue(fs.density(phaseIdx));
|
density_[phaseIdx][I] = getValue(fs.density(phaseIdx));
|
||||||
if (saturationOutput_())
|
if (saturationOutput_())
|
||||||
saturation_[phaseIdx][I] = Opm::getValue(fs.saturation(phaseIdx));
|
saturation_[phaseIdx][I] = getValue(fs.saturation(phaseIdx));
|
||||||
if (mobilityOutput_())
|
if (mobilityOutput_())
|
||||||
mobility_[phaseIdx][I] = Opm::getValue(intQuants.mobility(phaseIdx));
|
mobility_[phaseIdx][I] = getValue(intQuants.mobility(phaseIdx));
|
||||||
if (relativePermeabilityOutput_())
|
if (relativePermeabilityOutput_())
|
||||||
relativePermeability_[phaseIdx][I] = Opm::getValue(intQuants.relativePermeability(phaseIdx));
|
relativePermeability_[phaseIdx][I] = getValue(intQuants.relativePermeability(phaseIdx));
|
||||||
if (viscosityOutput_())
|
if (viscosityOutput_())
|
||||||
viscosity_[phaseIdx][I] = Opm::getValue(fs.viscosity(phaseIdx));
|
viscosity_[phaseIdx][I] = getValue(fs.viscosity(phaseIdx));
|
||||||
if (averageMolarMassOutput_())
|
if (averageMolarMassOutput_())
|
||||||
averageMolarMass_[phaseIdx][I] = Opm::getValue(fs.averageMolarMass(phaseIdx));
|
averageMolarMass_[phaseIdx][I] = getValue(fs.averageMolarMass(phaseIdx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +293,7 @@ public:
|
|||||||
const auto& inputPGrad = extQuants.potentialGrad(phaseIdx);
|
const auto& inputPGrad = extQuants.potentialGrad(phaseIdx);
|
||||||
DimVector pGrad;
|
DimVector pGrad;
|
||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
||||||
pGrad[dimIdx] = Opm::getValue(inputPGrad[dimIdx])*weight;
|
pGrad[dimIdx] = getValue(inputPGrad[dimIdx])*weight;
|
||||||
potentialGradient_[phaseIdx][I] += pGrad;
|
potentialGradient_[phaseIdx][I] += pGrad;
|
||||||
} // end for all phases
|
} // end for all phases
|
||||||
} // end for all faces
|
} // end for all faces
|
||||||
@ -312,15 +312,15 @@ public:
|
|||||||
|
|
||||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||||
Scalar weight = std::max<Scalar>(1e-16,
|
Scalar weight = std::max<Scalar>(1e-16,
|
||||||
std::abs(Opm::getValue(extQuants.volumeFlux(phaseIdx))));
|
std::abs(getValue(extQuants.volumeFlux(phaseIdx))));
|
||||||
Opm::Valgrind::CheckDefined(extQuants.extrusionFactor());
|
Valgrind::CheckDefined(extQuants.extrusionFactor());
|
||||||
assert(extQuants.extrusionFactor() > 0);
|
assert(extQuants.extrusionFactor() > 0);
|
||||||
weight *= extQuants.extrusionFactor();
|
weight *= extQuants.extrusionFactor();
|
||||||
|
|
||||||
const auto& inputV = extQuants.filterVelocity(phaseIdx);
|
const auto& inputV = extQuants.filterVelocity(phaseIdx);
|
||||||
DimVector v;
|
DimVector v;
|
||||||
for (unsigned k = 0; k < dimWorld; ++k)
|
for (unsigned k = 0; k < dimWorld; ++k)
|
||||||
v[k] = Opm::getValue(inputV[k]);
|
v[k] = getValue(inputV[k]);
|
||||||
if (v.two_norm() > 1e-20)
|
if (v.two_norm() > 1e-20)
|
||||||
weight /= v.two_norm();
|
weight /= v.two_norm();
|
||||||
v *= weight;
|
v *= weight;
|
||||||
|
@ -76,7 +76,7 @@ class VtkPrimaryVarsModule : public BaseOutputModule<TypeTag>
|
|||||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
using ScalarBuffer = typename ParentType::ScalarBuffer;
|
using ScalarBuffer = typename ParentType::ScalarBuffer;
|
||||||
using EqBuffer = typename ParentType::EqBuffer;
|
using EqBuffer = typename ParentType::EqBuffer;
|
||||||
|
@ -76,7 +76,7 @@ class VtkTemperatureModule : public BaseOutputModule<TypeTag>
|
|||||||
using ScalarBuffer = typename ParentType::ScalarBuffer;
|
using ScalarBuffer = typename ParentType::ScalarBuffer;
|
||||||
|
|
||||||
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
static const int vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>();
|
||||||
using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>;
|
using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VtkTemperatureModule(const Simulator& simulator)
|
VtkTemperatureModule(const Simulator& simulator)
|
||||||
@ -107,7 +107,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void processElement(const ElementContext& elemCtx)
|
void processElement(const ElementContext& elemCtx)
|
||||||
{
|
{
|
||||||
using Toolbox = Opm::MathToolbox<Evaluation>;
|
using Toolbox = MathToolbox<Evaluation>;
|
||||||
|
|
||||||
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
|
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
|
||||||
return;
|
return;
|
||||||
|
@ -127,9 +127,9 @@ struct NewtonMaxIterations { using type = UndefinedProperty; };
|
|||||||
|
|
||||||
// set default values for the properties
|
// set default values for the properties
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = Opm::NewtonMethod<TypeTag>; };
|
struct NewtonMethod<TypeTag, TTag::NewtonMethod> { using type = ::Opm::NewtonMethod<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = Opm::NullConvergenceWriter<TypeTag>; };
|
struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullConvergenceWriter<TypeTag>; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonWriteConvergence<TypeTag, TTag::NewtonMethod> { static constexpr bool value = false; };
|
struct NewtonWriteConvergence<TypeTag, TTag::NewtonMethod> { static constexpr bool value = false; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
@ -327,7 +327,7 @@ public:
|
|||||||
|
|
||||||
Linearizer& linearizer = model().linearizer();
|
Linearizer& linearizer = model().linearizer();
|
||||||
|
|
||||||
Opm::TimerGuard prePostProcessTimerGuard(prePostProcessTimer_);
|
TimerGuard prePostProcessTimerGuard(prePostProcessTimer_);
|
||||||
|
|
||||||
// tell the implementation that we begin solving
|
// tell the implementation that we begin solving
|
||||||
prePostProcessTimer_.start();
|
prePostProcessTimer_.start();
|
||||||
@ -335,10 +335,10 @@ public:
|
|||||||
prePostProcessTimer_.stop();
|
prePostProcessTimer_.stop();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Opm::TimerGuard innerPrePostProcessTimerGuard(prePostProcessTimer_);
|
TimerGuard innerPrePostProcessTimerGuard(prePostProcessTimer_);
|
||||||
Opm::TimerGuard linearizeTimerGuard(linearizeTimer_);
|
TimerGuard linearizeTimerGuard(linearizeTimer_);
|
||||||
Opm::TimerGuard updateTimerGuard(updateTimer_);
|
TimerGuard updateTimerGuard(updateTimer_);
|
||||||
Opm::TimerGuard solveTimerGuard(solveTimer_);
|
TimerGuard solveTimerGuard(solveTimer_);
|
||||||
|
|
||||||
// execute the method as long as the implementation thinks
|
// execute the method as long as the implementation thinks
|
||||||
// that we should do another iteration
|
// that we should do another iteration
|
||||||
@ -460,7 +460,7 @@ public:
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (const Opm::NumericalIssue& e)
|
catch (const NumericalIssue& e)
|
||||||
{
|
{
|
||||||
if (asImp_().verbose_())
|
if (asImp_().verbose_())
|
||||||
std::cout << "Newton method caught exception: \""
|
std::cout << "Newton method caught exception: \""
|
||||||
@ -569,16 +569,16 @@ public:
|
|||||||
const LinearSolverBackend& linearSolver() const
|
const LinearSolverBackend& linearSolver() const
|
||||||
{ return linearSolver_; }
|
{ return linearSolver_; }
|
||||||
|
|
||||||
const Opm::Timer& prePostProcessTimer() const
|
const Timer& prePostProcessTimer() const
|
||||||
{ return prePostProcessTimer_; }
|
{ return prePostProcessTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& linearizeTimer() const
|
const Timer& linearizeTimer() const
|
||||||
{ return linearizeTimer_; }
|
{ return linearizeTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& solveTimer() const
|
const Timer& solveTimer() const
|
||||||
{ return solveTimer_; }
|
{ return solveTimer_; }
|
||||||
|
|
||||||
const Opm::Timer& updateTimer() const
|
const Timer& updateTimer() const
|
||||||
{ return updateTimer_; }
|
{ return updateTimer_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -627,7 +627,7 @@ protected:
|
|||||||
succeeded = comm.min(succeeded);
|
succeeded = comm.min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("pre processing of the problem failed");
|
throw NumericalIssue("pre processing of the problem failed");
|
||||||
|
|
||||||
lastError_ = error_;
|
lastError_ = error_;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ protected:
|
|||||||
|
|
||||||
const auto& r = currentResidual[dofIdx];
|
const auto& r = currentResidual[dofIdx];
|
||||||
for (unsigned eqIdx = 0; eqIdx < r.size(); ++eqIdx)
|
for (unsigned eqIdx = 0; eqIdx < r.size(); ++eqIdx)
|
||||||
error_ = Opm::max(std::abs(r[eqIdx] * model().eqWeight(dofIdx, eqIdx)), error_);
|
error_ = max(std::abs(r[eqIdx] * model().eqWeight(dofIdx, eqIdx)), error_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// take the other processes into account
|
// take the other processes into account
|
||||||
@ -679,7 +679,7 @@ protected:
|
|||||||
// make sure that the error never grows beyond the maximum
|
// make sure that the error never grows beyond the maximum
|
||||||
// allowed one
|
// allowed one
|
||||||
if (error_ > newtonMaxError)
|
if (error_ > newtonMaxError)
|
||||||
throw Opm::NumericalIssue("Newton: Error "+std::to_string(double(error_))
|
throw NumericalIssue("Newton: Error "+std::to_string(double(error_))
|
||||||
+" is larger than maximum allowed error of "
|
+" is larger than maximum allowed error of "
|
||||||
+std::to_string(double(newtonMaxError)));
|
+std::to_string(double(newtonMaxError)));
|
||||||
}
|
}
|
||||||
@ -722,7 +722,7 @@ protected:
|
|||||||
succeeded = comm.min(succeeded);
|
succeeded = comm.min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("post processing of an auxilary equation failed");
|
throw NumericalIssue("post processing of an auxilary equation failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ protected:
|
|||||||
|
|
||||||
// make sure not to swallow non-finite values at this point
|
// make sure not to swallow non-finite values at this point
|
||||||
if (!std::isfinite(solutionUpdate.one_norm()))
|
if (!std::isfinite(solutionUpdate.one_norm()))
|
||||||
throw Opm::NumericalIssue("Non-finite update!");
|
throw NumericalIssue("Non-finite update!");
|
||||||
|
|
||||||
size_t numGridDof = model().numGridDof();
|
size_t numGridDof = model().numGridDof();
|
||||||
for (unsigned dofIdx = 0; dofIdx < numGridDof; ++dofIdx) {
|
for (unsigned dofIdx = 0; dofIdx < numGridDof; ++dofIdx) {
|
||||||
@ -851,7 +851,7 @@ protected:
|
|||||||
succeeded = comm.min(succeeded);
|
succeeded = comm.min(succeeded);
|
||||||
|
|
||||||
if (!succeeded)
|
if (!succeeded)
|
||||||
throw Opm::NumericalIssue("post processing of the problem failed");
|
throw NumericalIssue("post processing of the problem failed");
|
||||||
|
|
||||||
if (asImp_().verbose_()) {
|
if (asImp_().verbose_()) {
|
||||||
std::cout << "Newton iteration " << numIterations_ << ""
|
std::cout << "Newton iteration " << numIterations_ << ""
|
||||||
@ -921,10 +921,10 @@ protected:
|
|||||||
|
|
||||||
Simulator& simulator_;
|
Simulator& simulator_;
|
||||||
|
|
||||||
Opm::Timer prePostProcessTimer_;
|
Timer prePostProcessTimer_;
|
||||||
Opm::Timer linearizeTimer_;
|
Timer linearizeTimer_;
|
||||||
Opm::Timer solveTimer_;
|
Timer solveTimer_;
|
||||||
Opm::Timer updateTimer_;
|
Timer updateTimer_;
|
||||||
|
|
||||||
std::ostringstream endIterMsgStream_;
|
std::ostringstream endIterMsgStream_;
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public:
|
|||||||
|
|
||||||
Simulator(bool verbose = true)
|
Simulator(bool verbose = true)
|
||||||
{
|
{
|
||||||
Opm::TimerGuard setupTimerGuard(setupTimer_);
|
TimerGuard setupTimerGuard(setupTimer_);
|
||||||
|
|
||||||
setupTimer_.start();
|
setupTimer_.start();
|
||||||
|
|
||||||
@ -359,51 +359,51 @@ public:
|
|||||||
* \brief Returns a reference to the timer object which measures the time needed to
|
* \brief Returns a reference to the timer object which measures the time needed to
|
||||||
* set up and initialize the simulation
|
* set up and initialize the simulation
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& setupTimer() const
|
const Timer& setupTimer() const
|
||||||
{ return setupTimer_; }
|
{ return setupTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed to
|
* \brief Returns a reference to the timer object which measures the time needed to
|
||||||
* run the simulation
|
* run the simulation
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& executionTimer() const
|
const Timer& executionTimer() const
|
||||||
{ return executionTimer_; }
|
{ return executionTimer_; }
|
||||||
Opm::Timer& executionTimer()
|
Timer& executionTimer()
|
||||||
{ return executionTimer_; }
|
{ return executionTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed for
|
* \brief Returns a reference to the timer object which measures the time needed for
|
||||||
* pre- and postprocessing of the solutions.
|
* pre- and postprocessing of the solutions.
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& prePostProcessTimer() const
|
const Timer& prePostProcessTimer() const
|
||||||
{ return prePostProcessTimer_; }
|
{ return prePostProcessTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed for
|
* \brief Returns a reference to the timer object which measures the time needed for
|
||||||
* linarizing the solutions.
|
* linarizing the solutions.
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& linearizeTimer() const
|
const Timer& linearizeTimer() const
|
||||||
{ return linearizeTimer_; }
|
{ return linearizeTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed by
|
* \brief Returns a reference to the timer object which measures the time needed by
|
||||||
* the solver.
|
* the solver.
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& solveTimer() const
|
const Timer& solveTimer() const
|
||||||
{ return solveTimer_; }
|
{ return solveTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed to
|
* \brief Returns a reference to the timer object which measures the time needed to
|
||||||
* the solutions of the non-linear system of equations.
|
* the solutions of the non-linear system of equations.
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& updateTimer() const
|
const Timer& updateTimer() const
|
||||||
{ return updateTimer_; }
|
{ return updateTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a reference to the timer object which measures the time needed to
|
* \brief Returns a reference to the timer object which measures the time needed to
|
||||||
* write the visualization output
|
* write the visualization output
|
||||||
*/
|
*/
|
||||||
const Opm::Timer& writeTimer() const
|
const Timer& writeTimer() const
|
||||||
{ return writeTimer_; }
|
{ return writeTimer_; }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -636,7 +636,7 @@ public:
|
|||||||
// try to restart a previous simulation
|
// try to restart a previous simulation
|
||||||
time_ = restartTime;
|
time_ = restartTime;
|
||||||
|
|
||||||
Opm::Restart res;
|
Restart res;
|
||||||
EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(res.deserializeBegin(*this, time_));
|
EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(res.deserializeBegin(*this, time_));
|
||||||
if (verbose_)
|
if (verbose_)
|
||||||
std::cout << "Deserialize from file '" << res.fileName() << "'\n" << std::flush;
|
std::cout << "Deserialize from file '" << res.fileName() << "'\n" << std::flush;
|
||||||
@ -887,7 +887,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void serialize()
|
void serialize()
|
||||||
{
|
{
|
||||||
using Restarter = Opm::Restart;
|
using Restarter = Restart;
|
||||||
Restarter res;
|
Restarter res;
|
||||||
res.serializeBegin(*this);
|
res.serializeBegin(*this);
|
||||||
if (gridView().comm().rank() == 0)
|
if (gridView().comm().rank() == 0)
|
||||||
@ -952,13 +952,13 @@ private:
|
|||||||
Scalar episodeStartTime_;
|
Scalar episodeStartTime_;
|
||||||
Scalar episodeLength_;
|
Scalar episodeLength_;
|
||||||
|
|
||||||
Opm::Timer setupTimer_;
|
Timer setupTimer_;
|
||||||
Opm::Timer executionTimer_;
|
Timer executionTimer_;
|
||||||
Opm::Timer prePostProcessTimer_;
|
Timer prePostProcessTimer_;
|
||||||
Opm::Timer linearizeTimer_;
|
Timer linearizeTimer_;
|
||||||
Opm::Timer solveTimer_;
|
Timer solveTimer_;
|
||||||
Opm::Timer updateTimer_;
|
Timer updateTimer_;
|
||||||
Opm::Timer writeTimer_;
|
Timer writeTimer_;
|
||||||
|
|
||||||
std::vector<Scalar> forcedTimeSteps_;
|
std::vector<Scalar> forcedTimeSteps_;
|
||||||
Scalar startTime_;
|
Scalar startTime_;
|
||||||
@ -974,7 +974,7 @@ private:
|
|||||||
|
|
||||||
namespace Properties {
|
namespace Properties {
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct Simulator<TypeTag, TTag::NumericModel> { using type = Opm::Simulator<TypeTag>; };
|
struct Simulator<TypeTag, TTag::NumericModel> { using type = ::Opm::Simulator<TypeTag>; };
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
Loading…
Reference in New Issue
Block a user