renaming saltwater-->brine and review comments

This commit is contained in:
Trine S. Mykkeltvedt 2019-12-03 09:05:44 +01:00 committed by Tor Harald Sandve
parent 106c4e3616
commit 587fa71e04
10 changed files with 109 additions and 111 deletions

View File

@ -23,10 +23,10 @@
/*!
* \file
*
* \brief Contains the classes required to extend the black-oil model by SALTwater.
* \brief Contains the classes required to extend the black-oil model by brine.
*/
#ifndef EWOMS_BLACK_OIL_SALTWATER_MODULE_HH
#define EWOMS_BLACK_OIL_SALTWATER_MODULE_HH
#ifndef EWOMS_BLACK_OIL_BRINE_MODULE_HH
#define EWOMS_BLACK_OIL_BRINE_MODULE_HH
#include "blackoilproperties.hh"
#include <opm/models/common/quantitycallbacks.hh>
@ -54,10 +54,10 @@ namespace Opm {
/*!
* \ingroup BlackOil
* \brief Contains the high level supplements required to extend the black oil
* model by saltwater.
* model by brine.
*/
template <class TypeTag, bool enableSaltWaterV = GET_PROP_VALUE(TypeTag, EnableSaltWater)>
class BlackOilSaltWaterModule
template <class TypeTag, bool enableBrineV = GET_PROP_VALUE(TypeTag, EnableBrine)>
class BlackOilBrineModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
@ -78,10 +78,10 @@ class BlackOilSaltWaterModule
typedef typename Opm::IntervalTabulated2DFunction<Scalar> TabulatedTwoDFunction;
static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx;
static constexpr unsigned contiSaltWaterEqIdx = Indices::contiSaltWaterEqIdx;
static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx;
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr unsigned enableSaltWater = enableSaltWaterV;
static constexpr unsigned enableBrine = enableBrineV;
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numPhases = FluidSystem::numPhases;
@ -90,24 +90,24 @@ public:
#if HAVE_ECL_INPUT
/*!
* \brief Initialize all internal data structures needed by the saltwater module
* \brief Initialize all internal data structures needed by the brine module
*/
static void initFromDeck(const Opm::Deck& deck, const Opm::EclipseState& eclState)
{
// some sanity checks: if saltwaters are enabled, the BRINE keyword must be
// present, if saltwater are disabled the keyword must not be present.
if (enableSaltWater && !deck.hasKeyword("BRINE")) {
throw std::runtime_error("Non-trivial saltwater treatment requested at compile time, but "
// some sanity checks: if brine are enabled, the BRINE keyword must be
// present, if brine are disabled the keyword must not be present.
if (enableBrine && !deck.hasKeyword("BRINE")) {
throw std::runtime_error("Non-trivial brine treatment requested at compile time, but "
"the deck does not contain the BRINE keyword");
}
else if (!enableSaltWater && deck.hasKeyword("BRINE")) {
throw std::runtime_error("SaltWater treatment disabled at compile time, but the deck "
else if (!enableBrine && deck.hasKeyword("BRINE")) {
throw std::runtime_error("Brine treatment disabled at compile time, but the deck "
"contains the BRINE keyword");
}
if (!deck.hasKeyword("BRINE"))
return; // saltwater treatment is supposed to be disabled
return; // brine treatment is supposed to be disabled
const auto& tableManager = eclState.getTableManager();
@ -133,43 +133,43 @@ public:
#endif
/*!
* \brief Register all run-time parameters for the black-oil saltwater module.
* \brief Register all run-time parameters for the black-oil brine module.
*/
static void registerParameters()
{
if (!enableSaltWater)
// saltwater have been disabled at compile time
if (!enableBrine)
// brine have been disabled at compile time
return;
}
static bool primaryVarApplies(unsigned pvIdx)
{
if (!enableSaltWater)
// saltwaters have been disabled at compile time
if (!enableBrine)
// brine have been disabled at compile time
return false;
return pvIdx == saltConcentrationIdx;
}
/*!
* \brief Assign the solvent specific primary variables to a PrimaryVariables object
* \brief Assign the brine specific primary variables to a PrimaryVariables object
*/
template <class FluidState>
static void assignPrimaryVars(PrimaryVariables& priVars,
const FluidState& fluidState)
{
if (!enableSaltWater)
if (!enableBrine)
return;
priVars[saltConcentrationIdx] = fluidState.saltconcentration();
priVars[saltConcentrationIdx] = fluidState.saltConcentration();
}
static std::string primaryVarName(unsigned pvIdx)
{
assert(primaryVarApplies(pvIdx));
return "saltwater_waterconcentration";
return "saltConcentration";
}
static Scalar primaryVarWeight(unsigned pvIdx OPM_OPTIM_UNUSED)
@ -182,17 +182,17 @@ public:
static bool eqApplies(unsigned eqIdx)
{
if (!enableSaltWater)
if (!enableBrine)
return false;
return eqIdx == contiSaltWaterEqIdx;
return eqIdx == contiBrineEqIdx;
}
static std::string eqName(unsigned eqIdx)
{
assert(eqApplies(eqIdx));
return "conti^saltwater";
return "conti^brine";
}
static Scalar eqWeight(unsigned eqIdx OPM_OPTIM_UNUSED)
@ -208,7 +208,7 @@ public:
static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
const IntensiveQuantities& intQuants)
{
if (!enableSaltWater)
if (!enableBrine)
return;
const auto& fs = intQuants.fluidState();
@ -221,11 +221,11 @@ public:
// avoid singular matrix if no water is present.
surfaceVolumeWater = Opm::max(surfaceVolumeWater, 1e-10);
// Saltwater in water phase
const LhsEval massSaltWater = surfaceVolumeWater
* Toolbox::template decay<LhsEval>(fs.saltconcentration());
// Brine in water phase
const LhsEval massBrine = surfaceVolumeWater
* Toolbox::template decay<LhsEval>(fs.saltConcentration());
storage[contiSaltWaterEqIdx] += massSaltWater;
storage[contiBrineEqIdx] += massBrine;
}
static void computeFlux(RateVector& flux,
@ -234,7 +234,7 @@ public:
unsigned timeIdx)
{
if (!enableSaltWater)
if (!enableBrine)
return;
const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
@ -242,20 +242,18 @@ public:
const unsigned upIdx = extQuants.upstreamIndex(FluidSystem::waterPhaseIdx);
const unsigned inIdx = extQuants.interiorIndex();
const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
//const unsigned contiWaterEqIdx = Indices::conti0EqIdx + Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
if (upIdx == inIdx) {
flux[contiSaltWaterEqIdx] =
flux[contiBrineEqIdx] =
extQuants.volumeFlux(waterPhaseIdx)
*up.fluidState().invB(waterPhaseIdx)
*up.fluidState().saltconcentration();
*up.fluidState().saltConcentration();
}
else {
flux[contiSaltWaterEqIdx] =
flux[contiBrineEqIdx] =
extQuants.volumeFlux(waterPhaseIdx)
*Opm::decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
*Opm::decay<Scalar>(up.fluidState().saltconcentration());
*Opm::decay<Scalar>(up.fluidState().saltConcentration());
}
}
@ -265,7 +263,7 @@ public:
static Scalar computeUpdateError(const PrimaryVariables& oldPv OPM_OPTIM_UNUSED,
const EqVector& delta OPM_OPTIM_UNUSED)
{
// do not consider consider the cange of Saltwater primary variables for
// do not consider consider the cange of Brine primary variables for
// convergence
// TODO: maybe this should be changed
return static_cast<Scalar>(0.0);
@ -274,7 +272,7 @@ public:
template <class DofEntity>
static void serializeEntity(const Model& model, std::ostream& outstream, const DofEntity& dof)
{
if (!enableSaltWater)
if (!enableBrine)
return;
unsigned dofIdx = model.dofMapper().index(dof);
@ -285,7 +283,7 @@ public:
template <class DofEntity>
static void deserializeEntity(Model& model, std::istream& instream, const DofEntity& dof)
{
if (!enableSaltWater)
if (!enableBrine)
return;
unsigned dofIdx = model.dofMapper().index(dof);
@ -326,23 +324,23 @@ private:
};
template <class TypeTag, bool enableSaltWaterV>
std::vector<typename BlackOilSaltWaterModule<TypeTag, enableSaltWaterV>::TabulatedFunction>
BlackOilSaltWaterModule<TypeTag, enableSaltWaterV>::bdensityTable_;
template <class TypeTag, bool enableBrineV>
std::vector<typename BlackOilBrineModule<TypeTag, enableBrineV>::TabulatedFunction>
BlackOilBrineModule<TypeTag, enableBrineV>::bdensityTable_;
template <class TypeTag, bool enableSaltWaterV>
std::vector<typename BlackOilSaltWaterModule<TypeTag, enableSaltWaterV>::Scalar>
BlackOilSaltWaterModule<TypeTag, enableSaltWaterV>::referencePressure_;
template <class TypeTag, bool enableBrineV>
std::vector<typename BlackOilBrineModule<TypeTag, enableBrineV>::Scalar>
BlackOilBrineModule<TypeTag, enableBrineV>::referencePressure_;
/*!
* \ingroup BlackOil
* \class Ewoms::BlackOilSaltWaterIntensiveQuantities
* \class Ewoms::BlackOilBrineIntensiveQuantities
*
* \brief Provides the volumetric quantities required for the equations needed by the
* Saltwaters extension of the black-oil model.
* brine extension of the black-oil model.
*/
template <class TypeTag, bool enableSaltWaterV = GET_PROP_VALUE(TypeTag, EnableSaltWater)>
class BlackOilSaltWaterIntensiveQuantities
template <class TypeTag, bool enableBrineV = GET_PROP_VALUE(TypeTag, EnableBrine)>
class BlackOilBrineIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
@ -354,23 +352,23 @@ class BlackOilSaltWaterIntensiveQuantities
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef BlackOilSaltWaterModule<TypeTag> SaltWaterModule;
typedef BlackOilBrineModule<TypeTag> BrineModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
static constexpr int saltConcentrationIdx = Indices::saltConcentrationIdx;
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
static constexpr unsigned enableSaltWater = enableSaltWaterV;
static constexpr int contiSaltWaterEqIdx = Indices::contiSaltWaterEqIdx;
static constexpr unsigned enableBrine = enableBrineV;
static constexpr int contiBrineEqIdx = Indices::contiBrineEqIdx;
public:
/*!
* \brief Update the intensive properties needed to handle Saltwaters from the
* \brief Update the intensive properties needed to handle brine from the
* primary variables
*
*/
void updateSaltconcentration_(const ElementContext& elemCtx,
void updateSaltConcentration_(const ElementContext& elemCtx,
unsigned dofIdx,
unsigned timeIdx)
{
@ -378,43 +376,43 @@ public:
auto& fs = asImp_().fluidState_;
// set saltconcentration
fs.setSaltconcentration(priVars.makeEvaluation(saltConcentrationIdx, timeIdx));
fs.setSaltConcentration(priVars.makeEvaluation(saltConcentrationIdx, timeIdx));
}
const Evaluation& saltconcentration() const
{ return saltconcentration_; }
const Evaluation& saltConcentration() const
{ return saltConcentration_; }
const Evaluation& saltwaterRefDensity() const
const Evaluation& brineRefDensity() const
{ return refDensity_; }
protected:
Implementation& asImp_()
{ return *static_cast<Implementation*>(this); }
Evaluation saltconcentration_;
Evaluation saltConcentration_;
Evaluation refDensity_;
};
template <class TypeTag>
class BlackOilSaltWaterIntensiveQuantities<TypeTag, false>
class BlackOilBrineIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
public:
void updateSaltconcentration_(const ElementContext& elemCtx OPM_OPTIM_UNUSED,
void updateSaltConcentration_(const ElementContext& elemCtx OPM_OPTIM_UNUSED,
unsigned dofIdx OPM_OPTIM_UNUSED,
unsigned timeIdx OPM_OPTIM_UNUSED)
{ }
const Evaluation& saltwaterConcentration() const
{ throw std::runtime_error("saltwaterConcentration() called but saltwaters are disabled"); }
const Evaluation& saltConcentration() const
{ throw std::runtime_error("saltConcentration() called but brine are disabled"); }
const Evaluation& saltwaterRefDensity() const
{ throw std::runtime_error("saltwaterRockDensity() called but saltwaters are disabled"); }
const Evaluation& brineRefDensity() const
{ throw std::runtime_error("brineRefDensity() called but brine are disabled"); }
};

View File

@ -35,7 +35,7 @@ namespace Opm {
*
* \brief The primary variable and equation indices for the black-oil model.
*/
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, bool enableFoam, bool enableSaltWater, unsigned PVOffset>
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, bool enableFoam, bool enableBrine, unsigned PVOffset>
struct BlackOilIndices
{
//! Number of phases active at all times
@ -68,10 +68,10 @@ struct BlackOilIndices
static const int numFoam = enableFoam? 1 : 0;
//! Number of salt equations to be considered
static const int numSaltWater = enableSaltWater? 1 : 0;
static const int numBrine = enableBrine? 1 : 0;
//! The number of equations
static const int numEq = numPhases + numSolvents + numPolymers + numEnergy + numFoam + numSaltWater;
static const int numEq = numPhases + numSolvents + numPolymers + numEnergy + numFoam + numBrine;
//! \brief returns the index of "active" component
static constexpr unsigned canonicalToActiveComponentIndex(unsigned compIdx)
@ -116,13 +116,13 @@ struct BlackOilIndices
static const int foamConcentrationIdx =
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000;
//! Index of the primary variable for the salt water
//! Index of the primary variable for the brine
static const int saltConcentrationIdx =
enableSaltWater ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
//! Index of the primary variable for temperature
static const int temperatureIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numSaltWater : - 1000;
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numBrine : - 1000;
////////
@ -150,13 +150,13 @@ struct BlackOilIndices
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000;
//! Index of the continuity equation for the salt water component
static const int contiSaltWaterEqIdx =
enableSaltWater ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
static const int contiBrineEqIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
//! Index of the continuity equation for energy
static const int contiEnergyEqIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numSaltWater: -1000;
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numBrine: -1000;
};
} // namespace Opm

View File

@ -32,7 +32,7 @@
#include "blackoilsolventmodules.hh"
#include "blackoilpolymermodules.hh"
#include "blackoilfoammodules.hh"
#include "blackoilsaltwatermodules.hh"
#include "blackoilbrinemodules.hh"
#include "blackoilenergymodules.hh"
#include <opm/material/fluidstates/BlackOilFluidState.hpp>
#include <opm/material/common/Valgrind.hpp>
@ -57,7 +57,7 @@ class BlackOilIntensiveQuantities
, public BlackOilSolventIntensiveQuantities<TypeTag>
, public BlackOilPolymerIntensiveQuantities<TypeTag>
, public BlackOilFoamIntensiveQuantities<TypeTag>
, public BlackOilSaltWaterIntensiveQuantities<TypeTag>
, public BlackOilBrineIntensiveQuantities<TypeTag>
, public BlackOilEnergyIntensiveQuantities<TypeTag>
{
typedef typename GET_PROP_TYPE(TypeTag, DiscIntensiveQuantities) ParentType;
@ -77,7 +77,7 @@ class BlackOilIntensiveQuantities
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableSaltWater = GET_PROP_VALUE(TypeTag, EnableSaltWater) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
@ -97,7 +97,7 @@ class BlackOilIntensiveQuantities
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
typedef typename FluxModule::FluxIntensiveQuantities FluxIntensiveQuantities;
typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, enableSaltWater, Indices::numPhases > FluidState;
typedef Opm::BlackOilFluidState<Evaluation, FluidSystem, enableTemperature, enableEnergy, compositionSwitchEnabled, enableBrine, Indices::numPhases > FluidState;
public:
BlackOilIntensiveQuantities()
@ -128,7 +128,7 @@ public:
unsigned pvtRegionIdx = priVars.pvtRegionIndex();
fluidState_.setPvtRegionIndex(pvtRegionIdx);
asImp_().updateSaltconcentration_(elemCtx, dofIdx, timeIdx);
asImp_().updateSaltConcentration_(elemCtx, dofIdx, timeIdx);
// extract the water and the gas saturations for convenience
Evaluation Sw = 0.0;
@ -449,7 +449,7 @@ private:
friend BlackOilPolymerIntensiveQuantities<TypeTag>;
friend BlackOilEnergyIntensiveQuantities<TypeTag>;
friend BlackOilFoamIntensiveQuantities<TypeTag>;
friend BlackOilSaltWaterIntensiveQuantities<TypeTag>;
friend BlackOilBrineIntensiveQuantities<TypeTag>;
Implementation& asImp_()

View File

@ -33,7 +33,7 @@
#include "blackoilpolymermodules.hh"
#include "blackoilenergymodules.hh"
#include "blackoilfoammodules.hh"
#include "blackoilsaltwatermodules.hh"
#include "blackoilbrinemodules.hh"
#include <opm/material/fluidstates/BlackOilFluidState.hpp>
@ -83,7 +83,7 @@ class BlackOilLocalResidual : public GET_PROP_TYPE(TypeTag, DiscLocalResidual)
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef BlackOilEnergyModule<TypeTag> EnergyModule;
typedef BlackOilFoamModule<TypeTag> FoamModule;
typedef BlackOilSaltWaterModule<TypeTag> SaltWaterModule;
typedef BlackOilBrineModule<TypeTag> BrineModule;
public:
/*!
@ -153,7 +153,7 @@ public:
FoamModule::addStorage(storage, intQuants);
// deal with salt (if present)
SaltWaterModule::addStorage(storage, intQuants);
BrineModule::addStorage(storage, intQuants);
}
/*!
@ -196,7 +196,7 @@ public:
FoamModule::computeFlux(flux, elemCtx, scvfIdx, timeIdx);
// deal with salt (if present)
SaltWaterModule::computeFlux(flux, elemCtx, scvfIdx, timeIdx);
BrineModule::computeFlux(flux, elemCtx, scvfIdx, timeIdx);
}
/*!

View File

@ -44,7 +44,7 @@
#include "blackoilsolventmodules.hh"
#include "blackoilpolymermodules.hh"
#include "blackoilfoammodules.hh"
#include "blackoilsaltwatermodules.hh"
#include "blackoilbrinemodules.hh"
#include "blackoildarcyfluxmodule.hh"
#include <opm/models/common/multiphasebasemodel.hh>
@ -114,7 +114,7 @@ SET_TYPE_PROP(BlackOilModel, Indices,
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
GET_PROP_VALUE(TypeTag, EnableSaltWater),
GET_PROP_VALUE(TypeTag, EnableBrine),
/*PVOffset=*/0>);
//! Set the fluid system to the black-oil fluid system by default
@ -133,7 +133,7 @@ SET_BOOL_PROP(BlackOilModel, EnableSolvent, false);
SET_BOOL_PROP(BlackOilModel, EnablePolymer, false);
SET_BOOL_PROP(BlackOilModel, EnablePolymerMW, false);
SET_BOOL_PROP(BlackOilModel, EnableFoam, false);
SET_BOOL_PROP(BlackOilModel, EnableSaltWater, false);
SET_BOOL_PROP(BlackOilModel, EnableBrine, false);
//! By default, the blackoil model is isothermal and does not conserve energy
SET_BOOL_PROP(BlackOilModel, EnableTemperature, false);

View File

@ -188,7 +188,7 @@ protected:
static constexpr bool enablePolymerWeight = Indices::polymerMoleWeightIdx >= 0;
static constexpr bool enableEnergy = Indices::temperatureIdx >= 0;
static constexpr bool enableFoam = Indices::foamConcentrationIdx >= 0;
static constexpr bool enableSaltWater = Indices::saltConcentrationIdx >= 0;
static constexpr bool enableBrine = Indices::saltConcentrationIdx >= 0;
currentValue.checkDefined();
Opm::Valgrind::CheckDefined(update);
@ -291,7 +291,7 @@ protected:
nextValue[pvIdx] = std::max(nextValue[pvIdx], 0.0);
// keep the salt concentration above 0
if (enableSaltWater && pvIdx == Indices::saltConcentrationIdx)
if (enableBrine && pvIdx == Indices::saltConcentrationIdx)
nextValue[pvIdx] = std::max(nextValue[pvIdx], 0.0);
// keep the temperature above 100 and below 1000 Kelvin

View File

@ -33,7 +33,7 @@
#include "blackoilpolymermodules.hh"
#include "blackoilenergymodules.hh"
#include "blackoilfoammodules.hh"
#include "blackoilsaltwatermodules.hh"
#include "blackoilbrinemodules.hh"
#include <opm/models/discretization/common/fvbaseprimaryvariables.hh>
@ -52,8 +52,8 @@ class BlackOilSolventModule;
template <class TypeTag, bool enablePolymer>
class BlackOilPolymerModule;
template <class TypeTag, bool enableSaltWater>
class BlackOilSaltWaterModule;
template <class TypeTag, bool enableBrine>
class BlackOilBrineModule;
/*!
* \ingroup BlackOilModel
@ -96,7 +96,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableSaltWater = GET_PROP_VALUE(TypeTag, EnableSaltWater) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { gasCompIdx = FluidSystem::gasCompIdx };
enum { waterCompIdx = FluidSystem::waterCompIdx };
@ -108,7 +108,7 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
typedef BlackOilPolymerModule<TypeTag, enablePolymer> PolymerModule;
typedef BlackOilEnergyModule<TypeTag, enableEnergy> EnergyModule;
typedef BlackOilFoamModule<TypeTag, enableFoam> FoamModule;
typedef BlackOilSaltWaterModule<TypeTag, enableSaltWater> SaltWaterModule;
typedef BlackOilBrineModule<TypeTag, enableBrine> BrineModule;
static_assert(numPhases == 3, "The black-oil model assumes three phases!");
static_assert(numComponents == 3, "The black-oil model assumes three components!");
@ -627,7 +627,7 @@ private:
Scalar saltConcentration_() const
{
if (!enableSaltWater)
if (!enableBrine)
return 0.0;
return (*this)[Indices::saltConcentrationIdx];

View File

@ -55,7 +55,7 @@ NEW_PROP_TAG(BlackoilConserveSurfaceVolume);
//! Enable the ECL-blackoil extension for foam
NEW_PROP_TAG(EnableFoam);
//! Enable the ECL-blackoil extension for salt
NEW_PROP_TAG(EnableSaltWater);
NEW_PROP_TAG(EnableBrine);
//! Allow the spatial and temporal domains to exhibit non-constant temperature

View File

@ -59,7 +59,7 @@ class BlackOilRateVector
typedef BlackOilSolventModule<TypeTag> SolventModule;
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef BlackOilFoamModule<TypeTag> FoamModule;
typedef BlackOilSaltWaterModule<TypeTag> SaltWaterModule;
typedef BlackOilBrineModule<TypeTag> BrineModule;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
@ -70,7 +70,7 @@ class BlackOilRateVector
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enablePolymerMolarWeight = GET_PROP_VALUE(TypeTag, EnablePolymerMW) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableSaltWater = GET_PROP_VALUE(TypeTag, EnableSaltWater) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef Dune::FieldVector<Evaluation, numEq> ParentType;
@ -141,7 +141,7 @@ public:
throw std::logic_error("setMolarRate() not implemented for foam");
}
if ( enableSaltWater ) {
if ( enableBrine ) {
throw std::logic_error("setMolarRate() not implemented for salt water");
}

View File

@ -37,7 +37,7 @@ namespace Opm {
*
* \brief The primary variable and equation indices for the black-oil model.
*/
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, bool enableFoam, bool enableSaltWater, unsigned PVOffset, unsigned disabledCanonicalCompIdx>
template <unsigned numSolventsV, unsigned numPolymersV, unsigned numEnergyV, bool enableFoam, bool enableBrine, unsigned PVOffset, unsigned disabledCanonicalCompIdx>
struct BlackOilTwoPhaseIndices
{
//! Is phase enabled or not
@ -67,13 +67,13 @@ struct BlackOilTwoPhaseIndices
static const int numFoam = enableFoam? 1 : 0;
//! Number of salt equations to be considered
static const int numSaltWater = enableSaltWater? 1 : 0;
static const int numBrine = enableBrine? 1 : 0;
//! The number of fluid phases
static const int numPhases = 2;
//! The number of equations
static const int numEq = numPhases + numSolvents + numPolymers + numEnergy + numFoam + numSaltWater;
static const int numEq = numPhases + numSolvents + numPolymers + numEnergy + numFoam + numBrine;
//////////////////////////////
// Primary variable indices
@ -111,11 +111,11 @@ struct BlackOilTwoPhaseIndices
//! Index of the primary variable for the salt
static const int saltConcentrationIdx =
enableSaltWater ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
//! Index of the primary variable for temperature
static const int temperatureIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numSaltWater : - 1000;
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numBrine : - 1000;
//////////////////////
// Equation indices
@ -179,12 +179,12 @@ struct BlackOilTwoPhaseIndices
enableFoam ? PVOffset + numPhases + numSolvents + numPolymers : -1000;
//! Index of the continuity equation for the salt component
static const int contiSaltWaterEqIdx =
enableSaltWater ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
static const int contiBrineEqIdx =
enableBrine ? PVOffset + numPhases + numSolvents + numPolymers + numFoam : -1000;
//! Index of the continuity equation for energy
static const int contiEnergyEqIdx =
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numSaltWater : -1000;
enableEnergy ? PVOffset + numPhases + numSolvents + numPolymers + numFoam + numBrine : -1000;
};
} // namespace Opm