mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-08-27 06:27:13 -05:00
Throw exception instead of using assert
Throw an exception if two-phase gas lift optimization is used for other phases than oil and water.
This commit is contained in:
@@ -109,13 +109,18 @@ WellInterfaceGeneric::WellInterfaceGeneric(const Well& well,
|
||||
void WellInterfaceGeneric::adaptRatesForVFP(std::vector<double>& rates) const
|
||||
{
|
||||
const auto& pu = this->phaseUsage();
|
||||
if (pu.num_phases == 2
|
||||
&& pu.phase_used[BlackoilPhases::Aqua] == 1
|
||||
&& pu.phase_used[BlackoilPhases::Liquid] == 1
|
||||
&& pu.phase_used[BlackoilPhases::Vapour] == 0)
|
||||
{
|
||||
assert(rates.size() == 2);
|
||||
rates.push_back(0.0); // set gas rate to zero
|
||||
if (pu.num_phases == 2) {
|
||||
if ( pu.phase_used[BlackoilPhases::Aqua] == 1
|
||||
&& pu.phase_used[BlackoilPhases::Liquid] == 1
|
||||
&& pu.phase_used[BlackoilPhases::Vapour] == 0)
|
||||
{
|
||||
assert(rates.size() == 2);
|
||||
rates.push_back(0.0); // set gas rate to zero
|
||||
}
|
||||
else {
|
||||
throw std::logic_error("Two-phase VFP calculation only "
|
||||
"supported for oil and water");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user