mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
commit
22d4e784d3
@ -40,6 +40,8 @@
|
|||||||
#include <opm/common/OpmLog/LogUtil.hpp>
|
#include <opm/common/OpmLog/LogUtil.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <opm/parser/eclipse/Utility/String.hpp>
|
||||||
|
|
||||||
BEGIN_PROPERTIES
|
BEGIN_PROPERTIES
|
||||||
|
|
||||||
// forward declaration of property tags
|
// forward declaration of property tags
|
||||||
@ -93,11 +95,11 @@ static FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filena
|
|||||||
std::ostringstream logFileStream;
|
std::ostringstream logFileStream;
|
||||||
|
|
||||||
// Strip extension "." or ".DATA"
|
// Strip extension "." or ".DATA"
|
||||||
std::string extension = boost::to_upper_copy(fpath.extension().string());
|
std::string extension = uppercase(fpath.extension().string());
|
||||||
if (extension == ".DATA" || extension == ".") {
|
if (extension == ".DATA" || extension == ".") {
|
||||||
baseName = boost::to_upper_copy(fpath.stem().string());
|
baseName = uppercase(fpath.stem().string());
|
||||||
} else {
|
} else {
|
||||||
baseName = boost::to_upper_copy(fpath.filename().string());
|
baseName = uppercase(fpath.filename().string());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string output_dir = cmdline_output_dir;
|
std::string output_dir = cmdline_output_dir;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
||||||
|
#include <opm/parser/eclipse/Utility/String.hpp>
|
||||||
|
|
||||||
#if HAVE_DUNE_FEM
|
#if HAVE_DUNE_FEM
|
||||||
#include <dune/fem/misc/mpimanager.hh>
|
#include <dune/fem/misc/mpimanager.hh>
|
||||||
@ -369,14 +370,14 @@ namespace Opm
|
|||||||
fs::path deck_filename(EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName));
|
fs::path deck_filename(EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName));
|
||||||
std::string basename;
|
std::string basename;
|
||||||
// Strip extension "." and ".DATA"
|
// Strip extension "." and ".DATA"
|
||||||
std::string extension = boost::to_upper_copy(deck_filename.extension().string());
|
std::string extension = uppercase(deck_filename.extension().string());
|
||||||
if ( extension == ".DATA" || extension == "." )
|
if ( extension == ".DATA" || extension == "." )
|
||||||
{
|
{
|
||||||
basename = boost::to_upper_copy(deck_filename.stem().string());
|
basename = uppercase(deck_filename.stem().string());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
basename = boost::to_upper_copy(deck_filename.filename().string());
|
basename = uppercase(deck_filename.filename().string());
|
||||||
}
|
}
|
||||||
std::for_each(fs::directory_iterator(output_path),
|
std::for_each(fs::directory_iterator(output_path),
|
||||||
fs::directory_iterator(),
|
fs::directory_iterator(),
|
||||||
@ -537,7 +538,7 @@ namespace Opm
|
|||||||
std::unique_ptr<EbosSimulator> ebosSimulator_;
|
std::unique_ptr<EbosSimulator> ebosSimulator_;
|
||||||
int mpi_rank_ = 0;
|
int mpi_rank_ = 0;
|
||||||
int mpi_size_ = 1;
|
int mpi_size_ = 1;
|
||||||
boost::any parallel_information_;
|
std::any parallel_information_;
|
||||||
std::unique_ptr<Simulator> simulator_;
|
std::unique_ptr<Simulator> simulator_;
|
||||||
};
|
};
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <type_traits>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
@ -58,7 +58,13 @@ namespace MissingFeatures {
|
|||||||
const auto& record = keyword.getRecord(0);
|
const auto& record = keyword.getRecord(0);
|
||||||
if (record.getItem(it->second.item).template get<T>(0) != it->second.item_value) {
|
if (record.getItem(it->second.item).template get<T>(0) != it->second.item_value) {
|
||||||
const auto& location = keyword.location();
|
const auto& location = keyword.location();
|
||||||
std::string msg = "For keyword '" + it->first + "' only value " + boost::lexical_cast<std::string>(it->second.item_value)
|
std::string val;
|
||||||
|
if constexpr (std::is_arithmetic<T>::value)
|
||||||
|
val = std::to_string(it->second.item_value);
|
||||||
|
else
|
||||||
|
val = it->second.item_value;
|
||||||
|
|
||||||
|
std::string msg = "For keyword '" + it->first + "' only value " + val
|
||||||
+ " in item " + it->second.item + " is supported by flow.\n"
|
+ " in item " + it->second.item + " is supported by flow.\n"
|
||||||
+ "In file " + location.filename + ", line " + std::to_string(location.lineno) + "\n";
|
+ "In file " + location.filename + ", line " + std::to_string(location.lineno) + "\n";
|
||||||
parseContext.handleError(ParseContext::SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED, msg, errorGuard);
|
parseContext.handleError(ParseContext::SIMULATOR_KEYWORD_ITEM_NOT_SUPPORTED, msg, errorGuard);
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#include <opm/simulators/linalg/ParallelIstlInformation.hpp>
|
#include <opm/simulators/linalg/ParallelIstlInformation.hpp>
|
||||||
#include <opm/core/props/BlackoilPhases.hpp>
|
#include <opm/core/props/BlackoilPhases.hpp>
|
||||||
|
|
||||||
|
#include <any>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
@ -103,7 +105,7 @@ namespace detail {
|
|||||||
/// \param pinfo In a parallel this holds the information about the data distribution.
|
/// \param pinfo In a parallel this holds the information about the data distribution.
|
||||||
template <class Iterator>
|
template <class Iterator>
|
||||||
inline
|
inline
|
||||||
double euclidianNormSquared( Iterator it, const Iterator end, int num_components, const boost::any& pinfo = boost::any() )
|
double euclidianNormSquared( Iterator it, const Iterator end, int num_components, const std::any& pinfo = std::any() )
|
||||||
{
|
{
|
||||||
static_cast<void>(num_components); // Suppress warning in the serial case.
|
static_cast<void>(num_components); // Suppress warning in the serial case.
|
||||||
static_cast<void>(pinfo); // Suppress warning in non-MPI case.
|
static_cast<void>(pinfo); // Suppress warning in non-MPI case.
|
||||||
@ -111,7 +113,7 @@ namespace detail {
|
|||||||
if ( pinfo.type() == typeid(ParallelISTLInformation) )
|
if ( pinfo.type() == typeid(ParallelISTLInformation) )
|
||||||
{
|
{
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>(pinfo);
|
std::any_cast<const ParallelISTLInformation&>(pinfo);
|
||||||
typedef typename Iterator::value_type Scalar;
|
typedef typename Iterator::value_type Scalar;
|
||||||
Scalar product = 0.0;
|
Scalar product = 0.0;
|
||||||
int size_per_component = (end - it);
|
int size_per_component = (end - it);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#if defined(HAVE_OPM_GRID)
|
#if defined(HAVE_OPM_GRID)
|
||||||
#if defined(HAVE_MPI) && defined(HAVE_DUNE_ISTL)
|
#if defined(HAVE_MPI) && defined(HAVE_DUNE_ISTL)
|
||||||
// Extracts the information about the data decomposition from the grid for dune-istl
|
// Extracts the information about the data decomposition from the grid for dune-istl
|
||||||
void extractParallelGridInformationToISTL(const Dune::CpGrid& grid, boost::any& anyComm)
|
void extractParallelGridInformationToISTL(const Dune::CpGrid& grid, std::any& anyComm)
|
||||||
{
|
{
|
||||||
if(grid.comm().size()>1)
|
if(grid.comm().size()>1)
|
||||||
{
|
{
|
||||||
@ -35,14 +35,14 @@ void extractParallelGridInformationToISTL(const Dune::CpGrid& grid, boost::any&
|
|||||||
Dune::CpGrid& mgrid=const_cast<Dune::CpGrid&>(grid);
|
Dune::CpGrid& mgrid=const_cast<Dune::CpGrid&>(grid);
|
||||||
Dune::CpGrid::ParallelIndexSet& idx=mgrid.getCellIndexSet();
|
Dune::CpGrid::ParallelIndexSet& idx=mgrid.getCellIndexSet();
|
||||||
Dune::CpGrid::RemoteIndices& ridx=mgrid.getCellRemoteIndices();
|
Dune::CpGrid::RemoteIndices& ridx=mgrid.getCellRemoteIndices();
|
||||||
anyComm=boost::any(Opm::ParallelISTLInformation(Dune::stackobject_to_shared_ptr(idx),
|
anyComm=std::any(Opm::ParallelISTLInformation(Dune::stackobject_to_shared_ptr(idx),
|
||||||
Dune::stackobject_to_shared_ptr(ridx),
|
Dune::stackobject_to_shared_ptr(ridx),
|
||||||
grid.comm()));
|
grid.comm()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
// Missing support for MPI or dune-istl -> do nothing.
|
// Missing support for MPI or dune-istl -> do nothing.
|
||||||
void extractParallelGridInformationToISTL(const Dune::CpGrid&, boost::any&)
|
void extractParallelGridInformationToISTL(const Dune::CpGrid&, std::any&)
|
||||||
{}
|
{}
|
||||||
#endif //defined(HAVE_MPI) && defined(HAVE_DUNE_ISTL)
|
#endif //defined(HAVE_MPI) && defined(HAVE_DUNE_ISTL)
|
||||||
#endif //defined(HAVE_OPM_GRID)
|
#endif //defined(HAVE_OPM_GRID)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#ifdef HAVE_OPM_GRID
|
#ifdef HAVE_OPM_GRID
|
||||||
|
|
||||||
#include<opm/grid/CpGrid.hpp>
|
#include<opm/grid/CpGrid.hpp>
|
||||||
#include<boost/any.hpp>
|
#include <any>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
@ -37,11 +37,11 @@ namespace Opm
|
|||||||
/// \param[out] anyComm The handle to to store the information in. If grid is a parallel grid
|
/// \param[out] anyComm The handle to to store the information in. If grid is a parallel grid
|
||||||
/// then this will ecapsulate an instance of ParallelISTLInformation.
|
/// then this will ecapsulate an instance of ParallelISTLInformation.
|
||||||
|
|
||||||
void extractParallelGridInformationToISTL(const Dune::CpGrid& grid, boost::any& anyComm);
|
void extractParallelGridInformationToISTL(const Dune::CpGrid& grid, std::any& anyComm);
|
||||||
|
|
||||||
// Grid is not CpGrid --> do nothing.
|
// Grid is not CpGrid --> do nothing.
|
||||||
template <class Grid>
|
template <class Grid>
|
||||||
void extractParallelGridInformationToISTL(const Grid&, boost::any&)
|
void extractParallelGridInformationToISTL(const Grid&, std::any&)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
} // end namespace Opm
|
} // end namespace Opm
|
||||||
|
@ -123,14 +123,14 @@ public:
|
|||||||
WellModelMatrixAdapter (const M& A,
|
WellModelMatrixAdapter (const M& A,
|
||||||
const M& A_for_precond,
|
const M& A_for_precond,
|
||||||
const WellModel& wellMod,
|
const WellModel& wellMod,
|
||||||
const boost::any& parallelInformation OPM_UNUSED_NOMPI = boost::any() )
|
const std::any& parallelInformation OPM_UNUSED_NOMPI = std::any() )
|
||||||
: A_( A ), A_for_precond_(A_for_precond), wellMod_( wellMod ), comm_()
|
: A_( A ), A_for_precond_(A_for_precond), wellMod_( wellMod ), comm_()
|
||||||
{
|
{
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if( parallelInformation.type() == typeid(ParallelISTLInformation) )
|
if( parallelInformation.type() == typeid(ParallelISTLInformation) )
|
||||||
{
|
{
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>( parallelInformation);
|
std::any_cast<const ParallelISTLInformation&>( parallelInformation);
|
||||||
comm_.reset( new communication_type( info.communicator() ) );
|
comm_.reset( new communication_type( info.communicator() ) );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -375,7 +375,7 @@ protected:
|
|||||||
int iterations () const { return iterations_; }
|
int iterations () const { return iterations_; }
|
||||||
|
|
||||||
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
|
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
|
||||||
const boost::any& parallelInformation() const { return parallelInformation_; }
|
const std::any& parallelInformation() const { return parallelInformation_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// \brief construct the CPR preconditioner and the solver.
|
/// \brief construct the CPR preconditioner and the solver.
|
||||||
@ -568,7 +568,7 @@ protected:
|
|||||||
if (parallelInformation_.type() == typeid(ParallelISTLInformation))
|
if (parallelInformation_.type() == typeid(ParallelISTLInformation))
|
||||||
{
|
{
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>( parallelInformation_);
|
std::any_cast<const ParallelISTLInformation&>( parallelInformation_);
|
||||||
Comm istlComm(info.communicator());
|
Comm istlComm(info.communicator());
|
||||||
|
|
||||||
// Construct operator, scalar product and vectors needed.
|
// Construct operator, scalar product and vectors needed.
|
||||||
@ -604,7 +604,7 @@ protected:
|
|||||||
{
|
{
|
||||||
const size_t size = opA.getmat().N();
|
const size_t size = opA.getmat().N();
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>( parallelInformation_);
|
std::any_cast<const ParallelISTLInformation&>( parallelInformation_);
|
||||||
|
|
||||||
// As we use a dune-istl with block size np the number of components
|
// As we use a dune-istl with block size np the number of components
|
||||||
// per parallel is only one.
|
// per parallel is only one.
|
||||||
@ -939,7 +939,7 @@ protected:
|
|||||||
const Simulator& simulator_;
|
const Simulator& simulator_;
|
||||||
mutable int iterations_;
|
mutable int iterations_;
|
||||||
mutable bool converged_;
|
mutable bool converged_;
|
||||||
boost::any parallelInformation_;
|
std::any parallelInformation_;
|
||||||
|
|
||||||
std::unique_ptr<Matrix> matrix_;
|
std::unique_ptr<Matrix> matrix_;
|
||||||
std::unique_ptr<Matrix> noGhostMat_;
|
std::unique_ptr<Matrix> noGhostMat_;
|
||||||
|
@ -135,7 +135,7 @@ namespace Opm
|
|||||||
const size_t size = opAParallel_->getmat().N();
|
const size_t size = opAParallel_->getmat().N();
|
||||||
|
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
|
std::any_cast<const ParallelISTLInformation&>( this->parallelInformation_);
|
||||||
|
|
||||||
// As we use a dune-istl with block size np the number of components
|
// As we use a dune-istl with block size np the number of components
|
||||||
// per parallel is only one.
|
// per parallel is only one.
|
||||||
|
@ -81,7 +81,7 @@ public:
|
|||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if (parallelInformation_.type() == typeid(ParallelISTLInformation)) {
|
if (parallelInformation_.type() == typeid(ParallelISTLInformation)) {
|
||||||
// Parallel case.
|
// Parallel case.
|
||||||
const ParallelISTLInformation* parinfo = boost::any_cast<ParallelISTLInformation>(¶llelInformation_);
|
const ParallelISTLInformation* parinfo = std::any_cast<ParallelISTLInformation>(¶llelInformation_);
|
||||||
assert(parinfo);
|
assert(parinfo);
|
||||||
comm_.reset(new Communication(parinfo->communicator()));
|
comm_.reset(new Communication(parinfo->communicator()));
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ public:
|
|||||||
static bool firstcall = true;
|
static bool firstcall = true;
|
||||||
if (firstcall && parallelInformation_.type() == typeid(ParallelISTLInformation)) {
|
if (firstcall && parallelInformation_.type() == typeid(ParallelISTLInformation)) {
|
||||||
// Parallel case.
|
// Parallel case.
|
||||||
const ParallelISTLInformation* parinfo = boost::any_cast<ParallelISTLInformation>(¶llelInformation_);
|
const ParallelISTLInformation* parinfo = std::any_cast<ParallelISTLInformation>(¶llelInformation_);
|
||||||
assert(parinfo);
|
assert(parinfo);
|
||||||
const size_t size = mat.istlMatrix().N();
|
const size_t size = mat.istlMatrix().N();
|
||||||
parinfo->copyValuesTo(comm_->indexSet(), comm_->remoteIndices(), size, 1);
|
parinfo->copyValuesTo(comm_->indexSet(), comm_->remoteIndices(), size, 1);
|
||||||
@ -205,7 +205,7 @@ protected:
|
|||||||
boost::property_tree::ptree prm_;
|
boost::property_tree::ptree prm_;
|
||||||
VectorType rhs_;
|
VectorType rhs_;
|
||||||
Dune::InverseOperatorResult res_;
|
Dune::InverseOperatorResult res_;
|
||||||
boost::any parallelInformation_;
|
std::any parallelInformation_;
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
std::unique_ptr<Communication> comm_;
|
std::unique_ptr<Communication> comm_;
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include <opm/grid/UnstructuredGrid.h>
|
#include <opm/grid/UnstructuredGrid.h>
|
||||||
#include <opm/common/ErrorMacros.hpp>
|
#include <opm/common/ErrorMacros.hpp>
|
||||||
#include <boost/any.hpp>
|
#include <any>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -671,7 +671,7 @@ namespace Opm
|
|||||||
/// then this will ecapsulate an instance of ParallelISTLInformation.
|
/// then this will ecapsulate an instance of ParallelISTLInformation.
|
||||||
/// \param grid The grid to inspect.
|
/// \param grid The grid to inspect.
|
||||||
|
|
||||||
inline void extractParallelGridInformationToISTL(boost::any& anyComm, const UnstructuredGrid& grid)
|
inline void extractParallelGridInformationToISTL(std::any& anyComm, const UnstructuredGrid& grid)
|
||||||
{
|
{
|
||||||
(void)anyComm; (void)grid;
|
(void)anyComm; (void)grid;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <boost/any.hpp>
|
|
||||||
#include <boost/range/iterator_range.hpp>
|
#include <boost/range/iterator_range.hpp>
|
||||||
#include <opm/simulators/timestepping/TimeStepControlInterface.hpp>
|
#include <opm/simulators/timestepping/TimeStepControlInterface.hpp>
|
||||||
|
|
||||||
|
@ -462,15 +462,15 @@ namespace Opm
|
|||||||
bool allDrawDownWrongDirection(const Simulator& ebos_simulator) const;
|
bool allDrawDownWrongDirection(const Simulator& ebos_simulator) const;
|
||||||
|
|
||||||
|
|
||||||
boost::optional<double> computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
std::optional<double> computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
||||||
const std::vector<Scalar>& B_avg,
|
const std::vector<Scalar>& B_avg,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
boost::optional<double> computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
std::optional<double> computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
||||||
const std::vector<Scalar>& B_avg,
|
const std::vector<Scalar>& B_avg,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
double maxPerfPress(const Simulator& ebos_simulator) const;
|
double maxPerfPress(const Simulator& ebos_simulator) const;
|
||||||
|
|
||||||
|
@ -3546,7 +3546,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
boost::optional<double>
|
std::optional<double>
|
||||||
MultisegmentWell<TypeTag>::
|
MultisegmentWell<TypeTag>::
|
||||||
computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
||||||
const std::vector<Scalar>& B_avg,
|
const std::vector<Scalar>& B_avg,
|
||||||
@ -3628,7 +3628,7 @@ namespace Opm
|
|||||||
// empty optional.
|
// empty optional.
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE_INOPERABLE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE_INOPERABLE",
|
||||||
"Robust bhp(thp) solve failed due to inoperability for well " + name());
|
"Robust bhp(thp) solve failed due to inoperability for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
} else {
|
} else {
|
||||||
// Still producing, even at high bhp.
|
// Still producing, even at high bhp.
|
||||||
assert(f_high < 0.0);
|
assert(f_high < 0.0);
|
||||||
@ -3712,7 +3712,7 @@ namespace Opm
|
|||||||
// Return failure.
|
// Return failure.
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE_BRACKETING_FAILURE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE_BRACKETING_FAILURE",
|
||||||
"Robust bhp(thp) solve failed due to bracketing failure for well " + name());
|
"Robust bhp(thp) solve failed due to bracketing failure for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3738,7 +3738,7 @@ namespace Opm
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3746,7 +3746,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
boost::optional<double>
|
std::optional<double>
|
||||||
MultisegmentWell<TypeTag>::
|
MultisegmentWell<TypeTag>::
|
||||||
computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
||||||
const std::vector<Scalar>& B_avg,
|
const std::vector<Scalar>& B_avg,
|
||||||
@ -3906,7 +3906,7 @@ namespace Opm
|
|||||||
|
|
||||||
// Handle the no solution case.
|
// Handle the no solution case.
|
||||||
if (sign_change_index == -1) {
|
if (sign_change_index == -1) {
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solve for the proper solution in the given interval.
|
// Solve for the proper solution in the given interval.
|
||||||
@ -3925,7 +3925,7 @@ namespace Opm
|
|||||||
assert(low == controls.bhp_limit);
|
assert(low == controls.bhp_limit);
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const double solved_bhp = RegulaFalsiBisection<WarnAndContinueOnError>::
|
const double solved_bhp = RegulaFalsiBisection<WarnAndContinueOnError>::
|
||||||
@ -3939,7 +3939,7 @@ namespace Opm
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <dune/common/dynvector.hh>
|
#include <dune/common/dynvector.hh>
|
||||||
#include <dune/common/dynmatrix.hh>
|
#include <dune/common/dynmatrix.hh>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <optional>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
@ -509,13 +509,13 @@ namespace Opm
|
|||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
|
|
||||||
boost::optional<double> computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
std::optional<double> computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
boost::optional<double> computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
std::optional<double> computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3759,7 +3759,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
boost::optional<double>
|
std::optional<double>
|
||||||
StandardWell<TypeTag>::
|
StandardWell<TypeTag>::
|
||||||
computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
computeBhpAtThpLimitProd(const Simulator& ebos_simulator,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
@ -3923,7 +3923,7 @@ namespace Opm
|
|||||||
|
|
||||||
// Handle the no solution case.
|
// Handle the no solution case.
|
||||||
if (sign_change_index == -1) {
|
if (sign_change_index == -1) {
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solve for the proper solution in the given interval.
|
// Solve for the proper solution in the given interval.
|
||||||
@ -3942,7 +3942,7 @@ namespace Opm
|
|||||||
assert(low == controls.bhp_limit);
|
assert(low == controls.bhp_limit);
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const double solved_bhp = RegulaFalsiBisection<>::
|
const double solved_bhp = RegulaFalsiBisection<>::
|
||||||
@ -3956,7 +3956,7 @@ namespace Opm
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3964,7 +3964,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
boost::optional<double>
|
std::optional<double>
|
||||||
StandardWell<TypeTag>::
|
StandardWell<TypeTag>::
|
||||||
computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
computeBhpAtThpLimitInj(const Simulator& ebos_simulator,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
@ -4123,7 +4123,7 @@ namespace Opm
|
|||||||
|
|
||||||
// Handle the no solution case.
|
// Handle the no solution case.
|
||||||
if (sign_change_index == -1) {
|
if (sign_change_index == -1) {
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solve for the proper solution in the given interval.
|
// Solve for the proper solution in the given interval.
|
||||||
@ -4142,7 +4142,7 @@ namespace Opm
|
|||||||
assert(low == controls.bhp_limit);
|
assert(low == controls.bhp_limit);
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const double solved_bhp = RegulaFalsiBisection<>::
|
const double solved_bhp = RegulaFalsiBisection<>::
|
||||||
@ -4156,7 +4156,7 @@ namespace Opm
|
|||||||
catch (...) {
|
catch (...) {
|
||||||
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
deferred_logger.warning("FAILED_ROBUST_BHP_THP_SOLVE",
|
||||||
"Robust bhp(thp) solve failed for well " + name());
|
"Robust bhp(thp) solve failed for well " + name());
|
||||||
return boost::optional<double>();
|
return std::optional<double>();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user