From d4bb9c0611150974eb06557d4e6b13d0c35a9f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 7 Oct 2013 12:46:35 +0200 Subject: [PATCH] Guard against erroneous use of initBlackoilSurfvol(). --- opm/core/simulator/initState_impl.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opm/core/simulator/initState_impl.hpp b/opm/core/simulator/initState_impl.hpp index 734abc3f3..a0b47bbfd 100644 --- a/opm/core/simulator/initState_impl.hpp +++ b/opm/core/simulator/initState_impl.hpp @@ -616,6 +616,10 @@ namespace Opm const BlackoilPropertiesInterface& props, State& state) { + if (props.numPhases() != 3) { + OPM_THROW(std::runtime_error, "initBlackoilSurfvol() can for now only be used with 3 phases."); + } + const std::vector& rs = state.gasoilratio(); //make input for computation of the A matrix