RateConverter: throw an exception, not a bare string

This commit is contained in:
Arne Morten Kvarving
2023-03-06 08:48:50 +01:00
parent fb076a7acc
commit aeee2ad9d3

View File

@@ -328,9 +328,9 @@ namespace Opm {
// Currently we only support either gas in water or gas in oil // Currently we only support either gas in water or gas in oil
// not both // not both
if(detR != 1 && detRw != 1 ) { if (detR != 1 && detRw != 1) {
std::string msg = "only support " + std::to_string(detR) + " " + std::to_string(detR); std::string msg = "only support " + std::to_string(detR) + " " + std::to_string(detR);
throw(msg); throw std::range_error(msg);
} }
if (RegionAttributeHelpers::PhaseUsed::oil(pu)) { if (RegionAttributeHelpers::PhaseUsed::oil(pu)) {
@@ -536,9 +536,9 @@ namespace Opm {
// we only support either gas in water // we only support either gas in water
// or gas in oil // or gas in oil
if(detR != 1 && detRw != 1 ) { if (detR != 1 && detRw != 1) {
std::string msg = "only support " + std::to_string(detR) + " " + std::to_string(detR); std::string msg = "only support " + std::to_string(detR) + " " + std::to_string(detR);
throw(msg); throw std::range_error(msg);
} }
if (RegionAttributeHelpers::PhaseUsed::gas(pu)) { if (RegionAttributeHelpers::PhaseUsed::gas(pu)) {
// q[g]_r = 1/(bg * (1 - rs*rv)) * (q[g]_s - rs*q[o]_s) // q[g]_r = 1/(bg * (1 - rs*rv)) * (q[g]_s - rs*q[o]_s)