2019-11-06 13:45:20 -06:00
|
|
|
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
// vi: set et ts=4 sw=4 sts=4:
|
|
|
|
/*
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
Consult the COPYING file in the top-level source directory of this
|
|
|
|
module for the precise wording of the license and the list of
|
|
|
|
copyright holders.
|
|
|
|
*/
|
|
|
|
/*!
|
|
|
|
* \file
|
|
|
|
*
|
2019-12-03 02:05:44 -06:00
|
|
|
* \brief Contains the classes required to extend the black-oil model by brine.
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
2019-12-03 02:05:44 -06:00
|
|
|
#ifndef EWOMS_BLACK_OIL_BRINE_MODULE_HH
|
|
|
|
#define EWOMS_BLACK_OIL_BRINE_MODULE_HH
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
#include "blackoilproperties.hh"
|
|
|
|
#include <opm/models/common/quantitycallbacks.hh>
|
|
|
|
|
|
|
|
#include <opm/material/common/Tabulated1DFunction.hpp>
|
|
|
|
#include <opm/material/common/IntervalTabulated2DFunction.hpp>
|
|
|
|
|
|
|
|
#if HAVE_ECL_INPUT
|
2021-12-14 01:38:58 -06:00
|
|
|
#include <opm/input/eclipse/Deck/Deck.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/Tables/PvtwsaltTable.hpp>
|
2019-11-06 13:45:20 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <opm/material/common/Valgrind.hpp>
|
|
|
|
#include <opm/material/common/Unused.hpp>
|
|
|
|
|
|
|
|
#include <dune/common/fvector.hh>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
/*!
|
|
|
|
* \ingroup BlackOil
|
|
|
|
* \brief Contains the high level supplements required to extend the black oil
|
2019-12-03 02:05:44 -06:00
|
|
|
* model by brine.
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
2020-06-08 09:41:02 -05:00
|
|
|
template <class TypeTag, bool enableBrineV = getPropValue<TypeTag, Properties::EnableBrine>()>
|
2019-12-03 02:05:44 -06:00
|
|
|
class BlackOilBrineModule
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
2020-06-10 06:49:42 -05:00
|
|
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
|
|
|
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
|
|
|
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
|
|
|
|
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
|
|
|
|
using ExtensiveQuantities = GetPropType<TypeTag, Properties::ExtensiveQuantities>;
|
|
|
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
|
|
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
|
|
|
using Model = GetPropType<TypeTag, Properties::Model>;
|
|
|
|
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
|
|
|
using EqVector = GetPropType<TypeTag, Properties::EqVector>;
|
|
|
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
|
|
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
|
|
|
|
2021-05-05 02:50:05 -05:00
|
|
|
using Toolbox = MathToolbox<Evaluation>;
|
2020-06-10 06:49:42 -05:00
|
|
|
|
2021-05-05 02:50:05 -05:00
|
|
|
using TabulatedFunction = Tabulated1DFunction<Scalar>;
|
|
|
|
using TabulatedTwoDFunction = IntervalTabulated2DFunction<Scalar>;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
static constexpr unsigned saltConcentrationIdx = Indices::saltConcentrationIdx;
|
2019-12-03 02:05:44 -06:00
|
|
|
static constexpr unsigned contiBrineEqIdx = Indices::contiBrineEqIdx;
|
2019-11-06 13:45:20 -06:00
|
|
|
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
static constexpr unsigned enableBrine = enableBrineV;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2020-06-08 09:41:02 -05:00
|
|
|
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
|
2019-11-06 13:45:20 -06:00
|
|
|
static constexpr unsigned numPhases = FluidSystem::numPhases;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
#if HAVE_ECL_INPUT
|
|
|
|
/*!
|
2019-12-03 02:05:44 -06:00
|
|
|
* \brief Initialize all internal data structures needed by the brine module
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
2021-05-05 02:50:05 -05:00
|
|
|
static void initFromState(const EclipseState& eclState)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
// some sanity checks: if brine are enabled, the BRINE keyword must be
|
|
|
|
// present, if brine are disabled the keyword must not be present.
|
2020-03-04 08:42:06 -06:00
|
|
|
if (enableBrine && !eclState.runspec().phases().active(Phase::BRINE)) {
|
2019-12-03 02:05:44 -06:00
|
|
|
throw std::runtime_error("Non-trivial brine treatment requested at compile time, but "
|
2019-11-06 13:45:20 -06:00
|
|
|
"the deck does not contain the BRINE keyword");
|
|
|
|
}
|
2020-03-04 08:42:06 -06:00
|
|
|
else if (!enableBrine && eclState.runspec().phases().active(Phase::BRINE)) {
|
2019-12-03 02:05:44 -06:00
|
|
|
throw std::runtime_error("Brine treatment disabled at compile time, but the deck "
|
2019-11-06 13:45:20 -06:00
|
|
|
"contains the BRINE keyword");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-03-04 08:42:06 -06:00
|
|
|
if (!eclState.runspec().phases().active(Phase::BRINE))
|
2019-12-03 02:05:44 -06:00
|
|
|
return; // brine treatment is supposed to be disabled
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
const auto& tableManager = eclState.getTableManager();
|
|
|
|
|
|
|
|
unsigned numPvtRegions = tableManager.getTabdims().getNumPVTTables();
|
|
|
|
referencePressure_.resize(numPvtRegions);
|
|
|
|
|
|
|
|
const auto& pvtwsaltTables = tableManager.getPvtwSaltTables();
|
|
|
|
|
|
|
|
// initialize the objects which deal with the BDENSITY keyword
|
|
|
|
const auto& bdensityTables = tableManager.getBrineDensityTables();
|
|
|
|
if (!bdensityTables.empty()) {
|
|
|
|
bdensityTable_.resize(numPvtRegions);
|
|
|
|
assert(numPvtRegions == bdensityTables.size());
|
|
|
|
for (unsigned pvtRegionIdx = 0; pvtRegionIdx < numPvtRegions; ++ pvtRegionIdx) {
|
|
|
|
const auto& bdensityTable = bdensityTables[pvtRegionIdx];
|
|
|
|
const auto& pvtwsaltTable = pvtwsaltTables[pvtRegionIdx];
|
|
|
|
const auto& c = pvtwsaltTable.getSaltConcentrationColumn();
|
2020-02-06 09:10:06 -06:00
|
|
|
bdensityTable_[pvtRegionIdx].setXYContainers(c, bdensityTable);
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*!
|
2019-12-03 02:05:44 -06:00
|
|
|
* \brief Register all run-time parameters for the black-oil brine module.
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
|
|
|
static void registerParameters()
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
|
|
|
// brine have been disabled at compile time
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool primaryVarApplies(unsigned pvIdx)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
|
|
|
// brine have been disabled at compile time
|
2019-11-06 13:45:20 -06:00
|
|
|
return false;
|
|
|
|
|
|
|
|
return pvIdx == saltConcentrationIdx;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
2019-12-03 02:05:44 -06:00
|
|
|
* \brief Assign the brine specific primary variables to a PrimaryVariables object
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
|
|
|
template <class FluidState>
|
|
|
|
static void assignPrimaryVars(PrimaryVariables& priVars,
|
|
|
|
const FluidState& fluidState)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
priVars[saltConcentrationIdx] = fluidState.saltConcentration();
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
|
2020-04-14 07:16:20 -05:00
|
|
|
static std::string primaryVarName([[maybe_unused]] unsigned pvIdx)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
|
|
|
assert(primaryVarApplies(pvIdx));
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
return "saltConcentration";
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
|
2020-04-14 07:16:20 -05:00
|
|
|
static Scalar primaryVarWeight([[maybe_unused]] unsigned pvIdx)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
|
|
|
assert(primaryVarApplies(pvIdx));
|
|
|
|
|
|
|
|
// TODO: it may be beneficial to chose this differently.
|
|
|
|
return static_cast<Scalar>(1.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool eqApplies(unsigned eqIdx)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return false;
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
return eqIdx == contiBrineEqIdx;
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
|
2020-04-14 07:16:20 -05:00
|
|
|
static std::string eqName([[maybe_unused]] unsigned eqIdx)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
|
|
|
assert(eqApplies(eqIdx));
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
return "conti^brine";
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
|
2020-04-14 07:16:20 -05:00
|
|
|
static Scalar eqWeight([[maybe_unused]] unsigned eqIdx)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
|
|
|
assert(eqApplies(eqIdx));
|
|
|
|
|
|
|
|
// TODO: it may be beneficial to chose this differently.
|
|
|
|
return static_cast<Scalar>(1.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// must be called after water storage is computed
|
|
|
|
template <class LhsEval>
|
|
|
|
static void addStorage(Dune::FieldVector<LhsEval, numEq>& storage,
|
|
|
|
const IntensiveQuantities& intQuants)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
|
|
|
|
const auto& fs = intQuants.fluidState();
|
|
|
|
|
|
|
|
LhsEval surfaceVolumeWater =
|
|
|
|
Toolbox::template decay<LhsEval>(fs.saturation(waterPhaseIdx))
|
|
|
|
* Toolbox::template decay<LhsEval>(fs.invB(waterPhaseIdx))
|
|
|
|
* Toolbox::template decay<LhsEval>(intQuants.porosity());
|
|
|
|
|
|
|
|
// avoid singular matrix if no water is present.
|
2021-05-05 02:50:05 -05:00
|
|
|
surfaceVolumeWater = max(surfaceVolumeWater, 1e-10);
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
// Brine in water phase
|
|
|
|
const LhsEval massBrine = surfaceVolumeWater
|
|
|
|
* Toolbox::template decay<LhsEval>(fs.saltConcentration());
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
storage[contiBrineEqIdx] += massBrine;
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
static void computeFlux(RateVector& flux,
|
|
|
|
const ElementContext& elemCtx,
|
|
|
|
unsigned scvfIdx,
|
|
|
|
unsigned timeIdx)
|
|
|
|
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
|
|
|
|
const auto& extQuants = elemCtx.extensiveQuantities(scvfIdx, timeIdx);
|
|
|
|
|
|
|
|
const unsigned upIdx = extQuants.upstreamIndex(FluidSystem::waterPhaseIdx);
|
|
|
|
const unsigned inIdx = extQuants.interiorIndex();
|
|
|
|
const auto& up = elemCtx.intensiveQuantities(upIdx, timeIdx);
|
|
|
|
|
|
|
|
if (upIdx == inIdx) {
|
2019-12-03 02:05:44 -06:00
|
|
|
flux[contiBrineEqIdx] =
|
2019-11-06 13:45:20 -06:00
|
|
|
extQuants.volumeFlux(waterPhaseIdx)
|
|
|
|
*up.fluidState().invB(waterPhaseIdx)
|
2019-12-03 02:05:44 -06:00
|
|
|
*up.fluidState().saltConcentration();
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
else {
|
2019-12-03 02:05:44 -06:00
|
|
|
flux[contiBrineEqIdx] =
|
2019-11-06 13:45:20 -06:00
|
|
|
extQuants.volumeFlux(waterPhaseIdx)
|
2021-05-05 02:50:05 -05:00
|
|
|
*decay<Scalar>(up.fluidState().invB(waterPhaseIdx))
|
|
|
|
*decay<Scalar>(up.fluidState().saltConcentration());
|
2019-11-06 13:45:20 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Return how much a Newton-Raphson update is considered an error
|
|
|
|
*/
|
2021-08-03 03:10:01 -05:00
|
|
|
static Scalar computeUpdateError(const PrimaryVariables&,
|
|
|
|
const EqVector&)
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
2020-02-13 02:38:39 -06:00
|
|
|
// do not consider consider the change of Brine primary variables for
|
2019-11-06 13:45:20 -06:00
|
|
|
// convergence
|
|
|
|
// TODO: maybe this should be changed
|
|
|
|
return static_cast<Scalar>(0.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class DofEntity>
|
|
|
|
static void serializeEntity(const Model& model, std::ostream& outstream, const DofEntity& dof)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
|
|
|
|
unsigned dofIdx = model.dofMapper().index(dof);
|
|
|
|
const PrimaryVariables& priVars = model.solution(/*timeIdx=*/0)[dofIdx];
|
|
|
|
outstream << priVars[saltConcentrationIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class DofEntity>
|
|
|
|
static void deserializeEntity(Model& model, std::istream& instream, const DofEntity& dof)
|
|
|
|
{
|
2019-12-03 02:05:44 -06:00
|
|
|
if (!enableBrine)
|
2019-11-06 13:45:20 -06:00
|
|
|
return;
|
|
|
|
|
|
|
|
unsigned dofIdx = model.dofMapper().index(dof);
|
|
|
|
PrimaryVariables& priVars0 = model.solution(/*timeIdx=*/0)[dofIdx];
|
|
|
|
PrimaryVariables& priVars1 = model.solution(/*timeIdx=*/1)[dofIdx];
|
|
|
|
|
|
|
|
instream >> priVars0[saltConcentrationIdx];
|
|
|
|
|
|
|
|
// set the primary variables for the beginning of the current time step.
|
|
|
|
priVars1[saltConcentrationIdx] = priVars0[saltConcentrationIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
static const Scalar& referencePressure(const ElementContext& elemCtx,
|
|
|
|
unsigned scvIdx,
|
|
|
|
unsigned timeIdx)
|
|
|
|
{
|
|
|
|
unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx);
|
|
|
|
return referencePressure_[pvtnumRegionIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static const TabulatedFunction& bdensityTable(const ElementContext& elemCtx,
|
|
|
|
unsigned scvIdx,
|
|
|
|
unsigned timeIdx)
|
|
|
|
{
|
|
|
|
unsigned pvtnumRegionIdx = elemCtx.problem().pvtRegionIndex(elemCtx, scvIdx, timeIdx);
|
|
|
|
return bdensityTable_[pvtnumRegionIdx];
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool hasBDensityTables()
|
|
|
|
{
|
|
|
|
return !bdensityTable_.empty();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
static std::vector<TabulatedFunction> bdensityTable_;
|
|
|
|
static std::vector<Scalar> referencePressure_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
template <class TypeTag, bool enableBrineV>
|
|
|
|
std::vector<typename BlackOilBrineModule<TypeTag, enableBrineV>::TabulatedFunction>
|
|
|
|
BlackOilBrineModule<TypeTag, enableBrineV>::bdensityTable_;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
template <class TypeTag, bool enableBrineV>
|
|
|
|
std::vector<typename BlackOilBrineModule<TypeTag, enableBrineV>::Scalar>
|
|
|
|
BlackOilBrineModule<TypeTag, enableBrineV>::referencePressure_;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \ingroup BlackOil
|
2019-12-03 02:05:44 -06:00
|
|
|
* \class Ewoms::BlackOilBrineIntensiveQuantities
|
2019-11-06 13:45:20 -06:00
|
|
|
*
|
|
|
|
* \brief Provides the volumetric quantities required for the equations needed by the
|
2019-12-03 02:05:44 -06:00
|
|
|
* brine extension of the black-oil model.
|
2019-11-06 13:45:20 -06:00
|
|
|
*/
|
2020-06-08 09:41:02 -05:00
|
|
|
template <class TypeTag, bool enableBrineV = getPropValue<TypeTag, Properties::EnableBrine>()>
|
2019-12-03 02:05:44 -06:00
|
|
|
class BlackOilBrineIntensiveQuantities
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
2020-06-10 06:49:42 -05:00
|
|
|
using Implementation = GetPropType<TypeTag, Properties::IntensiveQuantities>;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2020-06-10 06:49:42 -05:00
|
|
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
|
|
|
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
|
|
|
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
|
|
|
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
|
|
|
using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
|
|
|
|
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
|
|
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2020-06-10 06:49:42 -05:00
|
|
|
using BrineModule = BlackOilBrineModule<TypeTag>;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2020-06-08 09:41:02 -05:00
|
|
|
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
2019-11-06 13:45:20 -06:00
|
|
|
static constexpr int saltConcentrationIdx = Indices::saltConcentrationIdx;
|
|
|
|
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
|
|
|
|
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
|
2019-12-03 02:05:44 -06:00
|
|
|
static constexpr unsigned enableBrine = enableBrineV;
|
|
|
|
static constexpr int contiBrineEqIdx = Indices::contiBrineEqIdx;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/*!
|
2019-12-03 02:05:44 -06:00
|
|
|
* \brief Update the intensive properties needed to handle brine from the
|
2019-11-06 13:45:20 -06:00
|
|
|
* primary variables
|
|
|
|
*
|
|
|
|
*/
|
2019-12-03 02:05:44 -06:00
|
|
|
void updateSaltConcentration_(const ElementContext& elemCtx,
|
2019-11-06 13:45:20 -06:00
|
|
|
unsigned dofIdx,
|
|
|
|
unsigned timeIdx)
|
|
|
|
{
|
|
|
|
const PrimaryVariables& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
|
|
|
|
|
|
|
|
auto& fs = asImp_().fluidState_;
|
|
|
|
// set saltconcentration
|
2019-12-03 02:05:44 -06:00
|
|
|
fs.setSaltConcentration(priVars.makeEvaluation(saltConcentrationIdx, timeIdx));
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
const Evaluation& saltConcentration() const
|
|
|
|
{ return saltConcentration_; }
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
const Evaluation& brineRefDensity() const
|
2019-11-06 13:45:20 -06:00
|
|
|
{ return refDensity_; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Implementation& asImp_()
|
|
|
|
{ return *static_cast<Implementation*>(this); }
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
Evaluation saltConcentration_;
|
2019-11-06 13:45:20 -06:00
|
|
|
Evaluation refDensity_;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
template <class TypeTag>
|
2019-12-03 02:05:44 -06:00
|
|
|
class BlackOilBrineIntensiveQuantities<TypeTag, false>
|
2019-11-06 13:45:20 -06:00
|
|
|
{
|
2020-06-10 06:49:42 -05:00
|
|
|
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
|
|
|
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
|
|
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
public:
|
2021-08-03 03:10:01 -05:00
|
|
|
void updateSaltConcentration_(const ElementContext&,
|
|
|
|
unsigned,
|
|
|
|
unsigned)
|
2019-11-06 13:45:20 -06:00
|
|
|
{ }
|
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
const Evaluation& saltConcentration() const
|
|
|
|
{ throw std::runtime_error("saltConcentration() called but brine are disabled"); }
|
2019-11-06 13:45:20 -06:00
|
|
|
|
2019-12-03 02:05:44 -06:00
|
|
|
const Evaluation& brineRefDensity() const
|
|
|
|
{ throw std::runtime_error("brineRefDensity() called but brine are disabled"); }
|
2019-11-06 13:45:20 -06:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Ewoms
|
|
|
|
|
|
|
|
#endif
|