mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-02 12:36:54 -06:00
Merge pull request #665 from plgbrts/gw1
adjustments needed for gas-water system
This commit is contained in:
commit
288c46e10d
@ -96,8 +96,10 @@ class BlackOilIntensiveQuantities
|
||||
enum { dimWorld = GridView::dimensionworld };
|
||||
enum { compositionSwitchIdx = Indices::compositionSwitchIdx };
|
||||
|
||||
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
||||
static const bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0;
|
||||
static const bool waterEnabled = Indices::waterEnabled;
|
||||
static const bool gasEnabled = Indices::gasEnabled;
|
||||
static const bool oilEnabled = Indices::oilEnabled;
|
||||
|
||||
using Toolbox = MathToolbox<Evaluation>;
|
||||
using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
|
||||
@ -167,6 +169,9 @@ public:
|
||||
Sg = 0.0;
|
||||
}
|
||||
}
|
||||
if (gasEnabled && waterEnabled && !oilEnabled) {
|
||||
Sg = 1.0 - Sw;
|
||||
}
|
||||
|
||||
Valgrind::CheckDefined(Sg);
|
||||
Valgrind::CheckDefined(Sw);
|
||||
|
@ -279,7 +279,7 @@ class BlackOilModel
|
||||
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
|
||||
enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
|
||||
|
||||
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
||||
static const bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0;
|
||||
static const bool waterEnabled = Indices::waterEnabled;
|
||||
|
||||
using SolventModule = BlackOilSolventModule<TypeTag>;
|
||||
|
@ -247,6 +247,7 @@ protected:
|
||||
static constexpr bool enableEnergy = Indices::temperatureIdx >= 0;
|
||||
static constexpr bool enableFoam = Indices::foamConcentrationIdx >= 0;
|
||||
static constexpr bool enableBrine = Indices::saltConcentrationIdx >= 0;
|
||||
static constexpr bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0;
|
||||
|
||||
currentValue.checkDefined();
|
||||
Valgrind::CheckDefined(update);
|
||||
@ -263,7 +264,7 @@ protected:
|
||||
deltaSo = -deltaSw;
|
||||
}
|
||||
|
||||
if (Indices::gasEnabled && currentValue.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg) {
|
||||
if (compositionSwitchEnabled && currentValue.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg) {
|
||||
deltaSg = update[Indices::compositionSwitchIdx];
|
||||
deltaSo -= deltaSg;
|
||||
}
|
||||
|
@ -86,8 +86,10 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
|
||||
enum { pressureSwitchIdx = Indices::pressureSwitchIdx };
|
||||
enum { compositionSwitchIdx = Indices::compositionSwitchIdx };
|
||||
|
||||
static const bool compositionSwitchEnabled = Indices::gasEnabled;
|
||||
static const bool compositionSwitchEnabled = Indices::compositionSwitchIdx >= 0;
|
||||
static const bool waterEnabled = Indices::waterEnabled;
|
||||
static const bool gasEnabled = Indices::gasEnabled;
|
||||
static const bool oilEnabled = Indices::oilEnabled;
|
||||
|
||||
// phase indices from the fluid system
|
||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||
@ -315,7 +317,13 @@ public:
|
||||
else if (primaryVarsMeaning() == Sw_po_Sg) {
|
||||
if (waterEnabled)
|
||||
(*this)[waterSaturationIdx] = FsToolbox::value(fluidState.saturation(waterPhaseIdx));
|
||||
(*this)[pressureSwitchIdx] = FsToolbox::value(fluidState.pressure(oilPhaseIdx));
|
||||
if (gasEnabled && waterEnabled && !oilEnabled) {
|
||||
//-> water-gas system
|
||||
(*this)[pressureSwitchIdx] = FsToolbox::value(fluidState.pressure(gasPhaseIdx));
|
||||
}
|
||||
else if (oilEnabled) {
|
||||
(*this)[pressureSwitchIdx] = FsToolbox::value(fluidState.pressure(oilPhaseIdx));
|
||||
}
|
||||
if( compositionSwitchEnabled )
|
||||
(*this)[compositionSwitchIdx] = FsToolbox::value(fluidState.saturation(gasPhaseIdx));
|
||||
}
|
||||
|
@ -95,9 +95,9 @@ struct BlackOilTwoPhaseIndices
|
||||
* \brief Index of the switching variable which determines the composition of the
|
||||
* hydrocarbon phases.
|
||||
*
|
||||
* \note For two-phase water oil models this is disabled.
|
||||
* \note For two-phase water oil and water gas models this is disabled.
|
||||
*/
|
||||
static const int compositionSwitchIdx = gasEnabled ? PVOffset + 1 : -10000;
|
||||
static const int compositionSwitchIdx = (gasEnabled && oilEnabled) ? PVOffset + 1 : -10000;
|
||||
|
||||
//! Index of the primary variable for the first solvent
|
||||
static const int solventSaturationIdx =
|
||||
|
Loading…
Reference in New Issue
Block a user