Merge pull request #5448 from atgeirr/ensure-initialized-members-bdystate

Ensure all members are initialized in FlowProblem::boundaryFluidState().
This commit is contained in:
Markus Blatt 2024-07-04 16:43:05 +02:00 committed by GitHub
commit 0caf92c6a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1618,6 +1618,7 @@ public:
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) {
@ -1629,10 +1630,10 @@ public:
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)
@ -1658,9 +1659,8 @@ public:
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);