mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4290 from totto82/refactor_primaryVars_Meaning
adapt to primary variable refactoring
This commit is contained in:
commit
7e8b0d5700
@ -1738,7 +1738,7 @@ public:
|
||||
values[Indices::polymerMoleWeightIdx]= this->polymerMoleWeight_[globalDofIdx];
|
||||
|
||||
if constexpr (enableBrine) {
|
||||
if (enableSaltPrecipitation && values.primaryVarsMeaningBrine() == PrimaryVariables::Sp) {
|
||||
if (enableSaltPrecipitation && values.primaryVarsMeaningBrine() == PrimaryVariables::BrineMeaning::Sp) {
|
||||
values[Indices::saltConcentrationIdx] = initialFluidStates_[globalDofIdx].saltSaturation();
|
||||
}
|
||||
else {
|
||||
|
@ -462,14 +462,16 @@ namespace Opm {
|
||||
|
||||
Scalar saturationsNew[FluidSystem::numPhases] = { 0.0 };
|
||||
Scalar oilSaturationNew = 1.0;
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && FluidSystem::numActivePhases() > 1) {
|
||||
saturationsNew[FluidSystem::waterPhaseIdx] = priVarsNew[Indices::waterSaturationIdx];
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) &&
|
||||
FluidSystem::numActivePhases() > 1 &&
|
||||
priVarsNew.primaryVarsMeaningWater() == PrimaryVariables::WaterMeaning::Sw) {
|
||||
saturationsNew[FluidSystem::waterPhaseIdx] = priVarsNew[Indices::waterSwitchIdx];
|
||||
oilSaturationNew -= saturationsNew[FluidSystem::waterPhaseIdx];
|
||||
}
|
||||
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) &&
|
||||
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) &&
|
||||
priVarsNew.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg) {
|
||||
priVarsNew.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Sg) {
|
||||
assert(Indices::compositionSwitchIdx >= 0 );
|
||||
saturationsNew[FluidSystem::gasPhaseIdx] = priVarsNew[Indices::compositionSwitchIdx];
|
||||
oilSaturationNew -= saturationsNew[FluidSystem::gasPhaseIdx];
|
||||
@ -493,14 +495,12 @@ namespace Opm {
|
||||
resultDenom += pressureNew*pressureNew;
|
||||
|
||||
if (FluidSystem::numActivePhases() > 1) {
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSaturationIdx];
|
||||
if (priVarsOld.primaryVarsMeaningWater() == PrimaryVariables::WaterMeaning::Sw) {
|
||||
saturationsOld[FluidSystem::waterPhaseIdx] = priVarsOld[Indices::waterSwitchIdx];
|
||||
oilSaturationOld -= saturationsOld[FluidSystem::waterPhaseIdx];
|
||||
}
|
||||
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) &&
|
||||
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) &&
|
||||
priVarsOld.primaryVarsMeaning() == PrimaryVariables::Sw_po_Sg)
|
||||
if (priVarsOld.primaryVarsMeaningGas() == PrimaryVariables::GasMeaning::Sg)
|
||||
{
|
||||
assert(Indices::compositionSwitchIdx >= 0 );
|
||||
saturationsOld[FluidSystem::gasPhaseIdx] = priVarsOld[Indices::compositionSwitchIdx];
|
||||
|
@ -73,7 +73,7 @@ protected:
|
||||
// GFrac 2 1 -1000 -1000 -1000
|
||||
// Spres 3 2 2 2 1
|
||||
|
||||
static constexpr bool has_water = (Indices::waterSaturationIdx >= 0);
|
||||
static constexpr bool has_water = (Indices::waterSwitchIdx >= 0);
|
||||
static constexpr bool has_gas = (Indices::compositionSwitchIdx >= 0);
|
||||
static constexpr bool has_oil = (Indices::numPhases - has_gas - has_water) > 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user