Merge pull request #282 from andlaus/separate_opm-common_concerns

adapt to the move of code from opm-common to opm-material
This commit is contained in:
Andreas Lauser 2018-02-08 16:25:10 +01:00 committed by GitHub
commit 61461dd61c
13 changed files with 80 additions and 121 deletions

View File

@ -25,8 +25,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <array> #include <array>
#include <vector> #include <vector>
@ -226,7 +225,7 @@ namespace Ewoms
coords[ 0 ] = gc ; coords[ 0 ] = gc ;
} }
else else
OPM_THROW(Opm::NotImplemented,"cartesianCoordinate not implemented for dimension " << dimension ); throw std::invalid_argument("cartesianCoordinate not implemented for dimension " << dimension );
} }
template <class GridView> template <class GridView>

View File

@ -37,8 +37,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp> #include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/grid/common/mcmgmapper.hh> #include <dune/grid/common/mcmgmapper.hh>
@ -135,7 +134,7 @@ namespace Ewoms
{ {
// we should only get one link // we should only get one link
if( link != 0 ) { if( link != 0 ) {
OPM_THROW(std::logic_error,"link in method pack is not 0 as execpted"); throw std::logic_error("link in method pack is not 0 as execpted");
} }
// pack all interior global cell id's // pack all interior global cell id's
@ -328,7 +327,7 @@ namespace Ewoms
{ {
// we should only get one link // we should only get one link
if( link != 0 ) { if( link != 0 ) {
OPM_THROW(std::logic_error,"link in method pack is not 0 as expected"); throw std::logic_error("link in method pack is not 0 as expected");
} }
// write all cell data registered in local state // write all cell data registered in local state
@ -486,10 +485,10 @@ namespace Ewoms
// the last indexMap is the local one // the last indexMap is the local one
const IndexMapType& indexMap = indexMaps_.back(); const IndexMapType& indexMap = indexMaps_.back();
if( indexMap.empty() ) if( indexMap.empty() )
OPM_THROW(std::logic_error,"index map is not created on this rank"); throw std::logic_error("index map is not created on this rank");
if (localIdx > indexMap.size()) if (localIdx > indexMap.size())
OPM_THROW(std::logic_error,"local index is outside map range"); throw std::logic_error("local index is outside map range");
return indexMap[localIdx]; return indexMap[localIdx];
} }
@ -510,7 +509,7 @@ namespace Ewoms
// the last indexMap is the local one // the last indexMap is the local one
const IndexMapType& indexMap = indexMaps_.back(); const IndexMapType& indexMap = indexMaps_.back();
if( indexMap.empty() ) if( indexMap.empty() )
OPM_THROW(std::logic_error,"index map is not created on this rank"); throw std::logic_error("index map is not created on this rank");
return std::find(indexMap.begin(), indexMap.end(), globalIdx) != indexMap.end(); return std::find(indexMap.begin(), indexMap.end(), globalIdx) != indexMap.end();
} }

View File

@ -30,8 +30,7 @@
#include <ewoms/disc/common/fvbaseproperties.hh> #include <ewoms/disc/common/fvbaseproperties.hh>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
@ -71,8 +70,7 @@ public:
unsigned fapIdx OPM_UNUSED, unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const const QuantityCallback& quantityCallback OPM_UNUSED) const
{ {
OPM_THROW(std::logic_error, throw std::logic_error("Generic values are not supported by the ECL black-oil simulator");
"Generic values are not supported by the ECL black-oil simulator");
} }
template <class QuantityCallback> template <class QuantityCallback>
@ -81,8 +79,7 @@ public:
unsigned fapIdx OPM_UNUSED, unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const const QuantityCallback& quantityCallback OPM_UNUSED) const
{ {
OPM_THROW(std::logic_error, throw std::logic_error("Generic gradients are not supported by the ECL black-oil simulator");
"Generic gradients are not supported by the ECL black-oil simulator");
} }
template <class QuantityCallback> template <class QuantityCallback>
@ -90,8 +87,7 @@ public:
unsigned fapIdx OPM_UNUSED, unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const QuantityCallback& quantityCallback OPM_UNUSED)
{ {
OPM_THROW(std::logic_error, throw std::logic_error("Generic boundary values are not supported by the ECL black-oil simulator");
"Generic boundary values are not supported by the ECL black-oil simulator");
} }
template <class QuantityCallback> template <class QuantityCallback>
@ -100,8 +96,7 @@ public:
unsigned fapIdx OPM_UNUSED, unsigned fapIdx OPM_UNUSED,
const QuantityCallback& quantityCallback OPM_UNUSED) const const QuantityCallback& quantityCallback OPM_UNUSED) const
{ {
OPM_THROW(std::logic_error, throw std::logic_error("Generic boundary gradients are not supported by the ECL black-oil simulator");
"Generic boundary gradients are not supported by the ECL black-oil simulator");
} }
}; };
} // namespace Ewoms } // namespace Ewoms

View File

@ -35,9 +35,8 @@
#include <ewoms/models/blackoil/blackoilproperties.hh> #include <ewoms/models/blackoil/blackoilproperties.hh>
#include <ewoms/common/signum.hh> #include <ewoms/common/signum.hh>
#include <opm/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
@ -128,8 +127,7 @@ public:
*/ */
const DimMatrix& intrinsicPermeability() const const DimMatrix& intrinsicPermeability() const
{ {
OPM_THROW(Opm::NotImplemented, throw std::invalid_argument("The ECL transmissibility module does not provide an explicit intrinsic permeability");
"The ECL transmissibility module does not provide an explicit intrinsic permeability");
} }
/*! /*!
@ -140,8 +138,7 @@ public:
*/ */
const EvalDimVector& potentialGrad(unsigned phaseIdx OPM_UNUSED) const const EvalDimVector& potentialGrad(unsigned phaseIdx OPM_UNUSED) const
{ {
OPM_THROW(Opm::NotImplemented, throw std::invalid_argument("The ECL transmissibility module does not provide explicit potential gradients");
"The ECL transmissibility module does not provide explicit potential gradients");
} }
/*! /*!
@ -161,8 +158,7 @@ public:
*/ */
const EvalDimVector& filterVelocity(unsigned phaseIdx OPM_UNUSED) const const EvalDimVector& filterVelocity(unsigned phaseIdx OPM_UNUSED) const
{ {
OPM_THROW(Opm::NotImplemented, throw std::invalid_argument("The ECL transmissibility module does not provide explicit filter velocities");
"The ECL transmissibility module does not provide explicit filter velocities");
} }
/*! /*!

View File

@ -32,7 +32,7 @@
#include <ewoms/common/propertysystem.hh> #include <ewoms/common/propertysystem.hh>
#include <ewoms/common/parametersystem.hh> #include <ewoms/common/parametersystem.hh>
#include <opm/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/parser/eclipse/Units/Units.hpp> #include <opm/parser/eclipse/Units/Units.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/output/data/Cells.hpp> #include <opm/output/data/Cells.hpp>
@ -439,7 +439,7 @@ public:
try { try {
bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex())); bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex()));
} }
catch (const Opm::NumericalProblem& e) { catch (const Opm::NumericalIssue& e) {
const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx]; const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx];
failedCellsPb_.push_back(globalIdx); failedCellsPb_.push_back(globalIdx);
} }
@ -449,7 +449,7 @@ public:
try { try {
dewPointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::dewPointPressure(fs, intQuants.pvtRegionIndex())); dewPointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::dewPointPressure(fs, intQuants.pvtRegionIndex()));
} }
catch (const Opm::NumericalProblem& e) { catch (const Opm::NumericalIssue& e) {
const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx]; const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx];
failedCellsPd_.push_back(globalIdx); failedCellsPd_.push_back(globalIdx);
} }
@ -1154,7 +1154,7 @@ private:
// nothing to do // nothing to do
} }
else { else {
OPM_THROW(std::runtime_error, "Unsupported unit type for fluid in place output."); throw std::runtime_error("Unsupported unit type for fluid in place output.");
} }
} }
@ -1166,7 +1166,7 @@ private:
pav = Opm::unit::convert::to(pav, Opm::unit::barsa); pav = Opm::unit::convert::to(pav, Opm::unit::barsa);
} }
else { else {
OPM_THROW(std::runtime_error, "Unsupported unit type for fluid in place output."); throw std::runtime_error("Unsupported unit type for fluid in place output.");
} }
} }

View File

@ -36,9 +36,8 @@
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
@ -1206,8 +1205,7 @@ protected:
} }
} }
else else
OPM_THROW(std::logic_error, throw std::logic_error("Type of well \""+name()+"\" is undefined");
"Type of well \"" << name() << "\" is undefined");
Opm::Valgrind::CheckDefined(pbh); Opm::Valgrind::CheckDefined(pbh);
Opm::Valgrind::CheckDefined(p); Opm::Valgrind::CheckDefined(p);
@ -1426,9 +1424,8 @@ protected:
const auto& f = wellResidual_<BhpEval>(bhpEval); const auto& f = wellResidual_<BhpEval>(bhpEval);
if (std::abs(f.derivative(0)) < 1e-20) if (std::abs(f.derivative(0)) < 1e-20)
OPM_THROW(Opm::NumericalProblem, throw Opm::NumericalIssue("Cannot determine the bottom hole pressure for well "+name()
"Cannot determine the bottom hole pressure for well " << name() +": Derivative of the well residual is too small");
<< ": Derivative of the well residual is too small");
Scalar delta = f.value()/f.derivative(0); Scalar delta = f.value()/f.derivative(0);
bhpEval.setValue(bhpEval.value() - delta); bhpEval.setValue(bhpEval.value() - delta);
@ -1446,9 +1443,8 @@ protected:
return bhpEval.value(); return bhpEval.value();
} }
OPM_THROW(Opm::NumericalProblem, throw Opm::NumericalIssue("Could not determine the bottom hole pressure of well '"+name()
"Could not determine the bottom hole pressure of well '" << name() +"' within 20 iterations.");
<< "' within 20 iterations.");
} }
template <class BhpEval> template <class BhpEval>

View File

@ -73,14 +73,13 @@
#include <opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp> #include <opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp> #include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp>
#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp> #include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>
#include <opm/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp> #include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp> #include <opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/common/version.hh> #include <dune/common/version.hh>
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
@ -358,7 +357,7 @@ public:
boost::filesystem::create_directories(outputDir); boost::filesystem::create_directories(outputDir);
} }
catch (...) { catch (...) {
OPM_THROW(std::runtime_error, "Creation of output directory '"<<outputDir<<"' failed\n"); throw std::runtime_error("Creation of output directory '"+outputDir+"' failed\n");
} }
} }
} }
@ -1343,9 +1342,8 @@ private:
else if (rockTableType == "ROCKNUM") else if (rockTableType == "ROCKNUM")
propName = "ROCKNUM"; propName = "ROCKNUM";
else { else {
OPM_THROW(std::runtime_error, throw std::runtime_error("Unknown table type '"+rockTableType
"Unknown table type '" << rockTableType +" for the ROCKOPTS keyword given");
<< " for the ROCKOPTS keyword given");
} }
} }
@ -1535,26 +1533,21 @@ private:
// make sure all required quantities are enables // make sure all required quantities are enables
if (FluidSystem::phaseIsActive(waterPhaseIdx) && !eclProps.hasDeckDoubleGridProperty("SWAT")) if (FluidSystem::phaseIsActive(waterPhaseIdx) && !eclProps.hasDeckDoubleGridProperty("SWAT"))
OPM_THROW(std::runtime_error, throw std::runtime_error("The ECL input file requires the presence of the SWAT keyword if "
"The ECL input file requires the presence of the SWAT keyword if " "the water phase is active");
"the water phase is active");
if (FluidSystem::phaseIsActive(gasPhaseIdx) && !eclProps.hasDeckDoubleGridProperty("SGAS")) if (FluidSystem::phaseIsActive(gasPhaseIdx) && !eclProps.hasDeckDoubleGridProperty("SGAS"))
OPM_THROW(std::runtime_error, throw std::runtime_error("The ECL input file requires the presence of the SGAS keyword if "
"The ECL input file requires the presence of the SGAS keyword if " "the gas phase is active");
"the gas phase is active");
if (!eclProps.hasDeckDoubleGridProperty("PRESSURE")) if (!eclProps.hasDeckDoubleGridProperty("PRESSURE"))
OPM_THROW(std::runtime_error, throw std::runtime_error("The ECL input file requires the presence of the PRESSURE "
"The ECL input file requires the presence of the PRESSURE " "keyword if the model is initialized explicitly");
"keyword if the model is initialized explicitly");
if (FluidSystem::enableDissolvedGas() && !eclProps.hasDeckDoubleGridProperty("RS")) if (FluidSystem::enableDissolvedGas() && !eclProps.hasDeckDoubleGridProperty("RS"))
OPM_THROW(std::runtime_error, throw std::runtime_error("The ECL input file requires the RS keyword to be present if"
"The ECL input file requires the RS keyword to be present if" " dissolved gas is enabled");
" dissolved gas is enabled");
if (FluidSystem::enableVaporizedOil() && !eclProps.hasDeckDoubleGridProperty("RV")) if (FluidSystem::enableVaporizedOil() && !eclProps.hasDeckDoubleGridProperty("RV"))
OPM_THROW(std::runtime_error, throw std::runtime_error("The ECL input file requires the RV keyword to be present if"
"The ECL input file requires the RV keyword to be present if" " vaporized oil is enabled");
" vaporized oil is enabled");
size_t numDof = this->model().numGridDof(); size_t numDof = this->model().numGridDof();

View File

@ -39,8 +39,8 @@
#include <opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp> #include <opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp>
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp> #include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
#include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp> #include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/Exceptions.hpp> #include <opm/material/common/Exceptions.hpp>
#include <dune/grid/common/gridenums.hh> #include <dune/grid/common/gridenums.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
@ -113,8 +113,7 @@ public:
if (numEquilRegions_ > 0xff) { if (numEquilRegions_ > 0xff) {
// make sure that the index of an equilibration region can be stored in a // make sure that the index of an equilibration region can be stored in a
// single byte // single byte
OPM_THROW(std::runtime_error, throw std::runtime_error("The maximum number of supported equilibration regions is 255!");
"The maximum number of supported equilibration regions is 255!");
} }
// allocate the array which specifies the threshold pressures // allocate the array which specifies the threshold pressures

View File

@ -38,8 +38,7 @@
#include <dune/grid/CpGrid.hpp> #include <dune/grid/CpGrid.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/grid/common/mcmgmapper.hh> #include <dune/grid/common/mcmgmapper.hh>
@ -255,7 +254,7 @@ public:
break; break;
default: default:
OPM_THROW(std::logic_error, "Could not determine a face direction"); throw std::logic_error("Could not determine a face direction");
} }
trans *= transMult.getRegionMultiplier(insideCartElemIdx, trans *= transMult.getRegionMultiplier(insideCartElemIdx,
@ -343,9 +342,8 @@ private:
// for now we don't care about non-diagonal entries // for now we don't care about non-diagonal entries
} }
else else
OPM_THROW(std::logic_error, throw std::logic_error("Can't read the intrinsic permeability from the ecl state. "
"Can't read the intrinsic permeability from the ecl state. " "(The PERM{X,Y,Z} keywords are missing)");
"(The PERM{X,Y,Z} keywords are missing)");
} }
std::uint64_t isId_(unsigned elemIdx1, unsigned elemIdx2) const std::uint64_t isId_(unsigned elemIdx1, unsigned elemIdx2) const

View File

@ -39,8 +39,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <ewoms/common/propertysystem.hh> #include <ewoms/common/propertysystem.hh>
#include <ewoms/parallel/threadedentityiterator.hh> #include <ewoms/parallel/threadedentityiterator.hh>
@ -183,8 +182,7 @@ public:
well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx); well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx);
break; break;
case Opm::WellInjector::MULTI: case Opm::WellInjector::MULTI:
OPM_THROW(std::runtime_error, throw std::runtime_error("Not implemented: Multi-phase injector wells");
"Not implemented: Multi-phase injector wells");
} }
switch (injectProperties.controlMode) { switch (injectProperties.controlMode) {
@ -205,8 +203,7 @@ public:
break; break;
case Opm::WellInjector::GRUP: case Opm::WellInjector::GRUP:
OPM_THROW(std::runtime_error, throw std::runtime_error("Not implemented: Well groups");
"Not implemented: Well groups");
case Opm::WellInjector::CMODE_UNDEFINED: case Opm::WellInjector::CMODE_UNDEFINED:
std::cout << "Warning: Control mode of injection well " << well->name() std::cout << "Warning: Control mode of injection well " << well->name()
@ -229,8 +226,7 @@ public:
break; break;
case Opm::WellInjector::MULTI: case Opm::WellInjector::MULTI:
OPM_THROW(std::runtime_error, throw std::runtime_error("Not implemented: Multi-phase injection wells");
"Not implemented: Multi-phase injection wells");
} }
well->setMaximumSurfaceRate(injectProperties.surfaceInjectionRate); well->setMaximumSurfaceRate(injectProperties.surfaceInjectionRate);
@ -274,8 +270,7 @@ public:
break; break;
case Opm::WellProducer::CRAT: case Opm::WellProducer::CRAT:
OPM_THROW(std::runtime_error, throw std::runtime_error("Not implemented: Linearly combined rates");
"Not implemented: Linearly combined rates");
case Opm::WellProducer::RESV: case Opm::WellProducer::RESV:
well->setControlMode(Well::ControlMode::VolumetricReservoirRate); well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
@ -292,8 +287,7 @@ public:
break; break;
case Opm::WellProducer::GRUP: case Opm::WellProducer::GRUP:
OPM_THROW(std::runtime_error, throw std::runtime_error("Not implemented: Well groups");
"Not implemented: Well groups");
case Opm::WellProducer::NONE: case Opm::WellProducer::NONE:
// fall-through // fall-through
@ -343,10 +337,7 @@ public:
assert( hasWell( wellName ) ); assert( hasWell( wellName ) );
const auto& it = wellNameToIndex_.find(wellName); const auto& it = wellNameToIndex_.find(wellName);
if (it == wellNameToIndex_.end()) if (it == wellNameToIndex_.end())
{ throw std::runtime_error("No well called '"+wellName+"'found");
OPM_THROW(std::runtime_error,
"No well called '" << wellName << "'found");
}
return it->second; return it->second;
} }

View File

@ -36,9 +36,8 @@
#include <opm/output/eclipse/EclipseIO.hpp> #include <opm/output/eclipse/EclipseIO.hpp>
#include <opm/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/material/common/Exceptions.hpp>
#include <opm/common/Exceptions.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
@ -114,8 +113,7 @@ public:
void writeInit() void writeInit()
{ {
#if !HAVE_OPM_OUTPUT #if !HAVE_OPM_OUTPUT
OPM_THROW(std::runtime_error, throw std::runtime_error("opm-output must be available to write ECL output!");
"Opm-output must be available to write ECL output!");
#else #else
if (collectToIORank_.isIORank()) { if (collectToIORank_.isIORank()) {
std::map<std::string, std::vector<int> > integerVectors; std::map<std::string, std::vector<int> > integerVectors;
@ -132,8 +130,7 @@ public:
void writeOutput(const Opm::data::Wells& dw, Scalar t, bool substep, Scalar totalSolverTime, Scalar nextstep) void writeOutput(const Opm::data::Wells& dw, Scalar t, bool substep, Scalar totalSolverTime, Scalar nextstep)
{ {
#if !HAVE_OPM_OUTPUT #if !HAVE_OPM_OUTPUT
OPM_THROW(std::runtime_error, throw std::runtime_error("opm-output must be available to write ECL output!");
"Opm-output must be available to write ECL output!");
#else #else
int episodeIdx = simulator_.episodeIndex() + 1; int episodeIdx = simulator_.episodeIndex() + 1;
@ -193,7 +190,6 @@ public:
extraRestartData, extraRestartData,
enableDoublePrecisionOutput); enableDoublePrecisionOutput);
} }
#endif #endif
} }

View File

@ -751,10 +751,10 @@ double minSaturations(const MaterialLawManager& materialLawManager, const int ph
return scaledDrainageInfo.Sgl; return scaledDrainageInfo.Sgl;
case FluidSystem::oilPhaseIdx: case FluidSystem::oilPhaseIdx:
OPM_THROW(std::runtime_error, "Min saturation not implemented for oil phase."); throw std::runtime_error("Min saturation not implemented for oil phase.");
default: default:
OPM_THROW(std::runtime_error, "Unknown phaseIdx ."); throw std::runtime_error("Unknown phaseIdx .");
} }
return -1.0; return -1.0;
} }
@ -774,10 +774,10 @@ double maxSaturations(const MaterialLawManager& materialLawManager, const int ph
return scaledDrainageInfo.Sgu; return scaledDrainageInfo.Sgu;
case FluidSystem::oilPhaseIdx: case FluidSystem::oilPhaseIdx:
OPM_THROW(std::runtime_error, "Max saturation not implemented for oil phase."); throw std::runtime_error("Max saturation not implemented for oil phase.");
default: default:
OPM_THROW(std::runtime_error, "Unknown phaseIdx ."); throw std::runtime_error("Unknown phaseIdx .");
} }
return -1.0; return -1.0;
} }
@ -837,9 +837,8 @@ double satFromPc(const MaterialLawManager& materialLawManager,
return (s1 + s0)/2; return (s1 + s0)/2;
} }
OPM_THROW(std::runtime_error, throw std::runtime_error("Could not find solution for PcEq = 0.0 after "+std::to_string(maxIter)
"Could not find solution for PcEq = 0.0 after " << maxIter +" iterations.");
<< " iterations.");
} }
@ -946,9 +945,8 @@ double satFromSumOfPcs(const MaterialLawManager& materialLawManager,
return (s1 + s0)/2; return (s1 + s0)/2;
} }
OPM_THROW(std::runtime_error, throw std::runtime_error("Could not find solution for PcEqSum = 0.0 after "+std::to_string(maxIter)
"Could not find solution for PcEqSum = 0.0 after " << maxIter +" iterations.");
<< " iterations.");
} }
/// Compute saturation from depth. Used for constant capillary pressure function /// Compute saturation from depth. Used for constant capillary pressure function

View File

@ -705,7 +705,7 @@ phaseSaturations(const Grid& grid,
std::vector< std::vector<double> >& phasePressures) std::vector< std::vector<double> >& phasePressures)
{ {
if (!FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) { if (!FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
OPM_THROW(std::runtime_error, "Cannot initialise: not handling water-gas cases."); throw std::runtime_error("Cannot initialise: not handling water-gas cases.");
} }
std::vector< std::vector<double> > phaseSaturations = phasePressures; // Just to get the right size. std::vector< std::vector<double> > phaseSaturations = phasePressures; // Just to get the right size.
@ -898,7 +898,7 @@ getEquil(const Opm::EclipseState& state)
const auto& init = state.getInitConfig(); const auto& init = state.getInitConfig();
if(!init.hasEquil()) { if(!init.hasEquil()) {
OPM_THROW(std::domain_error, "Deck does not provide equilibration data."); throw std::domain_error("Deck does not provide equilibration data.");
} }
const auto& equil = init.getEquil(); const auto& equil = init.getEquil();
@ -1000,16 +1000,15 @@ public:
depthColumn, pbubColumn)); depthColumn, pbubColumn));
} else { } else {
OPM_THROW(std::runtime_error, "Cannot initialise: RSVD or PBVD table not available."); throw std::runtime_error("Cannot initialise: RSVD or PBVD table not available.");
} }
} }
else { else {
if (rec[i].gasOilContactDepth() != rec[i].datumDepth()) { if (rec[i].gasOilContactDepth() != rec[i].datumDepth()) {
OPM_THROW(std::runtime_error, throw std::runtime_error("Cannot initialise: when no explicit RSVD table is given, \n"
"Cannot initialise: when no explicit RSVD table is given, \n" "datum depth must be at the gas-oil-contact. "
"datum depth must be at the gas-oil-contact. " "In EQUIL region "+std::to_string(i + 1)+" (counting from 1), this does not hold.");
"In EQUIL region " << (i + 1) << " (counting from 1), this does not hold.");
} }
const double pContact = rec[i].datumDepthPressure(); const double pContact = rec[i].datumDepthPressure();
const double TContact = 273.15 + 20; // standard temperature for now const double TContact = 273.15 + 20; // standard temperature for now
@ -1048,15 +1047,15 @@ public:
rvFunc_.push_back(std::make_shared<Miscibility::PDVD<FluidSystem>>(pvtIdx, rvFunc_.push_back(std::make_shared<Miscibility::PDVD<FluidSystem>>(pvtIdx,
depthColumn, pdewColumn)); depthColumn, pdewColumn));
} else { } else {
OPM_THROW(std::runtime_error, "Cannot initialise: RVVD or PDCD table not available."); throw std::runtime_error("Cannot initialise: RVVD or PDCD table not available.");
} }
} }
else { else {
if (rec[i].gasOilContactDepth() != rec[i].datumDepth()) { if (rec[i].gasOilContactDepth() != rec[i].datumDepth()) {
OPM_THROW(std::runtime_error, throw std::runtime_error(
"Cannot initialise: when no explicit RVVD table is given, \n" "Cannot initialise: when no explicit RVVD table is given, \n"
"datum depth must be at the gas-oil-contact. " "datum depth must be at the gas-oil-contact. "
"In EQUIL region " << (i + 1) << " (counting from 1), this does not hold."); "In EQUIL region "+std::to_string(i + 1)+" (counting from 1), this does not hold.");
} }
const double pContact = rec[i].datumDepthPressure() + rec[i].gasOilContactCapillaryPressure(); const double pContact = rec[i].datumDepthPressure() + rec[i].gasOilContactCapillaryPressure();
const double TContact = 273.15 + 20; // standard temperature for now const double TContact = 273.15 + 20; // standard temperature for now