Merge pull request #3259 from akva2/exception_nih_begone
changed: drop exceptions class from material
This commit is contained in:
@@ -841,7 +841,6 @@ list( APPEND PUBLIC_HEADER_FILES
|
||||
opm/material/common/UniformTabulated2DFunction.hpp
|
||||
opm/material/common/FastSmallVector.hpp
|
||||
opm/material/common/ConditionalStorage.hpp
|
||||
opm/material/common/Exceptions.hpp
|
||||
opm/material/common/Means.hpp
|
||||
opm/material/common/IntervalTabulated2DFunction.hpp
|
||||
opm/material/common/Tabulated1DFunction.hpp
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
// vi: set et ts=4 sw=4 sts=4:
|
||||
/*
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Consult the COPYING file in the top-level source directory of this
|
||||
module for the precise wording of the license and the list of
|
||||
copyright holders.
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \brief Provides the opm-material specific exception classes.
|
||||
*/
|
||||
#ifndef OPM_MATERIAL_EXCEPTIONS_HPP
|
||||
#define OPM_MATERIAL_EXCEPTIONS_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <dune/common/exceptions.hh>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
// the opm-material specific exception classes
|
||||
namespace Opm {
|
||||
class NumericalIssue
|
||||
: public NumericalProblem
|
||||
{
|
||||
public:
|
||||
explicit NumericalIssue(const std::string &message)
|
||||
: NumericalProblem(message)
|
||||
{}
|
||||
};
|
||||
}
|
||||
|
||||
#endif // OPM_MATERIAL_EXCEPTIONS_HPP
|
||||
@@ -28,8 +28,9 @@
|
||||
#ifndef OPM_INTERVAL_TABULATED_2D_FUNCTION_HPP
|
||||
#define OPM_INTERVAL_TABULATED_2D_FUNCTION_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <vector>
|
||||
@@ -184,7 +185,7 @@ public:
|
||||
*
|
||||
* If this method is called for a value outside of the tabulated
|
||||
* range, and extrapolation is not allowed in the corresponding direction,
|
||||
* a \c Opm::NumericalIssue exception is thrown.
|
||||
* a \c Opm::NumericalProblem exception is thrown.
|
||||
*/
|
||||
template <typename Evaluation>
|
||||
Evaluation eval(const Evaluation& x, const Evaluation& y) const
|
||||
@@ -192,7 +193,7 @@ public:
|
||||
if ((!xExtrapolate_ && !appliesX(x)) || (!yExtrapolate_ && !appliesY(y))) {
|
||||
std::ostringstream oss;
|
||||
oss << "Attempt to get undefined table value (" << x << ", " << y << ")";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
};
|
||||
|
||||
// bi-linear interpolation: first, calculate the x and y indices in the lookup
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
#ifndef OPM_SPLINE_HPP
|
||||
#define OPM_SPLINE_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/TridiagonalMatrix.hpp>
|
||||
#include <opm/material/common/PolynomialUtils.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
@@ -797,7 +798,7 @@ public:
|
||||
Evaluation eval(const Evaluation& x, bool extrapolate = false) const
|
||||
{
|
||||
if (!extrapolate && !applies(x))
|
||||
throw NumericalIssue("Tried to evaluate a spline outside of its range");
|
||||
throw NumericalProblem("Tried to evaluate a spline outside of its range");
|
||||
|
||||
// handle extrapolation
|
||||
if (extrapolate) {
|
||||
@@ -833,7 +834,7 @@ public:
|
||||
Evaluation evalDerivative(const Evaluation& x, bool extrapolate = false) const
|
||||
{
|
||||
if (!extrapolate && !applies(x))
|
||||
throw NumericalIssue("Tried to evaluate the derivative of a spline outside of its range");
|
||||
throw NumericalProblem("Tried to evaluate the derivative of a spline outside of its range");
|
||||
|
||||
// handle extrapolation
|
||||
if (extrapolate) {
|
||||
@@ -862,7 +863,7 @@ public:
|
||||
Evaluation evalSecondDerivative(const Evaluation& x, bool extrapolate = false) const
|
||||
{
|
||||
if (!extrapolate && !applies(x))
|
||||
throw NumericalIssue("Tried to evaluate the second derivative of a spline outside of its range");
|
||||
throw NumericalProblem("Tried to evaluate the second derivative of a spline outside of its range");
|
||||
else if (extrapolate)
|
||||
return 0.0;
|
||||
|
||||
@@ -885,7 +886,7 @@ public:
|
||||
Evaluation evalThirdDerivative(const Evaluation& x, bool extrapolate = false) const
|
||||
{
|
||||
if (!extrapolate && !applies(x))
|
||||
throw NumericalIssue("Tried to evaluate the third derivative of a spline outside of its range");
|
||||
throw NumericalProblem("Tried to evaluate the third derivative of a spline outside of its range");
|
||||
else if (extrapolate)
|
||||
return 0.0;
|
||||
|
||||
|
||||
@@ -29,14 +29,14 @@
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
namespace Opm {
|
||||
/*!
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
#ifndef OPM_UNIFORM_TABULATED_2D_FUNCTION_HPP
|
||||
#define OPM_UNIFORM_TABULATED_2D_FUNCTION_HPP
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
|
||||
if (!extrapolate)
|
||||
{
|
||||
throw NumericalIssue(msg);
|
||||
throw NumericalProblem(msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,8 +28,9 @@
|
||||
#ifndef OPM_UNIFORM_X_TABULATED_2D_FUNCTION_HPP
|
||||
#define OPM_UNIFORM_X_TABULATED_2D_FUNCTION_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <iostream>
|
||||
@@ -321,7 +322,7 @@ public:
|
||||
if (!extrapolate && !applies(x, y)) {
|
||||
std::ostringstream oss;
|
||||
oss << "Attempt to get undefined table value (" << x << ", " << y << ")";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
#ifndef OPM_AIR_HPP
|
||||
#define OPM_AIR_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/components/Component.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/IdealGas.hpp>
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*!
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
static Evaluation simpleGasViscosity(const Evaluation& temperature, const Evaluation& /*pressure*/)
|
||||
{
|
||||
if(temperature < 273.15 || temperature > 660.) {
|
||||
throw NumericalIssue("Air: Temperature "+std::to_string(scalarValue(temperature))+"K out of range");
|
||||
throw NumericalProblem("Air: Temperature "+std::to_string(scalarValue(temperature))+"K out of range");
|
||||
}
|
||||
return 1.496e-6*pow(temperature, 1.5)/(temperature + 120);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@
|
||||
|
||||
#include "Component.hpp"
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/IdealGas.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
|
||||
#include <cmath>
|
||||
@@ -189,7 +190,7 @@ public:
|
||||
oss << "Enthalpy of steam is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -242,7 +243,7 @@ public:
|
||||
oss << "Enthalpy of water is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -286,7 +287,7 @@ public:
|
||||
oss << "Heat capacity of steam is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -322,7 +323,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Heat capacity of water is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -358,7 +359,7 @@ public:
|
||||
oss << "Internal Energy of water is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +417,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss <<"Internal energy of steam is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -493,7 +494,7 @@ public:
|
||||
oss << "Heat capacity of water is only implemented for temperatures below 623.15K and "
|
||||
"pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
|
||||
@@ -528,7 +529,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Heat capacity of steam is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -576,7 +577,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Density of steam is only implemented for temperatures below 623.15K and "
|
||||
"pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -704,7 +705,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Density of water is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
// regularization
|
||||
@@ -806,7 +807,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Viscosity of steam is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
Evaluation rho = gasDensity(temperature, pressure);
|
||||
@@ -834,7 +835,7 @@ public:
|
||||
std::ostringstream oss;
|
||||
oss << "Viscosity of water is only implemented for temperatures below 623.15K and "
|
||||
<< "pressures below 100MPa. (T = " << temperature << ", p=" << pressure;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
};
|
||||
|
||||
const Evaluation& rho = liquidDensity(temperature, pressure, extrapolate);
|
||||
|
||||
@@ -30,14 +30,12 @@
|
||||
#include "Component.hpp"
|
||||
#include "iapws/Common.hpp"
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/material/IdealGas.hpp>
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <cmath>
|
||||
#include <sstream>
|
||||
|
||||
@@ -355,7 +353,7 @@ public:
|
||||
OpmLog::warning(oss.str());
|
||||
}
|
||||
else
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
const Evaluation rho = liquidDensity(temperature, pressure, extrapolate);
|
||||
@@ -386,7 +384,7 @@ private:
|
||||
OpmLog::warning(oss.str());
|
||||
}
|
||||
else
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
Evaluation p = pressure / 1e6; // to MPa
|
||||
|
||||
@@ -27,8 +27,9 @@
|
||||
#ifndef OPM_COMPOSITION_FROM_FUGACITIES_HPP
|
||||
#define OPM_COMPOSITION_FROM_FUGACITIES_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
@@ -131,7 +132,7 @@ public:
|
||||
x = 0.0;
|
||||
try { J.solve(x, b); }
|
||||
catch (const Dune::FMatrixError& e)
|
||||
{ throw NumericalIssue(e.what()); }
|
||||
{ throw NumericalProblem(e.what()); }
|
||||
|
||||
//std::cout << "original delta: " << x << "\n";
|
||||
|
||||
@@ -171,7 +172,7 @@ public:
|
||||
<< xInit
|
||||
<< "}, {fug_t} = {" << targetFug << "}, p = " << fluidState.pressure(phaseIdx)
|
||||
<< ", T = " << fluidState.temperature(phaseIdx);
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,13 @@
|
||||
#ifndef OPM_IMMISCIBLE_FLASH_HPP
|
||||
#define OPM_IMMISCIBLE_FLASH_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
|
||||
#include <opm/material/densead/Evaluation.hpp>
|
||||
#include <opm/material/densead/Math.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
@@ -203,7 +204,7 @@ public:
|
||||
|
||||
try { J.solve(deltaX, b); }
|
||||
catch (const Dune::FMatrixError& e) {
|
||||
throw NumericalIssue(e.what());
|
||||
throw NumericalProblem(e.what());
|
||||
}
|
||||
Valgrind::CheckDefined(deltaX);
|
||||
|
||||
@@ -220,7 +221,7 @@ public:
|
||||
oss << "ImmiscibleFlash solver failed:"
|
||||
<< " {c_alpha^kappa} = {" << globalMolarities << "},"
|
||||
<< " T = " << fluidState.temperature(/*phaseIdx=*/0);
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
#ifndef OPM_MISCIBLE_MULTIPHASE_COMPOSITION_HPP
|
||||
#define OPM_MISCIBLE_MULTIPHASE_COMPOSITION_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
@@ -260,7 +261,7 @@ public:
|
||||
catch (const Dune::FMatrixError& e) {
|
||||
std::ostringstream oss;
|
||||
oss << "Numerical problem in MiscibleMultiPhaseComposition::solve(): " << e.what() << "; M="<<M;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
catch (...) {
|
||||
throw;
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#ifndef OPM_NCP_FLASH_HPP
|
||||
#define OPM_NCP_FLASH_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
|
||||
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
|
||||
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
|
||||
@@ -35,8 +37,6 @@
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/version.hh>
|
||||
@@ -220,7 +220,7 @@ public:
|
||||
deltaX = 0.0;
|
||||
try { J.solve(deltaX, b); }
|
||||
catch (const Dune::FMatrixError& e) {
|
||||
throw NumericalIssue(e.what());
|
||||
throw NumericalProblem(e.what());
|
||||
}
|
||||
Valgrind::CheckDefined(deltaX);
|
||||
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
oss << "NcpFlash solver failed:"
|
||||
<< " {c_alpha^kappa} = {" << globalMolarities << "}, "
|
||||
<< " T = " << fluidState.temperature(/*phaseIdx=*/0);
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
#include <opm/material/Constants.hpp>
|
||||
#include <opm/material/eos/PengRobinsonMixture.hpp>
|
||||
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <dune/common/fvector.hh>
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/common/version.hh>
|
||||
@@ -49,6 +47,7 @@
|
||||
#include <limits>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#ifndef OPM_PENG_ROBINSON_HPP
|
||||
#define OPM_PENG_ROBINSON_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/fluidstates/TemperatureOverlayFluidState.hpp>
|
||||
#include <opm/material/IdealGas.hpp>
|
||||
#include <opm/material/common/UniformTabulated2DFunction.hpp>
|
||||
@@ -380,7 +382,7 @@ protected:
|
||||
|
||||
std::ostringstream oss;
|
||||
oss << "Could not determine the critical point for a=" << a << ", b=" << b;
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
if (findExtrema_(minVm, maxVm, minP, maxP, a, b, T - delta)) {
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
|
||||
#include "BrooksCoreyParams.hpp"
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -293,7 +294,7 @@ public:
|
||||
return Sw;
|
||||
}
|
||||
|
||||
throw NumericalIssue("Couldn't invert the Brooks-Corey non-wetting phase"
|
||||
throw NumericalProblem("Couldn't invert the Brooks-Corey non-wetting phase"
|
||||
" relperm within 20 iterations");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
|
||||
#include "TwoPhaseLETCurvesParams.hpp"
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
namespace Opm {
|
||||
/*!
|
||||
@@ -299,7 +300,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
throw NumericalIssue("Couldn't invert the TwoPhaseLETCurves non-wetting phase"
|
||||
throw NumericalProblem("Couldn't invert the TwoPhaseLETCurves non-wetting phase"
|
||||
" relperm within 20 newton iterations and 50 bisection iterations");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/Valgrind.hpp>
|
||||
#include <opm/material/common/HasMemberGeneratorMacros.hpp>
|
||||
#include <opm/material/common/Exceptions.hpp>
|
||||
|
||||
#if HAVE_ECL_INPUT
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
@@ -47,9 +46,10 @@
|
||||
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
#endif
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
namespace BlackOil {
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include "BaseFluidSystem.hpp"
|
||||
#include "NullParameterCache.hpp"
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/IdealGas.hpp>
|
||||
|
||||
#include <opm/material/components/Brine.hpp>
|
||||
@@ -487,13 +489,13 @@ private:
|
||||
std::ostringstream oss;
|
||||
oss << "Liquid density for Brine and CO2 is only "
|
||||
"defined above 273.15K (is "<<T<<"K)";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
if(pl >= 2.5e8) {
|
||||
std::ostringstream oss;
|
||||
oss << "Liquid density for Brine and CO2 is only "
|
||||
"defined below 250MPa (is "<<pl<<"Pa)";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
const LhsEval& rho_brine = Brine::liquidDensity(T, pl);
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#ifndef OPM_BRINE_CO2_PVT_HPP
|
||||
#define OPM_BRINE_CO2_PVT_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
|
||||
#include <opm/material/Constants.hpp>
|
||||
|
||||
#include <opm/material/components/Brine.hpp>
|
||||
@@ -38,7 +40,6 @@
|
||||
#include <opm/material/binarycoefficients/Brine_CO2.hpp>
|
||||
#include <opm/material/components/co2tables.inc>
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
@@ -323,13 +324,13 @@ private:
|
||||
std::ostringstream oss;
|
||||
oss << "Liquid density for Brine and CO2 is only "
|
||||
"defined above 273.15K (is "<<T<<"K)";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
if(!extrapolate && pl >= 2.5e8) {
|
||||
std::ostringstream oss;
|
||||
oss << "Liquid density for Brine and CO2 is only "
|
||||
"defined below 250MPa (is "<<pl<<"Pa)";
|
||||
throw NumericalIssue(oss.str());
|
||||
throw NumericalProblem(oss.str());
|
||||
}
|
||||
|
||||
const LhsEval& rho_brine = Brine::liquidDensity(T, pl, extrapolate);
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#ifndef OPM_DRY_HUMID_GAS_PVT_HPP
|
||||
#define OPM_DRY_HUMID_GAS_PVT_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/material/Constants.hpp>
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
|
||||
@@ -35,11 +38,8 @@
|
||||
#if HAVE_ECL_INPUT
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*!
|
||||
@@ -596,7 +596,7 @@ public:
|
||||
<< " pSat = " << pSat
|
||||
<< ", Rw = " << Rw;
|
||||
OpmLog::debug("Wet gas saturation pressure", errlog.str());
|
||||
throw NumericalIssue(errlog.str());
|
||||
throw NumericalProblem(errlog.str());
|
||||
}
|
||||
|
||||
template <class Evaluation>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#ifndef OPM_LIVE_OIL_PVT_HPP
|
||||
#define OPM_LIVE_OIL_PVT_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
|
||||
#include <opm/material/common/Tabulated1DFunction.hpp>
|
||||
@@ -38,8 +41,6 @@
|
||||
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
#endif
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
/*!
|
||||
* \brief This class represents the Pressure-Volume-Temperature relations of the oil phas
|
||||
@@ -594,7 +595,7 @@ public:
|
||||
<< " pSat = " << pSat
|
||||
<< ", Rs = " << Rs;
|
||||
OpmLog::debug("Live oil saturation pressure", errlog.str());
|
||||
throw NumericalIssue(errlog.str());
|
||||
throw NumericalProblem(errlog.str());
|
||||
}
|
||||
|
||||
template <class Evaluation>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#ifndef OPM_WET_GAS_PVT_HPP
|
||||
#define OPM_WET_GAS_PVT_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
|
||||
#include <opm/material/common/Tabulated1DFunction.hpp>
|
||||
@@ -37,8 +40,6 @@
|
||||
#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
|
||||
#endif
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*!
|
||||
@@ -644,7 +645,7 @@ public:
|
||||
<< " pSat = " << pSat
|
||||
<< ", Rv = " << Rv;
|
||||
OpmLog::debug("Wet gas saturation pressure", errlog.str());
|
||||
throw NumericalIssue(errlog.str());
|
||||
throw NumericalProblem(errlog.str());
|
||||
}
|
||||
|
||||
template <class Evaluation>
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
#ifndef OPM_WET_HUMID_GAS_PVT_HPP
|
||||
#define OPM_WET_HUMID_GAS_PVT_HPP
|
||||
|
||||
#include <opm/common/Exceptions.hpp>
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
#include <opm/material/common/MathToolbox.hpp>
|
||||
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
|
||||
#include <opm/material/common/Tabulated1DFunction.hpp>
|
||||
@@ -34,11 +37,8 @@
|
||||
#if HAVE_ECL_INPUT
|
||||
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
/*!
|
||||
@@ -795,7 +795,7 @@ public:
|
||||
<< " pSat = " << pSat
|
||||
<< ", Rw = " << Rw;
|
||||
OpmLog::debug("Wet gas saturation pressure", errlog.str());
|
||||
throw NumericalIssue(errlog.str());
|
||||
throw NumericalProblem(errlog.str());
|
||||
}
|
||||
|
||||
template <class Evaluation>
|
||||
|
||||
@@ -221,7 +221,7 @@ Scalar bringOilToSurface(FluidState& surfaceFluidState, Scalar alpha, const Flui
|
||||
ComponentVector tmpMolarities;
|
||||
for (int i = 0;; ++i) {
|
||||
if (i >= 20)
|
||||
throw Opm::NumericalIssue("Newton method did not converge after 20 iterations");
|
||||
throw Opm::NumericalProblem("Newton method did not converge after 20 iterations");
|
||||
|
||||
// calculate the deviation from the standard pressure
|
||||
tmpMolarities = molarities;
|
||||
|
||||
Reference in New Issue
Block a user