adding the three swapping functions to WellInterface

They should only be used to change the order related to the reservoir
variables, so they should be same for all the well models and should be
put in the WelInterface.
This commit is contained in:
Kai Bao 2017-06-19 15:05:15 +02:00
parent 1a4ceeec66
commit ff2ada66bc
2 changed files with 56 additions and 2 deletions

View File

@ -50,10 +50,14 @@ namespace Opm
{
public:
// TODO: Simulator will probably enter template parameter through TypeTag later
using Simulator = SimulatorFullyImplicitBlackoilEbos;
using WellState = WellStateFullyImplicitBlackoilDense;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) BlackoilIndices;
static const int solventCompIdx = 3; //TODO get this from ebos
/// Constructor
WellInterface(const Well* well, const int time_step, const Wells* wells);
@ -117,6 +121,12 @@ namespace Opm
const PhaseUsage& phaseUsage() const;
int flowPhaseToEbosCompIdx( const int phaseIdx ) const;
int flowToEbosPvIdx( const int flowPv ) const;
int flowPhaseToEbosPhaseIdx( const int phaseIdx ) const;
protected:
// well name
std::string name_;

View File

@ -252,4 +252,48 @@ namespace Opm
}
template<typename TypeTag>
int
WellInterface<TypeTag>::
flowPhaseToEbosCompIdx( const int phaseIdx ) const
{
const int phaseToComp[ 4 ] = { FluidSystem::waterCompIdx, FluidSystem::oilCompIdx, FluidSystem::gasCompIdx, solventCompIdx };
return phaseToComp[ phaseIdx ];
}
template<typename TypeTag>
int
WellInterface<TypeTag>::
flowToEbosPvIdx( const int flowPv ) const
{
const int flowToEbos[ 4 ] = {
BlackoilIndices::pressureSwitchIdx,
BlackoilIndices::waterSaturationIdx,
BlackoilIndices::compositionSwitchIdx,
BlackoilIndices::solventSaturationIdx
};
return flowToEbos[ flowPv ];
}
template<typename TypeTag>
int
WellInterface<TypeTag>::
flowPhaseToEbosPhaseIdx( const int phaseIdx ) const
{
assert(phaseIdx < 3);
const int flowToEbos[ 3 ] = { FluidSystem::waterPhaseIdx, FluidSystem::oilPhaseIdx, FluidSystem::gasPhaseIdx };
return flowToEbos[ phaseIdx ];
}
}