move ebos/eclgenericproblem.[hh|cc] to opm/simulators/flow

This commit is contained in:
Arne Morten Kvarving 2024-02-02 10:46:44 +01:00
parent 15339fe02f
commit 6f5d53b20b
8 changed files with 108 additions and 114 deletions

View File

@ -23,7 +23,6 @@
# originally generated with the command: # originally generated with the command:
# find opm -name '*.c*' -printf '\t%p\n' | sort # find opm -name '*.c*' -printf '\t%p\n' | sort
list (APPEND MAIN_SOURCE_FILES list (APPEND MAIN_SOURCE_FILES
ebos/eclgenericproblem.cc
opm/core/props/BlackoilPhases.cpp opm/core/props/BlackoilPhases.cpp
opm/core/props/phaseUsageFromDeck.cpp opm/core/props/phaseUsageFromDeck.cpp
opm/core/props/satfunc/RelpermDiagnostics.cpp opm/core/props/satfunc/RelpermDiagnostics.cpp
@ -34,6 +33,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow/ConvergenceOutputConfiguration.cpp opm/simulators/flow/ConvergenceOutputConfiguration.cpp
opm/simulators/flow/EclGenericWriter.cpp opm/simulators/flow/EclGenericWriter.cpp
opm/simulators/flow/ExtraConvergenceOutputThread.cpp opm/simulators/flow/ExtraConvergenceOutputThread.cpp
opm/simulators/flow/FlowGenericProblem.cpp
opm/simulators/flow/FlowGenericVanguard.cpp opm/simulators/flow/FlowGenericVanguard.cpp
opm/simulators/flow/FlowUtils.cpp opm/simulators/flow/FlowUtils.cpp
opm/simulators/flow/GenericCpGridVanguard.cpp opm/simulators/flow/GenericCpGridVanguard.cpp
@ -410,8 +410,6 @@ list (APPEND TEST_DATA_FILES
# originally generated with the command: # originally generated with the command:
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort # find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
list (APPEND PUBLIC_HEADER_FILES list (APPEND PUBLIC_HEADER_FILES
ebos/eclgenericproblem.hh
ebos/eclgenericproblem_impl.hh
ebos/eclnewtonmethod.hh ebos/eclnewtonmethod.hh
ebos/eclproblem.hh ebos/eclproblem.hh
opm/simulators/flow/ActionHandler.hpp opm/simulators/flow/ActionHandler.hpp
@ -436,6 +434,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/FemCpGridCompat.hpp opm/simulators/flow/FemCpGridCompat.hpp
opm/simulators/flow/FIBlackoilModel.hpp opm/simulators/flow/FIBlackoilModel.hpp
opm/simulators/flow/FlowBaseVanguard.hpp opm/simulators/flow/FlowBaseVanguard.hpp
opm/simulators/flow/FlowGenericProblem.hpp
opm/simulators/flow/FlowGenericProblem_impl.hpp
opm/simulators/flow/FlowGenericVanguard.hpp opm/simulators/flow/FlowGenericVanguard.hpp
opm/simulators/flow/FlowMain.hpp opm/simulators/flow/FlowMain.hpp
opm/simulators/flow/FlowProblemProperties.hpp opm/simulators/flow/FlowProblemProperties.hpp

View File

@ -34,7 +34,6 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <ebos/eclgenericproblem.hh>
#include <ebos/eclnewtonmethod.hh> #include <ebos/eclnewtonmethod.hh>
#include <opm/common/utility/TimeService.hpp> #include <opm/common/utility/TimeService.hpp>
@ -73,6 +72,7 @@
#include <opm/simulators/flow/EclWriter.hpp> #include <opm/simulators/flow/EclWriter.hpp>
#include <opm/simulators/flow/EquilInitializer.hpp> #include <opm/simulators/flow/EquilInitializer.hpp>
#include <opm/simulators/flow/FIBlackoilModel.hpp> #include <opm/simulators/flow/FIBlackoilModel.hpp>
#include <opm/simulators/flow/FlowGenericProblem.hpp>
#include <opm/simulators/flow/FlowProblemProperties.hpp> #include <opm/simulators/flow/FlowProblemProperties.hpp>
#include <opm/simulators/flow/FlowThresholdPressure.hpp> #include <opm/simulators/flow/FlowThresholdPressure.hpp>
#include <opm/simulators/flow/NewTranFluxModule.hpp> #include <opm/simulators/flow/NewTranFluxModule.hpp>
@ -109,13 +109,13 @@ namespace Opm {
*/ */
template <class TypeTag> template <class TypeTag>
class EclProblem : public GetPropType<TypeTag, Properties::BaseProblem> class EclProblem : public GetPropType<TypeTag, Properties::BaseProblem>
, public EclGenericProblem<GetPropType<TypeTag, Properties::GridView>, , public FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::FluidSystem>,
GetPropType<TypeTag, Properties::Scalar>> GetPropType<TypeTag, Properties::Scalar>>
{ {
using BaseType = EclGenericProblem<GetPropType<TypeTag, Properties::GridView>, using BaseType = FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::FluidSystem>,
GetPropType<TypeTag, Properties::Scalar>>; GetPropType<TypeTag, Properties::Scalar>>;
using ParentType = GetPropType<TypeTag, Properties::BaseProblem>; using ParentType = GetPropType<TypeTag, Properties::BaseProblem>;
using Implementation = GetPropType<TypeTag, Properties::Problem>; using Implementation = GetPropType<TypeTag, Properties::Problem>;
@ -199,13 +199,13 @@ class EclProblem : public GetPropType<TypeTag, Properties::BaseProblem>
using DirectionalMobilityPtr = Utility::CopyablePtr<DirectionalMobility<TypeTag, Evaluation>>; using DirectionalMobilityPtr = Utility::CopyablePtr<DirectionalMobility<TypeTag, Evaluation>>;
public: public:
using EclGenericProblem<GridView,FluidSystem,Scalar>::briefDescription; using FlowGenericProblem<GridView,FluidSystem,Scalar>::briefDescription;
using EclGenericProblem<GridView,FluidSystem,Scalar>::helpPreamble; using FlowGenericProblem<GridView,FluidSystem,Scalar>::helpPreamble;
using EclGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteOutput; using FlowGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteOutput;
using EclGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteRestartFile; using FlowGenericProblem<GridView,FluidSystem,Scalar>::shouldWriteRestartFile;
using EclGenericProblem<GridView,FluidSystem,Scalar>::rockCompressibility; using FlowGenericProblem<GridView,FluidSystem,Scalar>::rockCompressibility;
using EclGenericProblem<GridView,FluidSystem,Scalar>::rockReferencePressure; using FlowGenericProblem<GridView,FluidSystem,Scalar>::rockReferencePressure;
using EclGenericProblem<GridView,FluidSystem,Scalar>::porosity; using FlowGenericProblem<GridView,FluidSystem,Scalar>::porosity;
/*! /*!
* \copydoc FvBaseProblem::registerParameters * \copydoc FvBaseProblem::registerParameters
@ -272,9 +272,9 @@ public:
*/ */
EclProblem(Simulator& simulator) EclProblem(Simulator& simulator)
: ParentType(simulator) : ParentType(simulator)
, EclGenericProblem<GridView,FluidSystem,Scalar>(simulator.vanguard().eclState(), , FlowGenericProblem<GridView,FluidSystem,Scalar>(simulator.vanguard().eclState(),
simulator.vanguard().schedule(), simulator.vanguard().schedule(),
simulator.vanguard().gridView()) simulator.vanguard().gridView())
, transmissibilities_(simulator.vanguard().eclState(), , transmissibilities_(simulator.vanguard().eclState(),
simulator.vanguard().gridView(), simulator.vanguard().gridView(),
simulator.vanguard().cartesianIndexMapper(), simulator.vanguard().cartesianIndexMapper(),
@ -1079,7 +1079,7 @@ public:
std::shared_ptr<EclMaterialLawManager> materialLawManager() std::shared_ptr<EclMaterialLawManager> materialLawManager()
{ return materialLawManager_; } { return materialLawManager_; }
using EclGenericProblem<GridView,FluidSystem,Scalar>::pvtRegionIndex; using FlowGenericProblem<GridView,FluidSystem,Scalar>::pvtRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1087,7 +1087,7 @@ public:
unsigned pvtRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned pvtRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return pvtRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return pvtRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using EclGenericProblem<GridView,FluidSystem,Scalar>::satnumRegionIndex; using FlowGenericProblem<GridView,FluidSystem,Scalar>::satnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1095,7 +1095,7 @@ public:
unsigned satnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned satnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->satnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->satnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using EclGenericProblem<GridView,FluidSystem,Scalar>::miscnumRegionIndex; using FlowGenericProblem<GridView,FluidSystem,Scalar>::miscnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1103,7 +1103,7 @@ public:
unsigned miscnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned miscnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->miscnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->miscnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using EclGenericProblem<GridView,FluidSystem,Scalar>::plmixnumRegionIndex; using FlowGenericProblem<GridView,FluidSystem,Scalar>::plmixnumRegionIndex;
/*! /*!
* \brief Returns the index of the relevant region for thermodynmic properties * \brief Returns the index of the relevant region for thermodynmic properties
*/ */
@ -1111,7 +1111,7 @@ public:
unsigned plmixnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const unsigned plmixnumRegionIndex(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
{ return this->plmixnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); } { return this->plmixnumRegionIndex(context.globalSpaceIndex(spaceIdx, timeIdx)); }
using EclGenericProblem<GridView,FluidSystem,Scalar>::maxPolymerAdsorption; using FlowGenericProblem<GridView,FluidSystem,Scalar>::maxPolymerAdsorption;
/*! /*!
* \brief Returns the max polymer adsorption value * \brief Returns the max polymer adsorption value
*/ */

View File

@ -27,10 +27,10 @@
#include <opm/grid/cpgrid/GridHelpers.hpp> #include <opm/grid/cpgrid/GridHelpers.hpp>
// these are not explicitly instanced in library // these are not explicitly instanced in library
#include <ebos/eclgenericproblem_impl.hh>
#include <opm/simulators/flow/AluGridVanguard.hpp> #include <opm/simulators/flow/AluGridVanguard.hpp>
#include <opm/simulators/flow/CollectDataOnIORank_impl.hpp> #include <opm/simulators/flow/CollectDataOnIORank_impl.hpp>
#include <opm/simulators/flow/EclGenericWriter_impl.hpp> #include <opm/simulators/flow/EclGenericWriter_impl.hpp>
#include <opm/simulators/flow/FlowGenericProblem_impl.hpp>
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp> #include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#include <opm/simulators/flow/GenericTracerModel_impl.hpp> #include <opm/simulators/flow/GenericTracerModel_impl.hpp>
#include <opm/simulators/flow/Transmissibility_impl.hpp> #include <opm/simulators/flow/Transmissibility_impl.hpp>

View File

@ -27,9 +27,9 @@
#include <opm/simulators/flow/Main.hpp> #include <opm/simulators/flow/Main.hpp>
// these are not explicitly instanced in library // these are not explicitly instanced in library
#include <ebos/eclgenericproblem_impl.hh>
#include <opm/simulators/flow/CollectDataOnIORank_impl.hpp> #include <opm/simulators/flow/CollectDataOnIORank_impl.hpp>
#include <opm/simulators/flow/EclGenericWriter_impl.hpp> #include <opm/simulators/flow/EclGenericWriter_impl.hpp>
#include <opm/simulators/flow/FlowGenericProblem_impl.hpp>
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp> #include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#include <opm/simulators/flow/GenericTracerModel_impl.hpp> #include <opm/simulators/flow/GenericTracerModel_impl.hpp>
#include <opm/simulators/flow/Transmissibility_impl.hpp> #include <opm/simulators/flow/Transmissibility_impl.hpp>

View File

@ -22,9 +22,6 @@
*/ */
#include <config.h> #include <config.h>
#include <ebos/eclgenericproblem.hh>
#include <ebos/eclgenericproblem_impl.hh>
#include <dune/grid/common/defaultgridview.hh> #include <dune/grid/common/defaultgridview.hh>
#include <dune/grid/common/gridview.hh> #include <dune/grid/common/gridview.hh>
@ -33,6 +30,8 @@
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp> #include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
#include <opm/simulators/flow/FlowGenericProblem_impl.hpp>
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
#include <dune/fem/gridpart/adaptiveleafgridpart.hh> #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#include <dune/fem/gridpart/common/gridpart2gridview.hh> #include <dune/fem/gridpart/common/gridpart2gridview.hh>
@ -41,21 +40,21 @@
namespace Opm { namespace Opm {
template class EclGenericProblem<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>, template class FlowGenericProblem<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,
double>; double>;
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
template class EclGenericProblem<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>, template class FlowGenericProblem<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,
double>; double>;
template class EclGenericProblem<Dune::Fem::GridPart2GridViewImpl< template class FlowGenericProblem<Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart< Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid, Dune::CpGrid,
Dune::PartitionIteratorType(4), Dune::PartitionIteratorType(4),
false> >, false> >,
BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>, BlackOilFluidSystem<double,BlackOilDefaultIndexTraits>,
double>; double>;
#endif // HAVE_DUNE_FEM #endif // HAVE_DUNE_FEM
} // end namespace Opm } // end namespace Opm

View File

@ -25,8 +25,8 @@
* *
* \copydoc Opm::FlowProblem * \copydoc Opm::FlowProblem
*/ */
#ifndef EWOMS_GENERIC_ECL_PROBLEM_HH #ifndef OPM_FLOW_GENERIC_PROBLEM_HPP
#define EWOMS_GENERIC_ECL_PROBLEM_HH #define OPM_FLOW_GENERIC_PROBLEM_HPP
#include <opm/material/common/UniformXTabulated2DFunction.hpp> #include <opm/material/common/UniformXTabulated2DFunction.hpp>
@ -60,13 +60,13 @@ int eclPositionalParameter(Dune::ParameterTree& tree,
int paramIdx); int paramIdx);
/*! /*!
* \ingroup EclBlackOilSimulator * \ingroup BlackOilSimulator
* *
* \brief This problem simulates an input file given in the data format used by the * \brief This problem simulates an input file given in the data format used by the
* commercial ECLiPSE simulator. * commercial ECLiPSE simulator.
*/ */
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
class EclGenericProblem class FlowGenericProblem
{ {
public: public:
using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>; using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>;
@ -77,14 +77,14 @@ public:
Scalar compressibility; Scalar compressibility;
}; };
EclGenericProblem(const EclipseState& eclState, FlowGenericProblem(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView); const GridView& gridView);
static EclGenericProblem serializationTestObject(const EclipseState& eclState, static FlowGenericProblem serializationTestObject(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView); const GridView& gridView);
/*! /*!
* \copydoc FvBaseProblem::helpPreamble * \copydoc FvBaseProblem::helpPreamble
@ -275,7 +275,7 @@ public:
int numPressurePointsEquil() const int numPressurePointsEquil() const
{ return numPressurePointsEquil_; } { return numPressurePointsEquil_; }
bool operator==(const EclGenericProblem& rhs) const; bool operator==(const FlowGenericProblem& rhs) const;
template<class Serializer> template<class Serializer>
void serializeOp(Serializer& serializer) void serializeOp(Serializer& serializer)
@ -402,4 +402,4 @@ private:
} // namespace Opm } // namespace Opm
#endif #endif // OPM_FLOW_GENERIC_PROBLEM_HPP

View File

@ -20,10 +20,8 @@
module for the precise wording of the license and the list of module for the precise wording of the license and the list of
copyright holders. copyright holders.
*/ */
#ifndef EWOMS_GENERIC_ECL_PROBLEM_IMPL_HH #ifndef OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP
#define EWOMS_GENERIC_ECL_PROBLEM_IMPL_HH #define OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP
#include <ebos/eclgenericproblem.hh>
#include <dune/common/parametertree.hh> #include <dune/common/parametertree.hh>
@ -33,6 +31,7 @@
#include <opm/input/eclipse/Schedule/Schedule.hpp> #include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Units/Units.hpp> #include <opm/input/eclipse/Units/Units.hpp>
#include <opm/simulators/flow/FlowGenericProblem.hpp>
#include <opm/simulators/flow/SolutionContainers.hpp> #include <opm/simulators/flow/SolutionContainers.hpp>
#include <boost/date_time.hpp> #include <boost/date_time.hpp>
@ -41,9 +40,8 @@
#include <fmt/ranges.h> #include <fmt/ranges.h>
#include <algorithm> #include <algorithm>
#include <limits>
#include <stdexcept>
#include <iostream> #include <iostream>
#include <stdexcept>
namespace Opm { namespace Opm {
@ -81,10 +79,10 @@ int eclPositionalParameter(Dune::ParameterTree& tree,
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
EclGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem,Scalar>::
EclGenericProblem(const EclipseState& eclState, FlowGenericProblem(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView) const GridView& gridView)
: eclState_(eclState) : eclState_(eclState)
, schedule_(schedule) , schedule_(schedule)
, gridView_(gridView) , gridView_(gridView)
@ -94,13 +92,13 @@ EclGenericProblem(const EclipseState& eclState,
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
EclGenericProblem<GridView,FluidSystem,Scalar> FlowGenericProblem<GridView,FluidSystem,Scalar>
EclGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem,Scalar>::
serializationTestObject(const EclipseState& eclState, serializationTestObject(const EclipseState& eclState,
const Schedule& schedule, const Schedule& schedule,
const GridView& gridView) const GridView& gridView)
{ {
EclGenericProblem result(eclState, schedule, gridView); FlowGenericProblem result(eclState, schedule, gridView);
result.maxOilSaturation_ = {1.0, 2.0}; result.maxOilSaturation_ = {1.0, 2.0};
result.maxWaterSaturation_ = {6.0}; result.maxWaterSaturation_ = {6.0};
result.minRefPressure_ = {7.0, 8.0, 9.0, 10.0}; result.minRefPressure_ = {7.0, 8.0, 9.0, 10.0};
@ -116,11 +114,11 @@ serializationTestObject(const EclipseState& eclState,
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
std::string std::string
EclGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem,Scalar>::
helpPreamble(int, helpPreamble(int,
const char **argv) const char **argv)
{ {
std::string desc = EclGenericProblem::briefDescription(); std::string desc = FlowGenericProblem::briefDescription();
if (!desc.empty()) if (!desc.empty())
desc = desc + "\n"; desc = desc + "\n";
@ -131,7 +129,7 @@ helpPreamble(int,
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
std::string std::string
EclGenericProblem<GridView,FluidSystem,Scalar>:: FlowGenericProblem<GridView,FluidSystem,Scalar>::
briefDescription() briefDescription()
{ {
if (briefDescription_.empty()) if (briefDescription_.empty())
@ -148,7 +146,7 @@ briefDescription()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
readRockParameters_(const std::vector<Scalar>& cellCenterDepths, readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
std::function<std::array<int,3>(const unsigned)> ijkIndex) std::function<std::array<int,3>(const unsigned)> ijkIndex)
{ {
@ -223,7 +221,7 @@ readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
readRockCompactionParameters_() readRockCompactionParameters_()
{ {
const auto& rock_config = eclState_.getSimulationConfig().rock_config(); const auto& rock_config = eclState_.getSimulationConfig().rock_config();
@ -316,7 +314,7 @@ readRockCompactionParameters_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
rockCompressibility(unsigned globalSpaceIdx) const rockCompressibility(unsigned globalSpaceIdx) const
{ {
if (this->rockParams_.empty()) if (this->rockParams_.empty())
@ -330,7 +328,7 @@ rockCompressibility(unsigned globalSpaceIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
rockReferencePressure(unsigned globalSpaceIdx) const rockReferencePressure(unsigned globalSpaceIdx) const
{ {
if (this->rockParams_.empty()) if (this->rockParams_.empty())
@ -344,14 +342,14 @@ rockReferencePressure(unsigned globalSpaceIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
porosity(unsigned globalSpaceIdx, unsigned timeIdx) const porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
{ {
return this->referencePorosity_[timeIdx][globalSpaceIdx]; return this->referencePorosity_[timeIdx][globalSpaceIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
rockFraction(unsigned elementIdx, unsigned timeIdx) const rockFraction(unsigned elementIdx, unsigned timeIdx) const
{ {
// the reference porosity is defined as the accumulated pore volume divided by the // the reference porosity is defined as the accumulated pore volume divided by the
@ -364,7 +362,7 @@ rockFraction(unsigned elementIdx, unsigned timeIdx) const
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
template<class T> template<class T>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions) updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions)
{ {
if (!eclState_.fieldProps().has_int(name)) if (!eclState_.fieldProps().has_int(name))
@ -385,7 +383,7 @@ updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regi
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updatePvtnum_() updatePvtnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumPVTTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumPVTTables();
@ -393,7 +391,7 @@ updatePvtnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updateSatnum_() updateSatnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
@ -401,7 +399,7 @@ updateSatnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updateMiscnum_() updateMiscnum_()
{ {
const auto num_regions = 1; // we only support single region const auto num_regions = 1; // we only support single region
@ -409,7 +407,7 @@ updateMiscnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updatePlmixnum_() updatePlmixnum_()
{ {
const auto num_regions = 1; // we only support single region const auto num_regions = 1; // we only support single region
@ -417,7 +415,7 @@ updatePlmixnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updateKrnum_() updateKrnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
@ -427,7 +425,7 @@ updateKrnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
updateImbnum_() updateImbnum_()
{ {
const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables(); const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
@ -437,7 +435,7 @@ updateImbnum_()
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
bool EclGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem,Scalar>::
vapparsActive(int episodeIdx) const vapparsActive(int episodeIdx) const
{ {
const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap(); const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap();
@ -445,7 +443,7 @@ vapparsActive(int episodeIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
bool EclGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem,Scalar>::
beginEpisode_(bool enableExperiments, beginEpisode_(bool enableExperiments,
int episodeIdx) int episodeIdx)
{ {
@ -481,9 +479,8 @@ beginEpisode_(bool enableExperiments,
return false; return false;
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
beginTimeStep_(bool enableExperiments, beginTimeStep_(bool enableExperiments,
int episodeIdx, int episodeIdx,
int timeStepIndex, int timeStepIndex,
@ -510,14 +507,14 @@ beginTimeStep_(bool enableExperiments,
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
initFluidSystem_() initFluidSystem_()
{ {
FluidSystem::initFromState(eclState_, schedule_); FluidSystem::initFromState(eclState_, schedule_);
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
void EclGenericProblem<GridView,FluidSystem,Scalar>:: void FlowGenericProblem<GridView,FluidSystem,Scalar>::
readBlackoilExtentionsInitialConditions_(std::size_t numDof, readBlackoilExtentionsInitialConditions_(std::size_t numDof,
bool enableSolvent, bool enableSolvent,
bool enablePolymer, bool enablePolymer,
@ -581,9 +578,8 @@ readBlackoilExtentionsInitialConditions_(std::size_t numDof,
} }
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
maxWaterSaturation(unsigned globalDofIdx) const maxWaterSaturation(unsigned globalDofIdx) const
{ {
if (maxWaterSaturation_.empty()) if (maxWaterSaturation_.empty())
@ -593,7 +589,7 @@ maxWaterSaturation(unsigned globalDofIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
minOilPressure(unsigned globalDofIdx) const minOilPressure(unsigned globalDofIdx) const
{ {
if (minRefPressure_.empty()) if (minRefPressure_.empty())
@ -603,7 +599,7 @@ minOilPressure(unsigned globalDofIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
overburdenPressure(unsigned elementIdx) const overburdenPressure(unsigned elementIdx) const
{ {
if (overburdenPressure_.empty()) if (overburdenPressure_.empty())
@ -613,7 +609,7 @@ overburdenPressure(unsigned elementIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
solventSaturation(unsigned elemIdx) const solventSaturation(unsigned elemIdx) const
{ {
if (solventSaturation_.empty()) if (solventSaturation_.empty())
@ -622,9 +618,8 @@ solventSaturation(unsigned elemIdx) const
return solventSaturation_[elemIdx]; return solventSaturation_[elemIdx];
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
solventRsw(unsigned elemIdx) const solventRsw(unsigned elemIdx) const
{ {
if (solventRsw_.empty()) if (solventRsw_.empty())
@ -634,7 +629,7 @@ solventRsw(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
drsdtcon(unsigned elemIdx, int episodeIdx) const drsdtcon(unsigned elemIdx, int episodeIdx) const
{ {
return this->mixControls_.drsdtcon(elemIdx, episodeIdx, return this->mixControls_.drsdtcon(elemIdx, episodeIdx,
@ -642,7 +637,7 @@ drsdtcon(unsigned elemIdx, int episodeIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
polymerConcentration(unsigned elemIdx) const polymerConcentration(unsigned elemIdx) const
{ {
if (polymer_.concentration.empty()) { if (polymer_.concentration.empty()) {
@ -653,7 +648,7 @@ polymerConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
polymerMolecularWeight(const unsigned elemIdx) const polymerMolecularWeight(const unsigned elemIdx) const
{ {
if (polymer_.moleWeight.empty()) { if (polymer_.moleWeight.empty()) {
@ -664,7 +659,7 @@ polymerMolecularWeight(const unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
microbialConcentration(unsigned elemIdx) const microbialConcentration(unsigned elemIdx) const
{ {
if (micp_.microbialConcentration.empty()) { if (micp_.microbialConcentration.empty()) {
@ -675,7 +670,7 @@ microbialConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
oxygenConcentration(unsigned elemIdx) const oxygenConcentration(unsigned elemIdx) const
{ {
if (micp_.oxygenConcentration.empty()) { if (micp_.oxygenConcentration.empty()) {
@ -686,7 +681,7 @@ oxygenConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
ureaConcentration(unsigned elemIdx) const ureaConcentration(unsigned elemIdx) const
{ {
if (micp_.ureaConcentration.empty()) { if (micp_.ureaConcentration.empty()) {
@ -697,7 +692,7 @@ ureaConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
biofilmConcentration(unsigned elemIdx) const biofilmConcentration(unsigned elemIdx) const
{ {
if (micp_.biofilmConcentration.empty()) { if (micp_.biofilmConcentration.empty()) {
@ -708,7 +703,7 @@ biofilmConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
calciteConcentration(unsigned elemIdx) const calciteConcentration(unsigned elemIdx) const
{ {
if (micp_.calciteConcentration.empty()) { if (micp_.calciteConcentration.empty()) {
@ -719,7 +714,7 @@ calciteConcentration(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
unsigned EclGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>::
pvtRegionIndex(unsigned elemIdx) const pvtRegionIndex(unsigned elemIdx) const
{ {
if (pvtnum_.empty()) if (pvtnum_.empty())
@ -729,7 +724,7 @@ pvtRegionIndex(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
unsigned EclGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>::
satnumRegionIndex(unsigned elemIdx) const satnumRegionIndex(unsigned elemIdx) const
{ {
if (satnum_.empty()) if (satnum_.empty())
@ -739,7 +734,7 @@ satnumRegionIndex(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
unsigned EclGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>::
miscnumRegionIndex(unsigned elemIdx) const miscnumRegionIndex(unsigned elemIdx) const
{ {
if (miscnum_.empty()) if (miscnum_.empty())
@ -749,7 +744,7 @@ miscnumRegionIndex(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
unsigned EclGenericProblem<GridView,FluidSystem,Scalar>:: unsigned FlowGenericProblem<GridView,FluidSystem,Scalar>::
plmixnumRegionIndex(unsigned elemIdx) const plmixnumRegionIndex(unsigned elemIdx) const
{ {
if (plmixnum_.empty()) if (plmixnum_.empty())
@ -759,7 +754,7 @@ plmixnumRegionIndex(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
Scalar EclGenericProblem<GridView,FluidSystem,Scalar>:: Scalar FlowGenericProblem<GridView,FluidSystem,Scalar>::
maxPolymerAdsorption(unsigned elemIdx) const maxPolymerAdsorption(unsigned elemIdx) const
{ {
if (polymer_.maxAdsorption.empty()) { if (polymer_.maxAdsorption.empty()) {
@ -770,8 +765,8 @@ maxPolymerAdsorption(unsigned elemIdx) const
} }
template<class GridView, class FluidSystem, class Scalar> template<class GridView, class FluidSystem, class Scalar>
bool EclGenericProblem<GridView,FluidSystem,Scalar>:: bool FlowGenericProblem<GridView,FluidSystem,Scalar>::
operator==(const EclGenericProblem& rhs) const operator==(const FlowGenericProblem& rhs) const
{ {
return this->maxWaterSaturation_ == rhs.maxWaterSaturation_ && return this->maxWaterSaturation_ == rhs.maxWaterSaturation_ &&
this->minRefPressure_ == rhs.minRefPressure_ && this->minRefPressure_ == rhs.minRefPressure_ &&
@ -785,4 +780,4 @@ operator==(const EclGenericProblem& rhs) const
} // namespace Opm } // namespace Opm
#endif // EWOMS_GENERIC_ECL_PROBLEM_IMPL_HH #endif // OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP

View File

@ -239,7 +239,7 @@ BOOST_AUTO_TEST_CASE(EclGenericProblem)
auto gridView = grid.leafGridView(); auto gridView = grid.leafGridView();
#endif // HAVE_DUNE_FEM #endif // HAVE_DUNE_FEM
auto data_out auto data_out
= Opm::EclGenericProblem<GridView, Opm::BlackOilFluidSystem<double, Opm::BlackOilDefaultIndexTraits>, double>:: = Opm::FlowGenericProblem<GridView, Opm::BlackOilFluidSystem<double, Opm::BlackOilDefaultIndexTraits>, double>::
serializationTestObject(eclState, schedule, gridView); serializationTestObject(eclState, schedule, gridView);
Opm::Serialization::MemPacker packer; Opm::Serialization::MemPacker packer;
Opm::Serializer ser(packer); Opm::Serializer ser(packer);