Skip to content

Commit

Permalink
Merge pull request #5448 from atgeirr/ensure-initialized-members-bdys…
Browse files Browse the repository at this point in the history
…tate

Ensure all members are initialized in FlowProblem::boundaryFluidState().
  • Loading branch information
blattms authored Jul 4, 2024
2 parents 3450297 + a3839aa commit 0caf92c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions opm/simulators/flow/FlowProblem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,7 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
throw std::logic_error("you need to specify a valid component (OIL, WATER or GAS) when DIRICHLET type is set in BC");
break;
}
fluidState.setTotalSaturation(1.0);
double pressure = initialFluidStates_[globalDofIdx].pressure(refPressurePhaseIdx_());
const auto pressure_input = bc.pressure;
if (pressure_input) {
Expand All @@ -1629,10 +1630,10 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
MaterialLaw::capillaryPressures(pc, matParams, fluidState);
Valgrind::CheckDefined(pressure);
Valgrind::CheckDefined(pc);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx))
continue;
for (unsigned activePhaseIdx = 0; activePhaseIdx < FluidSystem::numActivePhases(); ++activePhaseIdx) {
const auto phaseIdx = FluidSystem::activeToCanonicalPhaseIdx(activePhaseIdx);

fluidState.setPc(phaseIdx, pc[phaseIdx]);
if (Indices::oilEnabled)
fluidState.setPressure(phaseIdx, pressure + (pc[phaseIdx] - pc[oilPhaseIdx]));
else if (Indices::gasEnabled)
Expand All @@ -1658,9 +1659,8 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
if (FluidSystem::enableVaporizedWater())
fluidState.setRvw(0.0);

for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx))
continue;
for (unsigned activePhaseIdx = 0; activePhaseIdx < FluidSystem::numActivePhases(); ++activePhaseIdx) {
const auto phaseIdx = FluidSystem::activeToCanonicalPhaseIdx(activePhaseIdx);

const auto& b = FluidSystem::inverseFormationVolumeFactor(fluidState, phaseIdx, pvtRegionIdx);
fluidState.setInvB(phaseIdx, b);
Expand Down

0 comments on commit 0caf92c

Please sign in to comment.