mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Surface Density: Explicitly Recognise Failure Path
Use the "throw if invalid phase" approach.
This commit is contained in:
parent
32eb83712f
commit
3d5dca4693
@ -385,7 +385,8 @@ namespace Opm
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
double ECLFluxCalc::surfaceDensity(const ECLPhaseIndex phase) const{
|
double ECLFluxCalc::surfaceDensity(const ECLPhaseIndex phase) const
|
||||||
|
{
|
||||||
switch (phase) {
|
switch (phase) {
|
||||||
case ECLPhaseIndex::Aqua:
|
case ECLPhaseIndex::Aqua:
|
||||||
return this->pvtWat_->surfaceMassDensity(0);
|
return this->pvtWat_->surfaceMassDensity(0);
|
||||||
@ -396,6 +397,11 @@ namespace Opm
|
|||||||
case ECLPhaseIndex::Vapour:
|
case ECLPhaseIndex::Vapour:
|
||||||
return this->pvtGas_->surfaceMassDensity(0);
|
return this->pvtGas_->surfaceMassDensity(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw std::invalid_argument {
|
||||||
|
"Unsupported Phase Index " +
|
||||||
|
std::to_string(static_cast<std::size_t>(phase))
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user