changed: move fluidsystem-only dependent method to WellInterfaceFluidSystem

This commit is contained in:
Arne Morten Kvarving
2021-05-31 13:21:31 +02:00
parent ce3d2b17dd
commit 1fb68c59e2
4 changed files with 21 additions and 21 deletions

View File

@@ -899,6 +899,23 @@ checkMaxRatioLimitWell(const WellState& well_state,
return (well_ratio > max_ratio_limit);
}
template<typename FluidSystem>
int
WellInterfaceFluidSystem<FluidSystem>::
flowPhaseToEbosPhaseIdx(const int phaseIdx) const
{
const auto& pu = this->phaseUsage();
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx) && pu.phase_pos[Water] == phaseIdx)
return FluidSystem::waterPhaseIdx;
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx) && pu.phase_pos[Oil] == phaseIdx)
return FluidSystem::oilPhaseIdx;
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx) && pu.phase_pos[Gas] == phaseIdx)
return FluidSystem::gasPhaseIdx;
// for other phases return the index
return phaseIdx;
}
template class WellInterfaceFluidSystem<BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>>;
template class WellInterfaceFluidSystem<BlackOilFluidSystem<double,EclAlternativeBlackOilIndexTraits>>;