mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-03 13:20:30 -06:00
changed: move fluidsystem-only dependent method to WellInterfaceFluidSystem
This commit is contained in:
parent
ce3d2b17dd
commit
1fb68c59e2
@ -294,8 +294,6 @@ protected:
|
|||||||
|
|
||||||
int flowPhaseToEbosCompIdx( const int phaseIdx ) const;
|
int flowPhaseToEbosCompIdx( const int phaseIdx ) const;
|
||||||
|
|
||||||
int flowPhaseToEbosPhaseIdx( const int phaseIdx ) const;
|
|
||||||
|
|
||||||
int ebosCompIdxToFlowCompIdx( const unsigned compIdx ) const;
|
int ebosCompIdxToFlowCompIdx( const unsigned compIdx ) const;
|
||||||
|
|
||||||
double wpolymer() const;
|
double wpolymer() const;
|
||||||
|
@ -899,6 +899,23 @@ checkMaxRatioLimitWell(const WellState& well_state,
|
|||||||
return (well_ratio > max_ratio_limit);
|
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,BlackOilDefaultIndexTraits>>;
|
||||||
template class WellInterfaceFluidSystem<BlackOilFluidSystem<double,EclAlternativeBlackOilIndexTraits>>;
|
template class WellInterfaceFluidSystem<BlackOilFluidSystem<double,EclAlternativeBlackOilIndexTraits>>;
|
||||||
|
|
||||||
|
@ -50,6 +50,8 @@ public:
|
|||||||
WellTestState& wellTestState,
|
WellTestState& wellTestState,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
int flowPhaseToEbosPhaseIdx(const int phaseIdx) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using RateConverterType = RateConverter::
|
using RateConverterType = RateConverter::
|
||||||
SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>;
|
SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>;
|
||||||
|
@ -91,23 +91,6 @@ namespace Opm
|
|||||||
return phaseIdx;
|
return phaseIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TypeTag>
|
|
||||||
int
|
|
||||||
WellInterface<TypeTag>::
|
|
||||||
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<typename TypeTag>
|
template<typename TypeTag>
|
||||||
int
|
int
|
||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
@ -1008,11 +991,11 @@ namespace Opm
|
|||||||
const double well_tw_fraction = this->well_index_[perf] / total_tw;
|
const double well_tw_fraction = this->well_index_[perf] / total_tw;
|
||||||
double total_mobility = 0.0;
|
double total_mobility = 0.0;
|
||||||
for (int p = 0; p < np; ++p) {
|
for (int p = 0; p < np; ++p) {
|
||||||
int ebosPhaseIdx = flowPhaseToEbosPhaseIdx(p);
|
int ebosPhaseIdx = this->flowPhaseToEbosPhaseIdx(p);
|
||||||
total_mobility += fs.invB(ebosPhaseIdx).value() * intQuants.mobility(ebosPhaseIdx).value();
|
total_mobility += fs.invB(ebosPhaseIdx).value() * intQuants.mobility(ebosPhaseIdx).value();
|
||||||
}
|
}
|
||||||
for (int p = 0; p < np; ++p) {
|
for (int p = 0; p < np; ++p) {
|
||||||
int ebosPhaseIdx = flowPhaseToEbosPhaseIdx(p);
|
int ebosPhaseIdx = this->flowPhaseToEbosPhaseIdx(p);
|
||||||
scaling_factor[p] += well_tw_fraction * fs.invB(ebosPhaseIdx).value() * intQuants.mobility(ebosPhaseIdx).value() / total_mobility;
|
scaling_factor[p] += well_tw_fraction * fs.invB(ebosPhaseIdx).value() * intQuants.mobility(ebosPhaseIdx).value() / total_mobility;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user