Fix generic boundary conditions for blackoil model

Currently it doesn't allow for polymer or solvent influx
on the boundary with the free flow option
This commit is contained in:
Tor Harald Sandve
2019-01-31 08:06:15 +01:00
parent 70a7207578
commit fb34eb304c
2 changed files with 28 additions and 3 deletions

View File

@@ -426,11 +426,15 @@ protected:
// only works for the element centered finite volume method. for ebos this // only works for the element centered finite volume method. for ebos this
// does not matter, though. // does not matter, though.
unsigned upstreamIdx = upstreamIndex_(phaseIdx); unsigned upstreamIdx = upstreamIndex_(phaseIdx);
const auto& up = elemCtx.intensiveQuantities(upstreamIdx, timeIdx); if (upstreamIdx == interiorDofIdx_) {
if (upstreamIdx == interiorDofIdx_) const auto& up = elemCtx.intensiveQuantities(upstreamIdx, timeIdx);
volumeFlux_[phaseIdx] = volumeFlux_[phaseIdx] =
pressureDifference_[phaseIdx]*up.mobility(phaseIdx)*(-trans/faceArea); pressureDifference_[phaseIdx]*up.mobility(phaseIdx)*(-trans/faceArea);
else {
if (enableSolvent && phaseIdx == gasPhaseIdx) {
asImp_().setSolventVolumeFlux( pressureDifference_[phaseIdx]*up.solventMobility()*(-trans/faceArea));
}
} else {
// compute the phase mobility using the material law parameters of the // compute the phase mobility using the material law parameters of the
// interior element. TODO: this could probably be done more efficiently // interior element. TODO: this could probably be done more efficiently
const auto& matParams = const auto& matParams =
@@ -443,6 +447,11 @@ protected:
const auto& mob = kr[phaseIdx]/exFluidState.viscosity(phaseIdx); const auto& mob = kr[phaseIdx]/exFluidState.viscosity(phaseIdx);
volumeFlux_[phaseIdx] = volumeFlux_[phaseIdx] =
pressureDifference_[phaseIdx]*mob*(-trans/faceArea); pressureDifference_[phaseIdx]*mob*(-trans/faceArea);
// Solvent inflow is not yet supported
if (enableSolvent && phaseIdx == gasPhaseIdx) {
asImp_().setSolventVolumeFlux( 0.0 );
}
} }
} }
} }

View File

@@ -1306,6 +1306,7 @@ public:
unsigned globalDofIdx = context.globalSpaceIndex(interiorDofIdx, timeIdx); unsigned globalDofIdx = context.globalSpaceIndex(interiorDofIdx, timeIdx);
values.setThermalFlow(context, spaceIdx, timeIdx, initialFluidStates_[globalDofIdx]); values.setThermalFlow(context, spaceIdx, timeIdx, initialFluidStates_[globalDofIdx]);
} }
} }
/*! /*!
@@ -2051,6 +2052,21 @@ private:
dofFluidState.setRv(rvData[cartesianDofIdx]); dofFluidState.setRv(rvData[cartesianDofIdx]);
else if (Indices::gasEnabled && Indices::oilEnabled) else if (Indices::gasEnabled && Indices::oilEnabled)
dofFluidState.setRv(0.0); dofFluidState.setRv(0.0);
//////
// set invB_
//////
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx))
continue;
const auto& b = FluidSystem::inverseFormationVolumeFactor(dofFluidState, phaseIdx, pvtRegionIndex(dofIdx));
dofFluidState.setInvB(phaseIdx, b);
const auto& rho = FluidSystem::density(dofFluidState, phaseIdx, pvtRegionIndex(dofIdx));
dofFluidState.setDensity(phaseIdx, rho);
}
} }
} }