Merge pull request #925 from akva2/typetag_free_params2

Move parameters to typetag free parameter system: Batch 3
This commit is contained in:
Bård Skaflestad 2024-08-14 14:43:50 +02:00 committed by GitHub
commit d271cd3e06
62 changed files with 686 additions and 1899 deletions

View File

@ -75,21 +75,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashEcfvProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Parameters
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashEcfvProblem; using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashEcfvProblem;
#if ! HAVE_QUAD
Opm::Co2InjectionTolerance = 1e-5;
#endif
return Opm::start<EcfvProblemTypeTag>(argc, argv); return Opm::start<EcfvProblemTypeTag>(argc, argv);
} }

View File

@ -77,21 +77,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiEcfvProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Parameters
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiEcfvProblem; using EcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiEcfvProblem;
#if ! HAVE_QUAD
Opm::Co2InjectionTolerance = 1e-5;
#endif
return Opm::start<EcfvProblemTypeTag>(argc, argv); return Opm::start<EcfvProblemTypeTag>(argc, argv);
} }

View File

@ -73,21 +73,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashNiVcfvProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Parameters
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiVcfvProblem; using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashNiVcfvProblem;
#if ! HAVE_QUAD
Opm::Co2InjectionTolerance = 1e-5;
#endif
return Opm::start<VcfvProblemTypeTag>(argc, argv); return Opm::start<VcfvProblemTypeTag>(argc, argv);
} }

View File

@ -69,21 +69,11 @@ struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
#if ! HAVE_QUAD
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::Co2InjectionFlashVcfvProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
#endif
} // namespace Opm::Parameters
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashVcfvProblem; using VcfvProblemTypeTag = Opm::Properties::TTag::Co2InjectionFlashVcfvProblem;
#if ! HAVE_QUAD
Opm::Co2InjectionTolerance = 1e-5;
#endif
return Opm::start<VcfvProblemTypeTag>(argc, argv); return Opm::start<VcfvProblemTypeTag>(argc, argv);
} }

View File

@ -141,101 +141,35 @@ struct LinearSolverSplice<TypeTag, TTag::Co2InjectionBaseProblem> { using type =
namespace Opm::Parameters { namespace Opm::Parameters {
// declare the CO2 injection problem specific property tags struct FluidSystemNumPressure { static constexpr unsigned value = 100; };
template<class TypeTag, class MyTypeTag> struct FluidSystemNumTemperature { static constexpr unsigned value = 100; };
struct FluidSystemPressureLow { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemPressureHigh { using type = Properties::UndefinedProperty; }; struct FluidSystemPressureHigh { static constexpr Scalar value = 4e7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemNumPressure { using type = Properties::UndefinedProperty; }; struct FluidSystemPressureLow { static constexpr Scalar value = 3e7; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemTemperatureLow { using type = Properties::UndefinedProperty; }; struct FluidSystemTemperatureHigh { static constexpr Scalar value = 500.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemTemperatureHigh { using type = Properties::UndefinedProperty; }; struct FluidSystemTemperatureLow { static constexpr Scalar value = 290.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct FluidSystemNumTemperature { using type = Properties::UndefinedProperty; }; struct MaxDepth { static constexpr Scalar value = 2500.0; };
template<class TypeTag, class MyTypeTag> struct SimulationName { static constexpr auto value = "co2injection"; };
struct MaxDepth { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct Temperature { using type = Properties::UndefinedProperty; }; struct Temperature { static constexpr Scalar value = 293.15; };
template<class TypeTag, class MyTypeTag>
struct SimulationName { using type = Properties::UndefinedProperty; };
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr bool value = true; };
template<class TypeTag>
struct FluidSystemNumPressure<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct FluidSystemNumTemperature<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr unsigned value = 100; };
template<class TypeTag>
struct FluidSystemPressureHigh<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 4e7;
};
template<class TypeTag>
struct FluidSystemPressureLow<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3e7;
};
template<class TypeTag>
struct FluidSystemTemperatureHigh<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 500;
};
template<class TypeTag>
struct FluidSystemTemperatureLow<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 290;
};
template<class TypeTag>
struct MaxDepth<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2500;
};
// Write the Newton convergence behavior to disk?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr bool value = false; };
template<class TypeTag>
struct SimulationName<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{ static constexpr auto value = "co2injection"; };
template<class TypeTag>
struct Temperature<TypeTag, Properties::TTag::Co2InjectionBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 293.15;
};
} // namespace Opm::Parameters } // namespace Opm::Parameters
namespace Opm { namespace Opm {
double Co2InjectionTolerance = 1e-8;
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
* *
@ -314,16 +248,16 @@ public:
eps_ = 1e-6; eps_ = 1e-6;
temperatureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureLow>(); temperatureLow_ = Parameters::Get<Parameters::FluidSystemTemperatureLow<Scalar>>();
temperatureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemTemperatureHigh>(); temperatureHigh_ = Parameters::Get<Parameters::FluidSystemTemperatureHigh<Scalar>>();
nTemperature_ = Parameters::get<TypeTag, Parameters::FluidSystemNumTemperature>(); nTemperature_ = Parameters::Get<Parameters::FluidSystemNumTemperature>();
pressureLow_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureLow>(); pressureLow_ = Parameters::Get<Parameters::FluidSystemPressureLow<Scalar>>();
pressureHigh_ = Parameters::get<TypeTag, Parameters::FluidSystemPressureHigh>(); pressureHigh_ = Parameters::Get<Parameters::FluidSystemPressureHigh<Scalar>>();
nPressure_ = Parameters::get<TypeTag, Parameters::FluidSystemNumPressure>(); nPressure_ = Parameters::Get<Parameters::FluidSystemNumPressure>();
maxDepth_ = Parameters::get<TypeTag, Parameters::MaxDepth>(); maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
temperature_ = Parameters::get<TypeTag, Parameters::Temperature>(); temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
// initialize the tables of the fluid system // initialize the tables of the fluid system
// FluidSystem::init(); // FluidSystem::init();
@ -376,28 +310,30 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureLow> Parameters::Register<Parameters::FluidSystemTemperatureLow<Scalar>>
("The lower temperature [K] for tabulation of the fluid system"); ("The lower temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemTemperatureHigh> Parameters::Register<Parameters::FluidSystemTemperatureHigh<Scalar>>
("The upper temperature [K] for tabulation of the fluid system"); ("The upper temperature [K] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemNumTemperature> Parameters::Register<Parameters::FluidSystemNumTemperature>
("The number of intervals between the lower and upper temperature"); ("The number of intervals between the lower and upper temperature");
Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureLow> Parameters::Register<Parameters::FluidSystemPressureLow<Scalar>>
("The lower pressure [Pa] for tabulation of the fluid system"); ("The lower pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemPressureHigh> Parameters::Register<Parameters::FluidSystemPressureHigh<Scalar>>
("The upper pressure [Pa] for tabulation of the fluid system"); ("The upper pressure [Pa] for tabulation of the fluid system");
Parameters::registerParam<TypeTag, Parameters::FluidSystemNumPressure> Parameters::Register<Parameters::FluidSystemNumPressure>
("The number of intervals between the lower and upper pressure"); ("The number of intervals between the lower and upper pressure");
Parameters::registerParam<TypeTag, Parameters::Temperature> Parameters::Register<Parameters::Temperature<Scalar>>
("The temperature [K] in the reservoir"); ("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::MaxDepth> Parameters::Register<Parameters::MaxDepth<Scalar>>
("The maximum depth [m] of the reservoir"); ("The maximum depth [m] of the reservoir");
Parameters::registerParam<TypeTag, Parameters::SimulationName> Parameters::Register<Parameters::SimulationName>
("The name of the simulation used for the output files"); ("The name of the simulation used for the output files");
Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf"); Parameters::SetDefault<Parameters::GridFile>("data/co2injection.dgf");
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4); Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250);
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(Scalar{Co2InjectionTolerance});
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!
@ -411,7 +347,7 @@ public:
std::string name() const std::string name() const
{ {
std::ostringstream oss; std::ostringstream oss;
oss << Parameters::get<TypeTag, Parameters::SimulationName>() oss << Parameters::Get<Parameters::SimulationName>()
<< "_" << Model::name(); << "_" << Model::name();
if (getPropValue<TypeTag, Properties::EnableEnergy>()) if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni"; oss << "_ni";

View File

@ -144,114 +144,18 @@ struct EnableEnergy<TypeTag, TTag::CO2PTBaseProblem> {
namespace Opm::Parameters { namespace Opm::Parameters {
template <class TypeTag, class MyTypeTag>
struct Temperature { using type = Properties::UndefinedProperty; };
template <class TypeTag, class MyTypeTag>
struct SimulationName { using type = Properties::UndefinedProperty; };
template <class TypeTag, class MyTypeTag>
struct EpisodeLength { using type = Properties::UndefinedProperty;};
template <class TypeTag, class MyTypeTag>
struct Initialpressure { using type = Properties::UndefinedProperty;};
// Enable gravity false
template <class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = false; };
// this is kinds of telling the report step length // this is kinds of telling the report step length
template <class TypeTag> template<class Scalar>
struct EpisodeLength<TypeTag, Properties::TTag::CO2PTBaseProblem> struct EpisodeLength { static constexpr Scalar value = 0.1 * 60. * 60.; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.1 * 60. * 60.;
};
template <class TypeTag> template<class Scalar>
struct Initialpressure<TypeTag, Properties::TTag::CO2PTBaseProblem> struct Initialpressure { static constexpr Scalar value = 75e5; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 75.e5;
};
template <class TypeTag> struct SimulationName { static constexpr auto value = "co2_ptflash"; };
struct LinearSolverAbsTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.;
};
template <class TypeTag>
struct LinearSolverTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
// Write the Newton convergence behavior to disk?
template <class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = false; };
template <class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
template <class TypeTag>
struct NewtonTargetIterations<TypeTag, Properties::TTag::CO2PTBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 6;
};
template <class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr int value = 30; };
template <class TypeTag>
struct SimulationName<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr auto value = "co2_ptflash"; };
// set the defaults for the problem specific properties // set the defaults for the problem specific properties
template <class TypeTag> template<class Scalar>
struct Temperature<TypeTag, Properties::TTag::CO2PTBaseProblem> struct Temperature { static constexpr Scalar value = 423.25; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 423.25; // TODO
};
template <class TypeTag>
struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteFugacityCoeffs<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWritePotentialGradients<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteTotalMassFractions<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
template <class TypeTag>
struct VtkWriteTotalMoleFractions<TypeTag, Properties::TTag::CO2PTBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -307,7 +211,7 @@ public:
explicit CO2PTProblem(Simulator& simulator) explicit CO2PTProblem(Simulator& simulator)
: ParentType(simulator) : ParentType(simulator)
{ {
const Scalar epi_len = Parameters::get<TypeTag, Parameters::EpisodeLength>(); const Scalar epi_len = Parameters::Get<Parameters::EpisodeLength<Scalar>>();
simulator.setEpisodeLength(epi_len); simulator.setEpisodeLength(epi_len);
FluidSystem::init(); FluidSystem::init();
using CompParm = typename FluidSystem::ComponentParam; using CompParm = typename FluidSystem::ComponentParam;
@ -325,7 +229,7 @@ public:
void initPetrophysics() void initPetrophysics()
{ {
temperature_ = Parameters::get<TypeTag, Parameters::Temperature>(); temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
K_ = this->toDimMatrix_(9.869232667160131e-14); K_ = this->toDimMatrix_(9.869232667160131e-14);
porosity_ = 0.1; porosity_ = 0.1;
@ -362,13 +266,13 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::Temperature> Parameters::Register<Parameters::Temperature<Scalar>>
("The temperature [K] in the reservoir"); ("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::Initialpressure> Parameters::Register<Parameters::Initialpressure<Scalar>>
("The initial pressure [Pa s] in the reservoir"); ("The initial pressure [Pa s] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::SimulationName> Parameters::Register<Parameters::SimulationName>
("The name of the simulation used for the output files"); ("The name of the simulation used for the output files");
Parameters::registerParam<TypeTag, Parameters::EpisodeLength> Parameters::Register<Parameters::EpisodeLength<Scalar>>
("Time interval [s] for episode length"); ("Time interval [s] for episode length");
Parameters::SetDefault<Parameters::CellsX>(30); Parameters::SetDefault<Parameters::CellsX>(30);
@ -385,6 +289,19 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(60. * 60.); Parameters::SetDefault<Parameters::EndTime<Scalar>>(60. * 60.);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(0.1 * 60. * 60.); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(0.1 * 60. * 60.);
Parameters::SetDefault<Parameters::NewtonMaxIterations>(30);
Parameters::SetDefault<Parameters::NewtonTargetIterations>(6);
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-3);
Parameters::SetDefault<Parameters::VtkWriteFilterVelocities>(true);
Parameters::SetDefault<Parameters::VtkWriteFugacityCoeffs>(true);
Parameters::SetDefault<Parameters::VtkWritePotentialGradients>(true);
Parameters::SetDefault<Parameters::VtkWriteTotalMassFractions>(true);
Parameters::SetDefault<Parameters::VtkWriteTotalMoleFractions>(true);
Parameters::SetDefault<Parameters::VtkWriteEquilibriumConstants>(true);
Parameters::SetDefault<Parameters::VtkWriteLiquidMoleFractions>(true);
Parameters::SetDefault<Parameters::LinearSolverAbsTolerance<Scalar>>(0.0);
Parameters::SetDefault<Parameters::LinearSolverTolerance<Scalar>>(1e-3);
} }
/*! /*!
@ -393,7 +310,7 @@ public:
std::string name() const std::string name() const
{ {
std::ostringstream oss; std::ostringstream oss;
oss << Parameters::get<TypeTag, Parameters::SimulationName>(); oss << Parameters::Get<Parameters::SimulationName>();
return oss.str(); return oss.str();
} }
@ -402,7 +319,7 @@ public:
// the old one. // the old one.
void endEpisode() void endEpisode()
{ {
Scalar epi_len = Parameters::get<TypeTag, Parameters::EpisodeLength>(); Scalar epi_len = Parameters::Get<Parameters::EpisodeLength<Scalar>>();
this->simulator().startNextEpisode(epi_len); this->simulator().startNextEpisode(epi_len);
} }
@ -544,7 +461,7 @@ private:
sat[0] = 1.0; sat[0] = 1.0;
sat[1] = 1.0 - sat[0]; sat[1] = 1.0 - sat[0];
Scalar p0 = Parameters::get<TypeTag, Parameters::Initialpressure>(); Scalar p0 = Parameters::Get<Parameters::Initialpressure<Scalar>>();
//\Note, for an AD variable, if we multiply it with 2, the derivative will also be scalced with 2, //\Note, for an AD variable, if we multiply it with 2, the derivative will also be scalced with 2,
//\Note, so we should not do it. //\Note, so we should not do it.

View File

@ -114,15 +114,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::CuvetteBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -291,6 +282,7 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0); Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
Parameters::SetDefault<Parameters::MaxTimeStepSize<Scalar>>(600.0); Parameters::SetDefault<Parameters::MaxTimeStepSize<Scalar>>(600.0);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -108,15 +108,6 @@ struct EnableDiffusion<TypeTag, TTag::DiffusionBaseProblem> { static constexpr b
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::DiffusionBaseProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems

View File

@ -28,32 +28,38 @@
#ifndef EWOMS_FINGER_PROBLEM_HH #ifndef EWOMS_FINGER_PROBLEM_HH
#define EWOMS_FINGER_PROBLEM_HH #define EWOMS_FINGER_PROBLEM_HH
#include <opm/models/io/structuredgridvanguard.hh>
#include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/ParkerLenhard.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/components/Air.hpp>
#include <opm/models/immiscible/immiscibleproperties.hh>
#include <opm/models/discretization/common/restrictprolong.hh>
#if HAVE_DUNE_ALUGRID #if HAVE_DUNE_ALUGRID
#include <dune/alugrid/grid.hh> #include <dune/alugrid/grid.hh>
#endif #endif
#include <dune/common/version.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <dune/common/version.hh>
#include <dune/grid/utility/persistentcontainer.hh> #include <dune/grid/utility/persistentcontainer.hh>
#include <vector> #include <opm/material/components/Air.hpp>
#include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidmatrixinteractions/ParkerLenhard.hpp>
#include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/discretization/common/fvbasefdlocallinearizer.hh>
#include <opm/models/discretization/common/restrictprolong.hh>
#include <opm/models/immiscible/immiscibleproperties.hh>
#include <opm/models/io/structuredgridvanguard.hh>
#include <string> #include <string>
namespace Opm { namespace Opm {
@ -128,25 +134,8 @@ struct EnableConstraints<TypeTag, TTag::FingerBaseProblem> { static constexpr in
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct InitialWaterSaturation { using type = Properties::UndefinedProperty; }; struct InitialWaterSaturation { static constexpr Scalar value = 0.01; };
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::FingerBaseProblem>
{ static constexpr bool value = true; };
template<class TypeTag>
struct InitialWaterSaturation<TypeTag, Properties::TTag::FingerBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.01;
};
// Write the solutions of individual newton iterations?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::FingerBaseProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -263,7 +252,7 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::InitialWaterSaturation> Parameters::Register<Parameters::InitialWaterSaturation<Scalar>>
("The initial saturation in the domain [] of the wetting phase"); ("The initial saturation in the domain [] of the wetting phase");
Parameters::SetDefault<Parameters::CellsX>(20); Parameters::SetDefault<Parameters::CellsX>(20);
@ -283,6 +272,7 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(215); Parameters::SetDefault<Parameters::EndTime<Scalar>>(215);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(10); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(10);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!
@ -534,7 +524,7 @@ private:
auto& fs = initialFluidState_; auto& fs = initialFluidState_;
fs.setPressure(wettingPhaseIdx, /*pressure=*/1e5); fs.setPressure(wettingPhaseIdx, /*pressure=*/1e5);
Scalar Sw = Parameters::get<TypeTag, Parameters::InitialWaterSaturation>(); Scalar Sw = Parameters::Get<Parameters::InitialWaterSaturation<Scalar>>();
fs.setSaturation(wettingPhaseIdx, Sw); fs.setSaturation(wettingPhaseIdx, Sw);
fs.setSaturation(nonWettingPhaseIdx, 1 - Sw); fs.setSaturation(nonWettingPhaseIdx, 1 - Sw);

View File

@ -158,15 +158,6 @@ struct EnableConstraints<TypeTag, TTag::FractureProblem> { static constexpr bool
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::FractureProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems

View File

@ -28,19 +28,22 @@
#ifndef EWOMS_GROUND_WATER_PROBLEM_HH #ifndef EWOMS_GROUND_WATER_PROBLEM_HH
#define EWOMS_GROUND_WATER_PROBLEM_HH #define EWOMS_GROUND_WATER_PROBLEM_HH
#include <opm/models/immiscible/immiscibleproperties.hh> #include <dune/common/fmatrix.hh>
#include <opm/simulators/linalg/parallelistlbackend.hh> #include <dune/common/fvector.hh>
#include <dune/common/version.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/fluidsystems/LiquidPhase.hpp> #include <opm/material/fluidsystems/LiquidPhase.hpp>
#include <dune/grid/yaspgrid.hh> #include <opm/models/common/multiphasebaseparameters.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <dune/common/version.hh> #include <opm/models/immiscible/immiscibleproperties.hh>
#include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh> #include <opm/simulators/linalg/parallelistlbackend.hh>
#include <sstream> #include <sstream>
#include <string> #include <string>
@ -88,90 +91,29 @@ struct LinearSolverWrapper<TypeTag, TTag::GroundWaterBaseProblem>
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensLowerLeftX { using type = Properties::UndefinedProperty; }; struct LensLowerLeftX { static constexpr Scalar value = 0.25; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensLowerLeftY { using type = Properties::UndefinedProperty; }; struct LensLowerLeftY { static constexpr Scalar value = 0.25; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensLowerLeftZ { using type = Properties::UndefinedProperty; }; struct LensLowerLeftZ { static constexpr Scalar value = 0.25; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensUpperRightX { using type = Properties::UndefinedProperty; }; struct LensUpperRightX { static constexpr Scalar value = 0.75; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensUpperRightY { using type = Properties::UndefinedProperty; }; struct LensUpperRightY { static constexpr Scalar value = 0.75; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LensUpperRightZ { using type = Properties::UndefinedProperty; }; struct LensUpperRightZ { static constexpr Scalar value = 0.75; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct Permeability { using type = Properties::UndefinedProperty; }; struct Permeability { static constexpr Scalar value = 1e-10; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct PermeabilityLens { using type = Properties::UndefinedProperty; }; struct PermeabilityLens { static constexpr Scalar value = 1e-12; };
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{ static constexpr bool value = true; };
template<class TypeTag>
struct LensLowerLeftX<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.25;
};
template<class TypeTag>
struct LensLowerLeftY<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.25;
};
template<class TypeTag>
struct LensLowerLeftZ<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.25;
};
template<class TypeTag>
struct LensUpperRightX<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.75;
};
template<class TypeTag>
struct LensUpperRightY<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.75;
};
template<class TypeTag>
struct LensUpperRightZ<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.75;
};
template<class TypeTag>
struct Permeability<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-10;
};
template<class TypeTag>
struct PermeabilityLens<TypeTag, Properties::TTag::GroundWaterBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-12;
};
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -239,20 +181,20 @@ public:
eps_ = 1.0e-3; eps_ = 1.0e-3;
lensLowerLeft_[0] = Parameters::get<TypeTag, Parameters::LensLowerLeftX>(); lensLowerLeft_[0] = Parameters::Get<Parameters::LensLowerLeftX<Scalar>>();
if (dim > 1) if (dim > 1)
lensLowerLeft_[1] = Parameters::get<TypeTag, Parameters::LensLowerLeftY>(); lensLowerLeft_[1] = Parameters::Get<Parameters::LensLowerLeftY<Scalar>>();
if (dim > 2) if (dim > 2)
lensLowerLeft_[2] = Parameters::get<TypeTag, Parameters::LensLowerLeftY>(); lensLowerLeft_[2] = Parameters::Get<Parameters::LensLowerLeftY<Scalar>>();
lensUpperRight_[0] = Parameters::get<TypeTag, Parameters::LensUpperRightX>(); lensUpperRight_[0] = Parameters::Get<Parameters::LensUpperRightX<Scalar>>();
if (dim > 1) if (dim > 1)
lensUpperRight_[1] = Parameters::get<TypeTag, Parameters::LensUpperRightY>(); lensUpperRight_[1] = Parameters::Get<Parameters::LensUpperRightY<Scalar>>();
if (dim > 2) if (dim > 2)
lensUpperRight_[2] = Parameters::get<TypeTag, Parameters::LensUpperRightY>(); lensUpperRight_[2] = Parameters::Get<Parameters::LensUpperRightY<Scalar>>();
intrinsicPerm_ = this->toDimMatrix_(Parameters::get<TypeTag, Parameters::Permeability>()); intrinsicPerm_ = this->toDimMatrix_(Parameters::Get<Parameters::Permeability<Scalar>>());
intrinsicPermLens_ = this->toDimMatrix_(Parameters::get<TypeTag, Parameters::PermeabilityLens>()); intrinsicPermLens_ = this->toDimMatrix_(Parameters::Get<Parameters::PermeabilityLens<Scalar>>());
} }
/*! /*!
@ -262,33 +204,34 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftX> Parameters::Register<Parameters::LensLowerLeftX<Scalar>>
("The x-coordinate of the lens' lower-left corner [m]."); ("The x-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightX> Parameters::Register<Parameters::LensUpperRightX<Scalar>>
("The x-coordinate of the lens' upper-right corner [m]."); ("The x-coordinate of the lens' upper-right corner [m].");
if (dimWorld > 1) { if (dimWorld > 1) {
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftY> Parameters::Register<Parameters::LensLowerLeftY<Scalar>>
("The y-coordinate of the lens' lower-left corner [m]."); ("The y-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightY> Parameters::Register<Parameters::LensUpperRightY<Scalar>>
("The y-coordinate of the lens' upper-right corner [m]."); ("The y-coordinate of the lens' upper-right corner [m].");
} }
if (dimWorld > 2) { if (dimWorld > 2) {
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftZ> Parameters::Register<Parameters::LensLowerLeftZ<Scalar>>
("The z-coordinate of the lens' lower-left corner [m]."); ("The z-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightZ> Parameters::Register<Parameters::LensUpperRightZ<Scalar>>
("The z-coordinate of the lens' upper-right corner [m]."); ("The z-coordinate of the lens' upper-right corner [m].");
} }
Parameters::registerParam<TypeTag, Parameters::Permeability> Parameters::Register<Parameters::Permeability<Scalar>>
("The intrinsic permeability [m^2] of the ambient material."); ("The intrinsic permeability [m^2] of the ambient material.");
Parameters::registerParam<TypeTag, Parameters::PermeabilityLens> Parameters::Register<Parameters::PermeabilityLens<Scalar>>
("The intrinsic permeability [m^2] of the lens."); ("The intrinsic permeability [m^2] of the lens.");
Parameters::SetDefault<Parameters::GridFile>("./data/groundwater_2d.dgf"); Parameters::SetDefault<Parameters::GridFile>("./data/groundwater_2d.dgf");
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0); Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -27,21 +27,25 @@
#ifndef EWOMS_INFILTRATION_PROBLEM_HH #ifndef EWOMS_INFILTRATION_PROBLEM_HH
#define EWOMS_INFILTRATION_PROBLEM_HH #define EWOMS_INFILTRATION_PROBLEM_HH
#include <opm/models/pvs/pvsproperties.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <dune/common/version.hh>
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
#include <opm/material/fluidmatrixinteractions/ThreePhaseParkerVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <opm/material/common/Valgrind.hpp>
#include <dune/grid/yaspgrid.hh> #include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh> #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <dune/common/version.hh> #include <opm/material/common/Valgrind.hpp>
#include <dune/common/fvector.hh> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <dune/common/fmatrix.hh> #include <opm/material/fluidmatrixinteractions/ThreePhaseParkerVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidsystems/H2OAirMesityleneFluidSystem.hpp>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/discretization/common/fvbasefdlocallinearizer.hh>
#include <opm/models/pvs/pvsproperties.hh>
#include <sstream> #include <sstream>
#include <string> #include <string>
@ -90,20 +94,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Enable gravity?
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::InfiltrationBaseProblem>
{ static constexpr bool value = true; };
// Write newton convergence?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::InfiltrationBaseProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -229,6 +219,7 @@ public:
Parameters::SetDefault<Parameters::NumericDifferenceMethod>(1); Parameters::SetDefault<Parameters::NumericDifferenceMethod>(1);
Parameters::SetDefault<Parameters::EndTime<Scalar>>(6e3); Parameters::SetDefault<Parameters::EndTime<Scalar>>(6e3);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(60.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(60.0);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -28,27 +28,33 @@
#ifndef EWOMS_LENS_PROBLEM_HH #ifndef EWOMS_LENS_PROBLEM_HH
#define EWOMS_LENS_PROBLEM_HH #define EWOMS_LENS_PROBLEM_HH
#include <opm/models/io/structuredgridvanguard.hh> #include <dune/common/fmatrix.hh>
#include <opm/models/immiscible/immiscibleproperties.hh> #include <dune/common/fvector.hh>
#include <opm/models/discretization/common/fvbaseadlocallinearizer.hh> #include <dune/common/version.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
#include <opm/models/common/transfluxmodule.hh> #include <opm/material/components/Dnapl.hpp>
#include <opm/material/components/SimpleH2O.hpp>
#include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp> #include <opm/material/fluidmatrixinteractions/RegularizedVanGenuchten.hpp>
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
#include <opm/material/fluidstates/ImmiscibleFluidState.hpp> #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
#include <opm/material/components/SimpleH2O.hpp> #include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
#include <opm/material/components/Dnapl.hpp>
#include <dune/common/version.hh> #include <opm/models/common/multiphasebaseparameters.hh>
#include <dune/common/fvector.hh> #include <opm/models/common/transfluxmodule.hh>
#include <dune/common/fmatrix.hh>
#include <opm/models/discretization/common/fvbaseadlocallinearizer.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
#include <opm/models/immiscible/immiscibleproperties.hh>
#include <opm/models/io/structuredgridvanguard.hh>
#include <opm/models/io/vtkmultiphasemodule.hh>
#include <iostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iostream>
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>
@ -119,77 +125,24 @@ public:
namespace Opm::Parameters { namespace Opm::Parameters {
// declare the properties specific for the lens problem
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftZ { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightX { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightY { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightZ { using type = Properties::UndefinedProperty; };
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = true; };
// define the properties specific for the lens problem // define the properties specific for the lens problem
template<class TypeTag> template<class Scalar>
struct LensLowerLeftX<TypeTag, Properties::TTag::LensBaseProblem> struct LensLowerLeftX { static constexpr Scalar value = 1.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag> template<class Scalar>
struct LensLowerLeftY<TypeTag, Properties::TTag::LensBaseProblem> struct LensLowerLeftY { static constexpr Scalar value = 2.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2.0;
};
template<class TypeTag> template<class Scalar>
struct LensLowerLeftZ<TypeTag, Properties::TTag::LensBaseProblem> struct LensLowerLeftZ { static constexpr Scalar value = 0.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0;
};
template<class TypeTag> template<class Scalar>
struct LensUpperRightX<TypeTag, Properties::TTag::LensBaseProblem> struct LensUpperRightX { static constexpr Scalar value = 4.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 4.0;
};
template<class TypeTag> template<class Scalar>
struct LensUpperRightY<TypeTag, Properties::TTag::LensBaseProblem> struct LensUpperRightY { static constexpr Scalar value = 3.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 3.0;
};
template<class TypeTag> template<class Scalar>
struct LensUpperRightZ<TypeTag, Properties::TTag::LensBaseProblem> struct LensUpperRightZ { static constexpr Scalar value = 1.0; };
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
// Write the solutions of individual newton iterations?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -279,14 +232,14 @@ public:
FluidSystem::init(); FluidSystem::init();
temperature_ = 273.15 + 20; // -> 20°C temperature_ = 273.15 + 20; // -> 20°C
lensLowerLeft_[0] = Parameters::get<TypeTag, Parameters::LensLowerLeftX>(); lensLowerLeft_[0] = Parameters::Get<Parameters::LensLowerLeftX<Scalar>>();
lensLowerLeft_[1] = Parameters::get<TypeTag, Parameters::LensLowerLeftY>(); lensLowerLeft_[1] = Parameters::Get<Parameters::LensLowerLeftY<Scalar>>();
lensUpperRight_[0] = Parameters::get<TypeTag, Parameters::LensUpperRightX>(); lensUpperRight_[0] = Parameters::Get<Parameters::LensUpperRightX<Scalar>>();
lensUpperRight_[1] = Parameters::get<TypeTag, Parameters::LensUpperRightY>(); lensUpperRight_[1] = Parameters::Get<Parameters::LensUpperRightY<Scalar>>();
if constexpr (dim == 3) { if constexpr (dim == 3) {
lensLowerLeft_[2] = Parameters::get<TypeTag, Parameters::LensLowerLeftZ>(); lensLowerLeft_[2] = Parameters::Get<Parameters::LensLowerLeftZ<Scalar>>();
lensUpperRight_[2] = Parameters::get<TypeTag, Parameters::LensUpperRightZ>(); lensUpperRight_[2] = Parameters::Get<Parameters::LensUpperRightZ<Scalar>>();
} }
// residual saturations // residual saturations
@ -320,19 +273,19 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftX> Parameters::Register<Parameters::LensLowerLeftX<Scalar>>
("The x-coordinate of the lens' lower-left corner [m]."); ("The x-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftY> Parameters::Register<Parameters::LensLowerLeftY<Scalar>>
("The y-coordinate of the lens' lower-left corner [m]."); ("The y-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightX> Parameters::Register<Parameters::LensUpperRightX<Scalar>>
("The x-coordinate of the lens' upper-right corner [m]."); ("The x-coordinate of the lens' upper-right corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightY> Parameters::Register<Parameters::LensUpperRightY<Scalar>>
("The y-coordinate of the lens' upper-right corner [m]."); ("The y-coordinate of the lens' upper-right corner [m].");
if constexpr (dim == 3) { if constexpr (dim == 3) {
Parameters::registerParam<TypeTag, Parameters::LensLowerLeftZ> Parameters::Register<Parameters::LensLowerLeftZ<Scalar>>
("The z-coordinate of the lens' lower-left corner [m]."); ("The z-coordinate of the lens' lower-left corner [m].");
Parameters::registerParam<TypeTag, Parameters::LensUpperRightZ> Parameters::Register<Parameters::LensUpperRightZ<Scalar>>
("The z-coordinate of the lens' upper-right corner [m]."); ("The z-coordinate of the lens' upper-right corner [m].");
} }
@ -357,6 +310,8 @@ public:
Parameters::SetDefault<Parameters::EnableIntensiveQuantityCache>(true); Parameters::SetDefault<Parameters::EnableIntensiveQuantityCache>(true);
Parameters::SetDefault<Parameters::EnableStorageCache>(true); Parameters::SetDefault<Parameters::EnableStorageCache>(true);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0);
Parameters::SetDefault<Parameters::VtkWriteIntrinsicPermeabilities>(true);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -28,28 +28,30 @@
#ifndef EWOMS_OBSTACLE_PROBLEM_HH #ifndef EWOMS_OBSTACLE_PROBLEM_HH
#define EWOMS_OBSTACLE_PROBLEM_HH #define EWOMS_OBSTACLE_PROBLEM_HH
#include <opm/models/ncp/ncpproperties.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/fvector.hh>
#include <opm/material/fluidsystems/H2ON2FluidSystem.hpp> #include <dune/common/version.hh>
#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/thermal/ConstantSolidHeatCapLaw.hpp>
#include <opm/material/thermal/SomertonThermalConductionLaw.hpp>
#include <dune/grid/yaspgrid.hh> #include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh> #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
#include <dune/common/version.hh> #include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
#include <dune/common/fvector.hh> #include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
#include <dune/common/fmatrix.hh> #include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/fluidsystems/H2ON2FluidSystem.hpp>
#include <opm/material/thermal/ConstantSolidHeatCapLaw.hpp>
#include <opm/material/thermal/SomertonThermalConductionLaw.hpp>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/ncp/ncpproperties.hh>
#include <iostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iostream>
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>
@ -113,15 +115,6 @@ struct SolidEnergyLaw<TypeTag, TTag::ObstacleBaseProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::ObstacleBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -268,6 +261,7 @@ public:
Parameters::SetDefault<Parameters::GridFile>("./data/obstacle_24x16.dgf"); Parameters::SetDefault<Parameters::GridFile>("./data/obstacle_24x16.dgf");
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4); Parameters::SetDefault<Parameters::EndTime<Scalar>>(1e4);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -74,20 +74,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::OutflowBaseProblem>
{ static constexpr bool value = false; };
// Also write mass fractions to the output
template<class TypeTag>
struct VtkWriteMassFractions<TypeTag, Properties::TTag::OutflowBaseProblem>
{ static constexpr bool value = true; };
} // namespac Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -176,6 +162,8 @@ public:
Parameters::SetDefault<Parameters::GridFile>("./data/outflow.dgf"); Parameters::SetDefault<Parameters::GridFile>("./data/outflow.dgf");
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0); Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1.0);
Parameters::SetDefault<Parameters::VtkWriteMassFractions>(true);
} }
/*! /*!

View File

@ -121,20 +121,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr bool value = false; };
// Write out the filter velocities for this problem
template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::PowerInjectionBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -241,6 +227,7 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0); Parameters::SetDefault<Parameters::EndTime<Scalar>>(100.0);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1e-3); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(1e-3);
Parameters::SetDefault<Parameters::VtkWriteFilterVelocities>(true);
} }
/*! /*!

View File

@ -46,6 +46,8 @@
#include <opm/models/blackoil/blackoilproperties.hh> #include <opm/models/blackoil/blackoilproperties.hh>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh> #include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh> #include <opm/models/discretization/common/fvbaseproperties.hh>
@ -124,57 +126,16 @@ public:
namespace Opm::Parameters { namespace Opm::Parameters {
// Maximum depth of the reservoir // Maximum depth of the reservoir
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct MaxDepth { using type = Properties::UndefinedProperty; }; struct MaxDepth { static constexpr Scalar value = 2500.0; };
// The temperature inside the reservoir // The temperature inside the reservoir
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct Temperature { using type = Properties::UndefinedProperty; }; struct Temperature { static constexpr Scalar value = 293.15; };
// The width of producer/injector wells as a fraction of the width of the spatial domain // The width of producer/injector wells as a fraction of the width of the spatial domain
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct WellWidth { using type = Properties::UndefinedProperty; }; struct WellWidth { static constexpr Scalar value = 0.01; };
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::ReservoirBaseProblem>
{ static constexpr bool value = true; };
// set the defaults for some problem specific properties
template<class TypeTag>
struct MaxDepth<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 2500;
};
// Write the Newton convergence behavior to disk?
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::ReservoirBaseProblem>
{ static constexpr bool value = false; };
// increase the tolerance for this problem to get larger time steps
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-6;
};
template<class TypeTag>
struct Temperature<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 293.15;
};
// The width of producer/injector wells as a fraction of the width of the spatial domain
template<class TypeTag>
struct WellWidth<TypeTag, Properties::TTag::ReservoirBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.01;
};
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -255,9 +216,9 @@ public:
{ {
ParentType::finishInit(); ParentType::finishInit();
temperature_ = Parameters::get<TypeTag, Parameters::Temperature>(); temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
maxDepth_ = Parameters::get<TypeTag, Parameters::MaxDepth>(); maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
wellWidth_ = Parameters::get<TypeTag, Parameters::WellWidth>(); wellWidth_ = Parameters::Get<Parameters::WellWidth<Scalar>>();
std::vector<std::pair<Scalar, Scalar> > Bo = { std::vector<std::pair<Scalar, Scalar> > Bo = {
{ 101353, 1.062 }, { 101353, 1.062 },
@ -419,11 +380,11 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::Temperature> Parameters::Register<Parameters::Temperature<Scalar>>
("The temperature [K] in the reservoir"); ("The temperature [K] in the reservoir");
Parameters::registerParam<TypeTag, Parameters::MaxDepth> Parameters::Register<Parameters::MaxDepth<Scalar>>
("The maximum depth [m] of the reservoir"); ("The maximum depth [m] of the reservoir");
Parameters::registerParam<TypeTag, Parameters::WellWidth> Parameters::Register<Parameters::WellWidth<Scalar>>
("The width of producer/injector wells as a fraction of the width" ("The width of producer/injector wells as a fraction of the width"
" of the spatial domain"); " of the spatial domain");
@ -436,6 +397,10 @@ public:
Parameters::SetDefault<Parameters::EnableStorageCache>(true); Parameters::SetDefault<Parameters::EnableStorageCache>(true);
Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf"); Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3);
// increase the tolerance for this problem to get larger time steps
Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-6);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -101,30 +101,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Enable gravitational acceleration
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr bool value = true; };
// Do not write the intermediate results of the newton method
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr bool value = false; };
// Set the "desireable" number of newton iterations of a time step
template<class TypeTag>
struct NewtonTargetIterations<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr int value = 18; };
// Set the maximum number of newton iterations of a time step
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::RichardsLensProblem>
{ static constexpr int value = 28; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
@ -259,6 +235,9 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(3000.0); Parameters::SetDefault<Parameters::EndTime<Scalar>>(3000.0);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100.0);
Parameters::SetDefault<Parameters::NewtonMaxIterations>(28);
Parameters::SetDefault<Parameters::NewtonTargetIterations>(18);
Parameters::SetDefault<Parameters::EnableGravity>(true);
} }
/*! /*!

View File

@ -45,6 +45,8 @@
#include <opm/material/thermal/ConstantSolidHeatCapLaw.hpp> #include <opm/material/thermal/ConstantSolidHeatCapLaw.hpp>
#include <opm/material/thermal/SomertonThermalConductionLaw.hpp> #include <opm/material/thermal/SomertonThermalConductionLaw.hpp>
#include <opm/models/common/multiphasebaseparameters.hh>
#include <opm/models/discretization/common/fvbasefdlocallinearizer.hh> #include <opm/models/discretization/common/fvbasefdlocallinearizer.hh>
#include <opm/models/pvs/pvsproperties.hh> #include <opm/models/pvs/pvsproperties.hh>
@ -133,20 +135,6 @@ struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Enable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::WaterAirBaseProblem>
{ static constexpr bool value = true; };
// Write newton convergence
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::WaterAirBaseProblem>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup TestProblems * \ingroup TestProblems
@ -303,6 +291,8 @@ public:
Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0 * 365 * 24 * 60 * 60); Parameters::SetDefault<Parameters::EndTime<Scalar>>(1.0 * 365 * 24 * 60 * 60);
Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0); Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(250.0);
Parameters::SetDefault<Parameters::EnableGravity>(true);
Parameters::SetDefault<Parameters::PreconditionerOrder>(2);
} }
/*! /*!

View File

@ -122,16 +122,8 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// Disable gravity
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::Tutorial1Problem>
{ static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
//! Tutorial problem using the "immiscible" model. //! Tutorial problem using the "immiscible" model.
template <class TypeTag> template <class TypeTag>
class Tutorial1Problem class Tutorial1Problem

View File

@ -189,7 +189,7 @@ public:
Simulator&) Simulator&)
{ {
if constexpr (enableFoam) { if constexpr (enableFoam) {
if (Parameters::get<TypeTag, Parameters::EnableVtkOutput>()) { if (Parameters::Get<Parameters::EnableVtkOutput>()) {
OpmLog::warning("VTK output requested, currently unsupported by the foam module."); OpmLog::warning("VTK output requested, currently unsupported by the foam module.");
} }
} }

View File

@ -30,57 +30,52 @@
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include "blackoilproblem.hh" #include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
#include "blackoilindices.hh"
#include "blackoiltwophaseindices.hh" #include <opm/models/blackoil/blackoilboundaryratevector.hh>
#include "blackoilextensivequantities.hh" #include <opm/models/blackoil/blackoilbrinemodules.hh>
#include "blackoilprimaryvariables.hh" #include <opm/models/blackoil/blackoildarcyfluxmodule.hh>
#include "blackoilintensivequantities.hh" #include <opm/models/blackoil/blackoildiffusionmodule.hh>
#include "blackoilratevector.hh" #include <opm/models/blackoil/blackoildispersionmodule.hh>
#include "blackoilboundaryratevector.hh" #include <opm/models/blackoil/blackoilextbomodules.hh>
#include "blackoillocalresidual.hh" #include <opm/models/blackoil/blackoilextensivequantities.hh>
#include "blackoilnewtonmethod.hh" #include <opm/models/blackoil/blackoilfoammodules.hh>
#include "blackoilproperties.hh" #include <opm/models/blackoil/blackoilindices.hh>
#include "blackoilsolventmodules.hh" #include <opm/models/blackoil/blackoilintensivequantities.hh>
#include "blackoilpolymermodules.hh" #include <opm/models/blackoil/blackoillocalresidual.hh>
#include "blackoilfoammodules.hh" #include <opm/models/blackoil/blackoilmicpmodules.hh>
#include "blackoilbrinemodules.hh" #include <opm/models/blackoil/blackoilnewtonmethod.hh>
#include "blackoilextbomodules.hh" #include <opm/models/blackoil/blackoilpolymermodules.hh>
#include "blackoildarcyfluxmodule.hh" #include <opm/models/blackoil/blackoilprimaryvariables.hh>
#include "blackoilmicpmodules.hh" #include <opm/models/blackoil/blackoilproblem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <opm/models/blackoil/blackoilratevector.hh>
#include <opm/models/blackoil/blackoilsolventmodules.hh>
#include <opm/models/blackoil/blackoiltwophaseindices.hh>
#include <opm/models/common/multiphasebasemodel.hh> #include <opm/models/common/multiphasebasemodel.hh>
#include <opm/models/io/vtkcompositionmodule.hh>
#include <opm/models/io/vtkblackoilmodule.hh>
#include "blackoildiffusionmodule.hh"
#include "blackoildispersionmodule.hh"
#include <opm/models/io/vtkdiffusionmodule.hh>
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp> #include <opm/models/io/vtkblackoilmodule.hh>
#include <opm/models/io/vtkcompositionmodule.hh>
#include <opm/models/io/vtkdiffusionmodule.hh>
#include <sstream> #include <sstream>
#include <string> #include <string>
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>
class BlackOilModel; class BlackOilModel;
template <class TypeTag>
class EclVanguard;
} }
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag { namespace TTag {
//! The type tag for the black-oil problems //! The type tag for the black-oil problems
struct BlackOilModel { using InheritsFrom = std::tuple<VtkComposition, struct BlackOilModel
VtkBlackOilEnergy, { using InheritsFrom = std::tuple<VtkBlackOilPolymer, MultiPhaseBaseModel>; };
VtkDiffusion,
VtkBlackOilPolymer,
VtkBlackOilSolvent,
VtkBlackOil,
MultiPhaseBaseModel,
VtkBlackOilMICP>; };
} // namespace TTag } // namespace TTag
//! Set the local residual function //! Set the local residual function

View File

@ -44,84 +44,6 @@ struct DiscNewtonMethod;
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm:: Parameters {
template<class TypeTag>
struct DpMaxRel<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.3;
};
template<class TypeTag>
struct DsMax<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.2;
};
template<class TypeTag>
struct PriVarOscilationThreshold<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-5;
};
template<class TypeTag>
struct ProjectSaturations<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr bool value = false; };
template<class TypeTag>
struct MaxTemperatureChange<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 5; //Kelvin
};
template<class TypeTag>
struct TemperatureMax<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e9; // Kelvin
};
template<class TypeTag>
struct TemperatureMin<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0; // Kelvin
};
template<class TypeTag>
struct PressureMax<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e99; // Kelvin
};
template<class TypeTag>
struct PressureMin<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1e99; // Kelvin
};
template<class TypeTag>
struct MaximumWaterSaturation<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
template<class TypeTag>
struct WaterOnlyThreshold<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
@ -150,17 +72,17 @@ class BlackOilNewtonMethod : public GetPropType<TypeTag, Properties::DiscNewtonM
public: public:
BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator) BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator)
{ {
priVarOscilationThreshold_ = Parameters::get<TypeTag, Parameters::PriVarOscilationThreshold>(); priVarOscilationThreshold_ = Parameters::Get<Parameters::PriVarOscilationThreshold<Scalar>>();
dpMaxRel_ = Parameters::get<TypeTag, Parameters::DpMaxRel>(); dpMaxRel_ = Parameters::Get<Parameters::DpMaxRel<Scalar>>();
dsMax_ = Parameters::get<TypeTag, Parameters::DsMax>(); dsMax_ = Parameters::Get<Parameters::DsMax<Scalar>>();
projectSaturations_ = Parameters::get<TypeTag, Parameters::ProjectSaturations>(); projectSaturations_ = Parameters::Get<Parameters::ProjectSaturations>();
maxTempChange_ = Parameters::get<TypeTag, Parameters::MaxTemperatureChange>(); maxTempChange_ = Parameters::Get<Parameters::MaxTemperatureChange<Scalar>>();
tempMax_ = Parameters::get<TypeTag, Parameters::TemperatureMax>(); tempMax_ = Parameters::Get<Parameters::TemperatureMax<Scalar>>();
tempMin_ = Parameters::get<TypeTag, Parameters::TemperatureMin>(); tempMin_ = Parameters::Get<Parameters::TemperatureMin<Scalar>>();
pressMax_ = Parameters::get<TypeTag, Parameters::PressureMax>(); pressMax_ = Parameters::Get<Parameters::PressureMax<Scalar>>();
pressMin_ = Parameters::get<TypeTag, Parameters::PressureMin>(); pressMin_ = Parameters::Get<Parameters::PressureMin<Scalar>>();
waterSaturationMax_ = Parameters::get<TypeTag, Parameters::MaximumWaterSaturation>(); waterSaturationMax_ = Parameters::Get<Parameters::MaximumWaterSaturation<Scalar>>();
waterOnlyThreshold_ = Parameters::get<TypeTag, Parameters::WaterOnlyThreshold>(); waterOnlyThreshold_ = Parameters::Get<Parameters::WaterOnlyThreshold<Scalar>>();
} }
/*! /*!
@ -181,28 +103,28 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::DpMaxRel> Parameters::Register<Parameters::DpMaxRel<Scalar>>
("Maximum relative change of pressure in a single iteration"); ("Maximum relative change of pressure in a single iteration");
Parameters::registerParam<TypeTag, Parameters::DsMax> Parameters::Register<Parameters::DsMax<Scalar>>
("Maximum absolute change of any saturation in a single iteration"); ("Maximum absolute change of any saturation in a single iteration");
Parameters::registerParam<TypeTag, Parameters::PriVarOscilationThreshold> Parameters::Register<Parameters::PriVarOscilationThreshold<Scalar>>
("The threshold value for the primary variable switching conditions " ("The threshold value for the primary variable switching conditions "
"after its meaning has switched to hinder oscilations"); "after its meaning has switched to hinder oscilations");
Parameters::registerParam<TypeTag, Parameters::ProjectSaturations> Parameters::Register<Parameters::ProjectSaturations>
("Option for doing saturation projection"); ("Option for doing saturation projection");
Parameters::registerParam<TypeTag, Parameters::MaxTemperatureChange> Parameters::Register<Parameters::MaxTemperatureChange<Scalar>>
("Maximum absolute change of temperature in a single iteration"); ("Maximum absolute change of temperature in a single iteration");
Parameters::registerParam<TypeTag, Parameters::TemperatureMax> Parameters::Register<Parameters::TemperatureMax<Scalar>>
("Maximum absolute temperature"); ("Maximum absolute temperature");
Parameters::registerParam<TypeTag, Parameters::TemperatureMin> Parameters::Register<Parameters::TemperatureMin<Scalar>>
("Minimum absolute temperature"); ("Minimum absolute temperature");
Parameters::registerParam<TypeTag, Parameters::PressureMax> Parameters::Register<Parameters::PressureMax<Scalar>>
("Maximum absolute pressure"); ("Maximum absolute pressure");
Parameters::registerParam<TypeTag, Parameters::PressureMin> Parameters::Register<Parameters::PressureMin<Scalar>>
("Minimum absolute pressure"); ("Minimum absolute pressure");
Parameters::registerParam<TypeTag, Parameters::MaximumWaterSaturation> Parameters::Register<Parameters::MaximumWaterSaturation<Scalar>>
("Maximum water saturation"); ("Maximum water saturation");
Parameters::registerParam<TypeTag, Parameters::WaterOnlyThreshold> Parameters::Register<Parameters::WaterOnlyThreshold<Scalar>>
("Cells with water saturation above or equal is considered one-phase water only"); ("Cells with water saturation above or equal is considered one-phase water only");
} }
@ -524,6 +446,7 @@ private:
// to detect and hinder oscillations // to detect and hinder oscillations
std::vector<bool> wasSwitched_; std::vector<bool> wasSwitched_;
}; };
} // namespace Opm } // namespace Opm
#endif #endif

View File

@ -28,42 +28,39 @@
#ifndef EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH #ifndef EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH
#define EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH #define EWOMS_BLACK_OIL_NEWTON_METHOD_PARAMETERS_HH
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct DpMaxRel { using type = Properties::UndefinedProperty; }; struct DpMaxRel { static constexpr Scalar value = 0.3; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct DsMax { using type = Properties::UndefinedProperty; }; struct DsMax { static constexpr Scalar value = 0.2; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct PriVarOscilationThreshold { using type = Properties::UndefinedProperty; }; struct PriVarOscilationThreshold { static constexpr Scalar value = 1e-5; };
template<class TypeTag, class MyTypeTag> struct ProjectSaturations { static constexpr bool value = false; };
struct ProjectSaturations { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct MaxTemperatureChange { using type = Properties::UndefinedProperty; }; struct MaxTemperatureChange { static constexpr Scalar value = 5.0; }; // Kelvin
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct TemperatureMax { using type = Properties::UndefinedProperty; }; struct TemperatureMax { static constexpr Scalar value = 1e9; }; // Kelvin
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct TemperatureMin { using type = Properties::UndefinedProperty; }; struct TemperatureMin { static constexpr Scalar value = 0.0; }; // Kelvin
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct PressureMax { using type = Properties::UndefinedProperty; }; struct PressureMax { static constexpr Scalar value = 1e99; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct PressureMin { using type = Properties::UndefinedProperty; }; struct PressureMin { static constexpr Scalar value = -1e99; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct MaximumWaterSaturation { using type = Properties::UndefinedProperty; }; struct MaximumWaterSaturation { static constexpr Scalar value = 1.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct WaterOnlyThreshold { using type = Properties::UndefinedProperty; }; struct WaterOnlyThreshold { static constexpr Scalar value = 1.0; };
} // namespace Opm::Parameters } // namespace Opm::Parameters

View File

@ -1369,7 +1369,7 @@ public:
Valgrind::CheckDefined(solventPGrad); Valgrind::CheckDefined(solventPGrad);
// correct the pressure gradients by the gravitational acceleration // correct the pressure gradients by the gravitational acceleration
if (Parameters::get<TypeTag, Parameters::EnableGravity>()) { if (Parameters::Get<Parameters::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face // estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean // using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);

View File

@ -212,7 +212,7 @@ protected:
} }
// correct the pressure gradients by the gravitational acceleration // correct the pressure gradients by the gravitational acceleration
if (Parameters::get<TypeTag, Parameters::EnableGravity>()) { if (Parameters::Get<Parameters::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face // estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean // using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);
@ -362,7 +362,7 @@ protected:
K_ = intQuantsIn.intrinsicPermeability(); K_ = intQuantsIn.intrinsicPermeability();
// correct the pressure gradients by the gravitational acceleration // correct the pressure gradients by the gravitational acceleration
if (Parameters::get<TypeTag, Parameters::EnableGravity>()) { if (Parameters::Get<Parameters::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face // estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean // using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx); const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);

View File

@ -57,7 +57,9 @@ namespace Opm::Properties {
//! The generic type tag for problems using the immiscible multi-phase model //! The generic type tag for problems using the immiscible multi-phase model
// Create new type tags // Create new type tags
namespace TTag { namespace TTag {
struct MultiPhaseBaseModel { using InheritsFrom = std::tuple<VtkTemperature, VtkMultiPhase>; };
struct MultiPhaseBaseModel {};
} // end namespace TTag } // end namespace TTag
//! Specify the splices of the MultiPhaseBaseModel type tag //! Specify the splices of the MultiPhaseBaseModel type tag
@ -139,15 +141,6 @@ struct ThermalConductionLawParams<TypeTag, TTag::MultiPhaseBaseModel>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
//! disable gravity by default
template<class TypeTag>
struct EnableGravity<TypeTag, Properties::TTag::MultiPhaseBaseModel>
{ static constexpr bool value = false; };
}
namespace Opm { namespace Opm {
/*! /*!

View File

@ -24,19 +24,16 @@
* \file * \file
* \ingroup MultiPhaseBaseModel * \ingroup MultiPhaseBaseModel
* *
* \brief Defines the common paramamters for the porous medium * \brief Defines the common parameters for the porous medium
* multi-phase models. * multi-phase models.
*/ */
#ifndef EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH #ifndef EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH
#define EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH #define EWOMS_MULTI_PHASE_BASE_PARAMETERS_HH
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters { namespace Opm::Parameters {
//! Returns whether gravity is considered in the problem //! Returns whether gravity is considered in the problem.
template<class TypeTag, class MyTypeTag> struct EnableGravity { static constexpr bool value = false; };
struct EnableGravity { using type = Properties::UndefinedProperty; };
} // namespace Opm::Parameters } // namespace Opm::Parameters

View File

@ -93,7 +93,7 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::EnableGravity> Parameters::Register<Parameters::EnableGravity>
("Use the gravity correction for the pressure gradients."); ("Use the gravity correction for the pressure gradients.");
} }
@ -398,8 +398,9 @@ private:
void init_() void init_()
{ {
gravity_ = 0.0; gravity_ = 0.0;
if (Parameters::get<TypeTag, Parameters::EnableGravity>()) if (Parameters::Get<Parameters::EnableGravity>()) {
gravity_[dimWorld-1] = -9.81; gravity_[dimWorld-1] = -9.81;
}
} }
}; };

View File

@ -53,7 +53,7 @@ namespace Opm::Properties {
// Create new type tags // Create new type tags
namespace TTag { namespace TTag {
//! The generic type tag for problems using the immiscible multi-phase model //! The generic type tag for problems using the immiscible multi-phase model
struct DiscreteFractureModel { using InheritsFrom = std::tuple<VtkDiscreteFracture, ImmiscibleTwoPhaseModel>; }; struct DiscreteFractureModel { using InheritsFrom = std::tuple<ImmiscibleTwoPhaseModel>; };
} // end namespace TTag } // end namespace TTag
//! The class for the model //! The class for the model

View File

@ -282,29 +282,6 @@ struct DiscreteFunction<TypeTag, TTag::FvBaseDiscretization>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// use default initialization based on rule-of-thumb of Newton tolerance
template<class TypeTag>
struct LinearSolverAbsTolerance<TypeTag, Properties::TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = -1.;
};
// if the deflection of the newton method is large, we do not need to solve the linear
// approximation accurately. Assuming that the value for the current solution is quite
// close to the final value, a reduction of 3 orders of magnitude in the defect should be
// sufficient...
template<class TypeTag>
struct LinearSolverTolerance<TypeTag, Properties::TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-3;
};
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!

View File

@ -36,7 +36,6 @@ namespace Opm::Properties {
namespace TTag { namespace TTag {
struct FvBaseNewtonMethod; struct FvBaseNewtonMethod;
struct VtkPrimaryVars;
struct FiniteDifferenceLocalLinearizer; struct FiniteDifferenceLocalLinearizer;
struct ParallelBiCGStabLinearSolver; struct ParallelBiCGStabLinearSolver;
} }
@ -45,7 +44,7 @@ namespace TTag {
//! The type tag for models based on the finite volume schemes //! The type tag for models based on the finite volume schemes
struct FvBaseDiscretization struct FvBaseDiscretization
{ using InheritsFrom = std::tuple<VtkPrimaryVars, FvBaseNewtonMethod, ImplicitModel>; }; { using InheritsFrom = std::tuple<FvBaseNewtonMethod, ImplicitModel>; };
} // namespace TTag } // namespace TTag

View File

@ -32,8 +32,8 @@
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/models/common/energymodule.hh> #include <opm/models/common/energymodule.hh>
#include <opm/models/common/multiphasebasemodel.hh> #include <opm/models/common/multiphasebasemodel.hh>
@ -44,8 +44,8 @@
#include <opm/models/flash/flashintensivequantities.hh> #include <opm/models/flash/flashintensivequantities.hh>
#include <opm/models/flash/flashlocalresidual.hh> #include <opm/models/flash/flashlocalresidual.hh>
#include <opm/models/flash/flashparameters.hh> #include <opm/models/flash/flashparameters.hh>
#include <opm/models/flash/flashproperties.hh>
#include <opm/models/flash/flashprimaryvariables.hh> #include <opm/models/flash/flashprimaryvariables.hh>
#include <opm/models/flash/flashproperties.hh>
#include <opm/models/flash/flashratevector.hh> #include <opm/models/flash/flashratevector.hh>
#include <opm/models/io/vtkcompositionmodule.hh> #include <opm/models/io/vtkcompositionmodule.hh>
@ -64,10 +64,7 @@ namespace Opm::Properties {
namespace TTag { namespace TTag {
//! The type tag for the isothermal single phase problems //! The type tag for the isothermal single phase problems
struct FlashModel { using InheritsFrom = std::tuple<VtkDiffusion, struct FlashModel { using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
VtkEnergy,
VtkComposition,
MultiPhaseBaseModel>; };
} // namespace TTag } // namespace TTag
//! Use the FlashLocalResidual function for the flash model //! Use the FlashLocalResidual function for the flash model

View File

@ -60,7 +60,7 @@ namespace Opm::Properties {
// Create new type tags // Create new type tags
namespace TTag { namespace TTag {
//! The generic type tag for problems using the immiscible multi-phase model //! The generic type tag for problems using the immiscible multi-phase model
struct ImmiscibleModel { using InheritsFrom = std::tuple<VtkEnergy, MultiPhaseBaseModel>; }; struct ImmiscibleModel { using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
//! The type tag for single-phase immiscible problems //! The type tag for single-phase immiscible problems
struct ImmiscibleSinglePhaseModel { using InheritsFrom = std::tuple<ImmiscibleModel>; }; struct ImmiscibleSinglePhaseModel { using InheritsFrom = std::tuple<ImmiscibleModel>; };
@ -166,24 +166,6 @@ public:
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
// disable output of a few quantities which make sense in a
// multi-phase but not in a single-phase context
template<class TypeTag>
struct VtkWriteSaturations<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteMobilities<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteRelativePermeabilities<TypeTag, Properties::TTag::ImmiscibleSinglePhaseModel>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
@ -257,6 +239,10 @@ public:
if (enableEnergy) if (enableEnergy)
Opm::VtkEnergyModule<TypeTag>::registerParameters(); Opm::VtkEnergyModule<TypeTag>::registerParameters();
Parameters::SetDefault<Parameters::VtkWriteSaturations>(false);
Parameters::SetDefault<Parameters::VtkWriteMobilities>(false);
Parameters::SetDefault<Parameters::VtkWriteRelativePermeabilities>(false);
} }
/*! /*!

View File

@ -41,44 +41,13 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkBlackOilEnergy {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the energy module
template<class TypeTag, class MyTypeTag>
struct VtkWriteRockInternalEnergy { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteTotalThermalConductivity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFluidInternalEnergies { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFluidEnthalpies { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteRockInternalEnergy { static constexpr bool value = true; };
struct VtkWriteRockInternalEnergy<TypeTag, Properties::TTag::VtkBlackOilEnergy> struct VtkWriteTotalThermalConductivity { static constexpr bool value = true; };
{ static constexpr bool value = true; }; struct VtkWriteFluidInternalEnergies { static constexpr bool value = true; };
struct VtkWriteFluidEnthalpies { static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteTotalThermalConductivity<TypeTag, Properties::TTag::VtkBlackOilEnergy>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteFluidInternalEnergies<TypeTag, Properties::TTag::VtkBlackOilEnergy>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteFluidEnthalpies<TypeTag, Properties::TTag::VtkBlackOilEnergy>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -123,15 +92,15 @@ public:
if (!enableEnergy) if (!enableEnergy)
return; return;
Parameters::registerParam<TypeTag, Parameters::VtkWriteRockInternalEnergy> Parameters::Register<Parameters::VtkWriteRockInternalEnergy>
("Include the volumetric internal energy of rock " ("Include the volumetric internal energy of rock "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteTotalThermalConductivity> Parameters::Register<Parameters::VtkWriteTotalThermalConductivity>
("Include the total thermal conductivity of the medium and the fluids " ("Include the total thermal conductivity of the medium and the fluids "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFluidInternalEnergies> Parameters::Register<Parameters::VtkWriteFluidInternalEnergies>
("Include the internal energies of the fluids in the VTK output files"); ("Include the internal energies of the fluids in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFluidEnthalpies> Parameters::Register<Parameters::VtkWriteFluidEnthalpies>
("Include the enthalpies of the fluids in the VTK output files"); ("Include the enthalpies of the fluids in the VTK output files");
} }
@ -225,25 +194,25 @@ public:
private: private:
static bool rockInternalEnergyOutput_() static bool rockInternalEnergyOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteRockInternalEnergy>(); static bool val = Parameters::Get<Parameters::VtkWriteRockInternalEnergy>();
return val; return val;
} }
static bool totalThermalConductivityOutput_() static bool totalThermalConductivityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTotalThermalConductivity>(); static bool val = Parameters::Get<Parameters::VtkWriteTotalThermalConductivity>();
return val; return val;
} }
static bool fluidInternalEnergiesOutput_() static bool fluidInternalEnergiesOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFluidInternalEnergies>(); static bool val = Parameters::Get<Parameters::VtkWriteFluidInternalEnergies>();
return val; return val;
} }
static bool fluidEnthalpiesOutput_() static bool fluidEnthalpiesOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFluidEnthalpies>(); static bool val = Parameters::Get<Parameters::VtkWriteFluidEnthalpies>();
return val; return val;
} }

View File

@ -41,51 +41,14 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkBlackOilMICP {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the MICP output module
template<class TypeTag, class MyTypeTag>
struct VtkWriteMicrobialConcentration { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteOxygenConcentration { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteUreaConcentration { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteBiofilmConcentration { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteCalciteConcentration { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteMicrobialConcentration { static constexpr bool value = true; };
struct VtkWriteMicrobialConcentration<TypeTag, Properties::TTag::VtkBlackOilMICP> struct VtkWriteOxygenConcentration { static constexpr bool value = true; };
{ static constexpr bool value = true; }; struct VtkWriteUreaConcentration { static constexpr bool value = true; };
struct VtkWriteBiofilmConcentration { static constexpr bool value = true; };
template<class TypeTag> struct VtkWriteCalciteConcentration { static constexpr bool value = true; };
struct VtkWriteOxygenConcentration<TypeTag, Properties::TTag::VtkBlackOilMICP>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteUreaConcentration<TypeTag, Properties::TTag::VtkBlackOilMICP>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteBiofilmConcentration<TypeTag, Properties::TTag::VtkBlackOilMICP>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteCalciteConcentration<TypeTag, Properties::TTag::VtkBlackOilMICP>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -127,18 +90,18 @@ public:
if (!enableMICP) if (!enableMICP)
return; return;
Parameters::registerParam<TypeTag, Parameters::VtkWriteMicrobialConcentration> Parameters::Register<Parameters::VtkWriteMicrobialConcentration>
("Include the concentration of the microbial component in the water phase " ("Include the concentration of the microbial component in the water phase "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteOxygenConcentration> Parameters::Register<Parameters::VtkWriteOxygenConcentration>
("Include the concentration of the oxygen component in the water phase " ("Include the concentration of the oxygen component in the water phase "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteUreaConcentration> Parameters::Register<Parameters::VtkWriteUreaConcentration>
("Include the concentration of the urea component in the water phase " ("Include the concentration of the urea component in the water phase "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteBiofilmConcentration> Parameters::Register<Parameters::VtkWriteBiofilmConcentration>
("Include the biofilm volume fraction in the VTK output files"); ("Include the biofilm volume fraction in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteCalciteConcentration> Parameters::Register<Parameters::VtkWriteCalciteConcentration>
("Include the calcite volume fraction in the VTK output files"); ("Include the calcite volume fraction in the VTK output files");
} }
@ -239,31 +202,31 @@ public:
private: private:
static bool microbialConcentrationOutput_() static bool microbialConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMicrobialConcentration>(); static bool val = Parameters::Get<Parameters::VtkWriteMicrobialConcentration>();
return val; return val;
} }
static bool oxygenConcentrationOutput_() static bool oxygenConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteOxygenConcentration>(); static bool val = Parameters::Get<Parameters::VtkWriteOxygenConcentration>();
return val; return val;
} }
static bool ureaConcentrationOutput_() static bool ureaConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteUreaConcentration>(); static bool val = Parameters::Get<Parameters::VtkWriteUreaConcentration>();
return val; return val;
} }
static bool biofilmConcentrationOutput_() static bool biofilmConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteBiofilmConcentration>(); static bool val = Parameters::Get<Parameters::VtkWriteBiofilmConcentration>();
return val; return val;
} }
static bool calciteConcentrationOutput_() static bool calciteConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteCalciteConcentration>(); static bool val = Parameters::Get<Parameters::VtkWriteCalciteConcentration>();
return val; return val;
} }

View File

@ -41,93 +41,20 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkBlackOil {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag>
struct VtkWriteGasDissolutionFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteOilVaporizationFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteOilFormationVolumeFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteGasFormationVolumeFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteWaterFormationVolumeFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteOilSaturationPressure { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteGasSaturationPressure { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSaturationRatios { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSaturatedOilGasDissolutionFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSaturatedGasOilVaporizationFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePrimaryVarsMeaning { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteGasDissolutionFactor { static constexpr bool value = false; };
struct VtkWriteGasDissolutionFactor<TypeTag, Properties::TTag::VtkBlackOil> struct VtkWriteOilVaporizationFactor { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWriteOilFormationVolumeFactor { static constexpr bool value = false; };
struct VtkWriteGasFormationVolumeFactor { static constexpr bool value = false; };
template<class TypeTag> struct VtkWriteWaterFormationVolumeFactor { static constexpr bool value = false; };
struct VtkWriteOilVaporizationFactor<TypeTag, Properties::TTag::VtkBlackOil> struct VtkWriteOilSaturationPressure { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWriteGasSaturationPressure { static constexpr bool value = false; };
struct VtkWriteSaturationRatios { static constexpr bool value = false; };
template<class TypeTag> struct VtkWriteSaturatedOilGasDissolutionFactor { static constexpr bool value = false; };
struct VtkWriteOilFormationVolumeFactor<TypeTag, Properties::TTag::VtkBlackOil> struct VtkWriteSaturatedGasOilVaporizationFactor { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWritePrimaryVarsMeaning { static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteGasFormationVolumeFactor<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteWaterFormationVolumeFactor<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteOilSaturationPressure<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteGasSaturationPressure<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteSaturationRatios<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteSaturatedOilGasDissolutionFactor<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteSaturatedGasOilVaporizationFactor<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWritePrimaryVarsMeaning<TypeTag, Properties::TTag::VtkBlackOil>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -174,36 +101,36 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteGasDissolutionFactor> Parameters::Register<Parameters::VtkWriteGasDissolutionFactor>
("Include the gas dissolution factor (R_s) of the observed oil " ("Include the gas dissolution factor (R_s) of the observed oil "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteOilVaporizationFactor> Parameters::Register<Parameters::VtkWriteOilVaporizationFactor>
("Include the oil vaporization factor (R_v) of the observed gas " ("Include the oil vaporization factor (R_v) of the observed gas "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteOilFormationVolumeFactor> Parameters::Register<Parameters::VtkWriteOilFormationVolumeFactor>
("Include the oil formation volume factor (B_o) in the VTK output files"); ("Include the oil formation volume factor (B_o) in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteGasFormationVolumeFactor> Parameters::Register<Parameters::VtkWriteGasFormationVolumeFactor>
("Include the gas formation volume factor (B_g) in the " ("Include the gas formation volume factor (B_g) in the "
"VTK output files"); "VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteWaterFormationVolumeFactor> Parameters::Register<Parameters::VtkWriteWaterFormationVolumeFactor>
("Include the water formation volume factor (B_w) in the " ("Include the water formation volume factor (B_w) in the "
"VTK output files"); "VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteOilSaturationPressure> Parameters::Register<Parameters::VtkWriteOilSaturationPressure>
("Include the saturation pressure of oil (p_o,sat) in the " ("Include the saturation pressure of oil (p_o,sat) in the "
"VTK output files"); "VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteGasSaturationPressure> Parameters::Register<Parameters::VtkWriteGasSaturationPressure>
("Include the saturation pressure of gas (p_g,sat) in the " ("Include the saturation pressure of gas (p_g,sat) in the "
"VTK output files"); "VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSaturatedOilGasDissolutionFactor> Parameters::Register<Parameters::VtkWriteSaturatedOilGasDissolutionFactor>
("Include the gas dissolution factor (R_s,sat) of gas saturated " ("Include the gas dissolution factor (R_s,sat) of gas saturated "
"oil in the VTK output files"); "oil in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSaturatedGasOilVaporizationFactor> Parameters::Register<Parameters::VtkWriteSaturatedGasOilVaporizationFactor>
("Include the oil vaporization factor (R_v,sat) of oil saturated " ("Include the oil vaporization factor (R_v,sat) of oil saturated "
"gas in the VTK output files"); "gas in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSaturationRatios> Parameters::Register<Parameters::VtkWriteSaturationRatios>
("Write the ratio of the actually and maximum dissolved component of " ("Write the ratio of the actually and maximum dissolved component of "
"the mixtures"); "the mixtures");
Parameters::registerParam<TypeTag, Parameters::VtkWritePrimaryVarsMeaning> Parameters::Register<Parameters::VtkWritePrimaryVarsMeaning>
("Include how the primary variables should be interpreted to the " ("Include how the primary variables should be interpreted to the "
"VTK output files"); "VTK output files");
} }
@ -378,67 +305,67 @@ public:
private: private:
static bool gasDissolutionFactorOutput_() static bool gasDissolutionFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteGasDissolutionFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteGasDissolutionFactor>();
return val; return val;
} }
static bool oilVaporizationFactorOutput_() static bool oilVaporizationFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteOilVaporizationFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteOilVaporizationFactor>();
return val; return val;
} }
static bool oilFormationVolumeFactorOutput_() static bool oilFormationVolumeFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteOilFormationVolumeFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteOilFormationVolumeFactor>();
return val; return val;
} }
static bool gasFormationVolumeFactorOutput_() static bool gasFormationVolumeFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteGasFormationVolumeFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteGasFormationVolumeFactor>();
return val; return val;
} }
static bool waterFormationVolumeFactorOutput_() static bool waterFormationVolumeFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteWaterFormationVolumeFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteWaterFormationVolumeFactor>();
return val; return val;
} }
static bool oilSaturationPressureOutput_() static bool oilSaturationPressureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteOilSaturationPressure>(); static bool val = Parameters::Get<Parameters::VtkWriteOilSaturationPressure>();
return val; return val;
} }
static bool gasSaturationPressureOutput_() static bool gasSaturationPressureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteGasSaturationPressure>(); static bool val = Parameters::Get<Parameters::VtkWriteGasSaturationPressure>();
return val; return val;
} }
static bool saturatedOilGasDissolutionFactorOutput_() static bool saturatedOilGasDissolutionFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSaturatedOilGasDissolutionFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteSaturatedOilGasDissolutionFactor>();
return val; return val;
} }
static bool saturatedGasOilVaporizationFactorOutput_() static bool saturatedGasOilVaporizationFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSaturatedGasOilVaporizationFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteSaturatedGasOilVaporizationFactor>();
return val; return val;
} }
static bool saturationRatiosOutput_() static bool saturationRatiosOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSaturationRatios>(); static bool val = Parameters::Get<Parameters::VtkWriteSaturationRatios>();
return val; return val;
} }
static bool primaryVarsMeaningOutput_() static bool primaryVarsMeaningOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePrimaryVarsMeaning>(); static bool val = Parameters::Get<Parameters::VtkWritePrimaryVarsMeaning>();
return val; return val;
} }

View File

@ -50,49 +50,13 @@ struct VtkBlackOilPolymer {};
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the polymer output module
template<class TypeTag, class MyTypeTag>
struct VtkWritePolymerConcentration { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePolymerDeadPoreVolume { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePolymerAdsorption { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePolymerRockDensity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePolymerViscosityCorrection { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteWaterViscosityCorrection { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWritePolymerConcentration { static constexpr bool value = true; };
struct VtkWritePolymerConcentration<TypeTag, Properties::TTag::VtkBlackOilPolymer> struct VtkWritePolymerDeadPoreVolume { static constexpr bool value = true; };
{ static constexpr bool value = true; }; struct VtkWritePolymerViscosityCorrection { static constexpr bool value = true; };
struct VtkWriteWaterViscosityCorrection { static constexpr bool value = true; };
template<class TypeTag> struct VtkWritePolymerRockDensity { static constexpr bool value = true; };
struct VtkWritePolymerDeadPoreVolume<TypeTag, Properties::TTag::VtkBlackOilPolymer> struct VtkWritePolymerAdsorption { static constexpr bool value = true; };
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWritePolymerViscosityCorrection<TypeTag, Properties::TTag::VtkBlackOilPolymer>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteWaterViscosityCorrection<TypeTag, Properties::TTag::VtkBlackOilPolymer>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWritePolymerRockDensity<TypeTag, Properties::TTag::VtkBlackOilPolymer>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWritePolymerAdsorption<TypeTag, Properties::TTag::VtkBlackOilPolymer>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -134,22 +98,22 @@ public:
if (!enablePolymer) if (!enablePolymer)
return; return;
Parameters::registerParam<TypeTag, Parameters::VtkWritePolymerConcentration> Parameters::Register<Parameters::VtkWritePolymerConcentration>
("Include the concentration of the polymer component in the water phase " ("Include the concentration of the polymer component in the water phase "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePolymerDeadPoreVolume> Parameters::Register<Parameters::VtkWritePolymerDeadPoreVolume>
("Include the fraction of the \"dead\" pore volume " ("Include the fraction of the \"dead\" pore volume "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePolymerRockDensity> Parameters::Register<Parameters::VtkWritePolymerRockDensity>
("Include the amount of already adsorbed polymer component" ("Include the amount of already adsorbed polymer component"
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePolymerAdsorption> Parameters::Register<Parameters::VtkWritePolymerAdsorption>
("Include the adsorption rate of the polymer component" ("Include the adsorption rate of the polymer component"
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePolymerViscosityCorrection> Parameters::Register<Parameters::VtkWritePolymerViscosityCorrection>
("Include the viscosity correction of the polymer component " ("Include the viscosity correction of the polymer component "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteWaterViscosityCorrection> Parameters::Register<Parameters::VtkWriteWaterViscosityCorrection>
("Include the viscosity correction of the water component " ("Include the viscosity correction of the water component "
"due to polymers in the VTK output files"); "due to polymers in the VTK output files");
} }
@ -258,37 +222,37 @@ public:
private: private:
static bool polymerConcentrationOutput_() static bool polymerConcentrationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerConcentration>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerConcentration>();
return val; return val;
} }
static bool polymerDeadPoreVolumeOutput_() static bool polymerDeadPoreVolumeOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerDeadPoreVolume>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerDeadPoreVolume>();
return val; return val;
} }
static bool polymerRockDensityOutput_() static bool polymerRockDensityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerRockDensity>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerRockDensity>();
return val; return val;
} }
static bool polymerAdsorptionOutput_() static bool polymerAdsorptionOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerAdsorption>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerAdsorption>();
return val; return val;
} }
static bool polymerViscosityCorrectionOutput_() static bool polymerViscosityCorrectionOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerViscosityCorrection>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerViscosityCorrection>();
return val; return val;
} }
static bool waterViscosityCorrectionOutput_() static bool waterViscosityCorrectionOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePolymerViscosityCorrection>(); static bool val = Parameters::Get<Parameters::VtkWritePolymerViscosityCorrection>();
return val; return val;
} }

View File

@ -41,51 +41,14 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkBlackOilSolvent {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the solvent output module
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolventSaturation { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolventRsw { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolventDensity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolventViscosity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolventMobility { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteSolventSaturation { static constexpr bool value = true; };
struct VtkWriteSolventSaturation<TypeTag, Properties::TTag::VtkBlackOilSolvent> struct VtkWriteSolventRsw { static constexpr bool value = true; };
{ static constexpr bool value = true; }; struct VtkWriteSolventDensity { static constexpr bool value = true; };
struct VtkWriteSolventViscosity { static constexpr bool value = true; };
template<class TypeTag> struct VtkWriteSolventMobility { static constexpr bool value = true; };
struct VtkWriteSolventRsw<TypeTag, Properties::TTag::VtkBlackOilSolvent>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteSolventDensity<TypeTag, Properties::TTag::VtkBlackOilSolvent>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteSolventViscosity<TypeTag, Properties::TTag::VtkBlackOilSolvent>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteSolventMobility<TypeTag, Properties::TTag::VtkBlackOilSolvent>
{ static constexpr bool value = true; };
} // namespace Opm::Properties } // namespace Opm::Properties
@ -127,19 +90,19 @@ public:
if (!enableSolvent) if (!enableSolvent)
return; return;
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolventSaturation> Parameters::Register<Parameters::VtkWriteSolventSaturation>
("Include the \"saturation\" of the solvent component " ("Include the \"saturation\" of the solvent component "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolventRsw> Parameters::Register<Parameters::VtkWriteSolventRsw>
("Include the \"dissolved volume in water\" of the solvent component " ("Include the \"dissolved volume in water\" of the solvent component "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolventDensity> Parameters::Register<Parameters::VtkWriteSolventDensity>
("Include the \"density\" of the solvent component " ("Include the \"density\" of the solvent component "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolventViscosity> Parameters::Register<Parameters::VtkWriteSolventViscosity>
("Include the \"viscosity\" of the solvent component " ("Include the \"viscosity\" of the solvent component "
"in the VTK output files"); "in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolventMobility> Parameters::Register<Parameters::VtkWriteSolventMobility>
("Include the \"mobility\" of the solvent component " ("Include the \"mobility\" of the solvent component "
"in the VTK output files"); "in the VTK output files");
} }
@ -240,31 +203,31 @@ public:
private: private:
static bool solventSaturationOutput_() static bool solventSaturationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolventSaturation>(); static bool val = Parameters::Get<Parameters::VtkWriteSolventSaturation>();
return val; return val;
} }
static bool solventRswOutput_() static bool solventRswOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolventRsw>(); static bool val = Parameters::Get<Parameters::VtkWriteSolventRsw>();
return val; return val;
} }
static bool solventDensityOutput_() static bool solventDensityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolventDensity>(); static bool val = Parameters::Get<Parameters::VtkWriteSolventDensity>();
return val; return val;
} }
static bool solventViscosityOutput_() static bool solventViscosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolventViscosity>(); static bool val = Parameters::Get<Parameters::VtkWriteSolventViscosity>();
return val; return val;
} }
static bool solventMobilityOutput_() static bool solventMobilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolventMobility>(); static bool val = Parameters::Get<Parameters::VtkWriteSolventMobility>();
return val; return val;
} }

View File

@ -37,65 +37,16 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK composition output
struct VtkComposition {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the composition module
template<class TypeTag, class MyTypeTag>
struct VtkWriteMassFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteMoleFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteTotalMassFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteTotalMoleFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteMolarities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFugacities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFugacityCoeffs { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteMassFractions { static constexpr bool value = false; };
struct VtkWriteMassFractions<TypeTag, Properties::TTag::VtkComposition> struct VtkWriteMoleFractions { static constexpr bool value = true; };
{ static constexpr bool value = false; }; struct VtkWriteTotalMassFractions { static constexpr bool value = false; };
struct VtkWriteTotalMoleFractions { static constexpr bool value = false; };
template<class TypeTag> struct VtkWriteMolarities { static constexpr bool value = false; };
struct VtkWriteMoleFractions<TypeTag, Properties::TTag::VtkComposition> struct VtkWriteFugacities { static constexpr bool value = false; };
{ static constexpr bool value = true; }; struct VtkWriteFugacityCoeffs { static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteTotalMassFractions<TypeTag, Properties::TTag::VtkComposition>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteTotalMoleFractions<TypeTag, Properties::TTag::VtkComposition>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteMolarities<TypeTag, Properties::TTag::VtkComposition>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteFugacities<TypeTag, Properties::TTag::VtkComposition>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteFugacityCoeffs<TypeTag, Properties::TTag::VtkComposition>
{ static constexpr bool value = false; };
} // namespace Opm::Properties } // namespace Opm::Properties
@ -144,19 +95,19 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteMassFractions> Parameters::Register<Parameters::VtkWriteMassFractions>
("Include mass fractions in the VTK output files"); ("Include mass fractions in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteMoleFractions> Parameters::Register<Parameters::VtkWriteMoleFractions>
("Include mole fractions in the VTK output files"); ("Include mole fractions in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteTotalMassFractions> Parameters::Register<Parameters::VtkWriteTotalMassFractions>
("Include total mass fractions in the VTK output files"); ("Include total mass fractions in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteTotalMoleFractions> Parameters::Register<Parameters::VtkWriteTotalMoleFractions>
("Include total mole fractions in the VTK output files"); ("Include total mole fractions in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteMolarities> Parameters::Register<Parameters::VtkWriteMolarities>
("Include component molarities in the VTK output files"); ("Include component molarities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFugacities> Parameters::Register<Parameters::VtkWriteFugacities>
("Include component fugacities in the VTK output files"); ("Include component fugacities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFugacityCoeffs> Parameters::Register<Parameters::VtkWriteFugacityCoeffs>
("Include component fugacity coefficients in the VTK output files"); ("Include component fugacity coefficients in the VTK output files");
} }
@ -278,43 +229,43 @@ public:
private: private:
static bool massFracOutput_() static bool massFracOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMassFractions>(); static bool val = Parameters::Get<Parameters::VtkWriteMassFractions>();
return val; return val;
} }
static bool moleFracOutput_() static bool moleFracOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMoleFractions>(); static bool val = Parameters::Get<Parameters::VtkWriteMoleFractions>();
return val; return val;
} }
static bool totalMassFracOutput_() static bool totalMassFracOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTotalMassFractions>(); static bool val = Parameters::Get<Parameters::VtkWriteTotalMassFractions>();
return val; return val;
} }
static bool totalMoleFracOutput_() static bool totalMoleFracOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTotalMoleFractions>(); static bool val = Parameters::Get<Parameters::VtkWriteTotalMoleFractions>();
return val; return val;
} }
static bool molarityOutput_() static bool molarityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMolarities>(); static bool val = Parameters::Get<Parameters::VtkWriteMolarities>();
return val; return val;
} }
static bool fugacityOutput_() static bool fugacityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFugacities>(); static bool val = Parameters::Get<Parameters::VtkWriteFugacities>();
return val; return val;
} }
static bool fugacityCoeffOutput_() static bool fugacityCoeffOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFugacityCoeffs>(); static bool val = Parameters::Get<Parameters::VtkWriteFugacityCoeffs>();
return val; return val;
} }

View File

@ -28,49 +28,23 @@
#ifndef EWOMS_VTK_DIFFUSION_MODULE_HH #ifndef EWOMS_VTK_DIFFUSION_MODULE_HH
#define EWOMS_VTK_DIFFUSION_MODULE_HH #define EWOMS_VTK_DIFFUSION_MODULE_HH
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>
#include <opm/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh> #include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/io/baseoutputmodule.hh>
#include <opm/models/io/vtkmultiwriter.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK output of the quantities for molecular
// diffusion
struct VtkDiffusion {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the diffusion module
template<class TypeTag, class MyTypeTag>
struct VtkWriteTortuosities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteDiffusionCoefficients { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteEffectiveDiffusionCoefficients { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteTortuosities { static constexpr bool value = false; };
struct VtkWriteTortuosities<TypeTag, Properties::TTag::VtkDiffusion> struct VtkWriteDiffusionCoefficients { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWriteEffectiveDiffusionCoefficients { static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteDiffusionCoefficients<TypeTag, Properties::TTag::VtkDiffusion>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteEffectiveDiffusionCoefficients<TypeTag, Properties::TTag::VtkDiffusion>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -117,12 +91,12 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteTortuosities> Parameters::Register<Parameters::VtkWriteTortuosities>
("Include the tortuosity for each phase in the VTK output files"); ("Include the tortuosity for each phase in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteDiffusionCoefficients> Parameters::Register<Parameters::VtkWriteDiffusionCoefficients>
("Include the molecular diffusion coefficients in " ("Include the molecular diffusion coefficients in "
"the VTK output files"); "the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteEffectiveDiffusionCoefficients> Parameters::Register<Parameters::VtkWriteEffectiveDiffusionCoefficients>
("Include the effective molecular diffusion " ("Include the effective molecular diffusion "
"coefficients the medium in the VTK output files"); "coefficients the medium in the VTK output files");
} }
@ -194,19 +168,19 @@ public:
private: private:
static bool tortuosityOutput_() static bool tortuosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTortuosities>(); static bool val = Parameters::Get<Parameters::VtkWriteTortuosities>();
return val; return val;
} }
static bool diffusionCoefficientOutput_() static bool diffusionCoefficientOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteDiffusionCoefficients>(); static bool val = Parameters::Get<Parameters::VtkWriteDiffusionCoefficients>();
return val; return val;
} }
static bool effectiveDiffusionCoefficientOutput_() static bool effectiveDiffusionCoefficientOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteEffectiveDiffusionCoefficients>(); static bool val = Parameters::Get<Parameters::VtkWriteEffectiveDiffusionCoefficients>();
return val; return val;
} }

View File

@ -41,65 +41,16 @@
#include <cstdio> #include <cstdio>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkDiscreteFracture {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureSaturations { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureMobilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureRelativePermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFracturePorosity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureIntrinsicPermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureFilterVelocities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFractureVolumeFraction { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteFractureSaturations { static constexpr bool value = true; };
struct VtkWriteFractureSaturations<TypeTag, Properties::TTag::VtkDiscreteFracture> struct VtkWriteFractureMobilities { static constexpr bool value = false; };
{ static constexpr bool value = true; }; struct VtkWriteFractureRelativePermeabilities { static constexpr bool value = true; };
struct VtkWriteFracturePorosity { static constexpr bool value = true; };
template<class TypeTag> struct VtkWriteFractureIntrinsicPermeabilities { static constexpr bool value = false; };
struct VtkWriteFractureMobilities<TypeTag, Properties::TTag::VtkDiscreteFracture> struct VtkWriteFractureFilterVelocities { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWriteFractureVolumeFraction { static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteFractureRelativePermeabilities<TypeTag, Properties::TTag::VtkDiscreteFracture>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteFracturePorosity<TypeTag, Properties::TTag::VtkDiscreteFracture>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteFractureIntrinsicPermeabilities<TypeTag, Properties::TTag::VtkDiscreteFracture>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteFractureFilterVelocities<TypeTag, Properties::TTag::VtkDiscreteFracture>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteFractureVolumeFraction<TypeTag, Properties::TTag::VtkDiscreteFracture>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -153,20 +104,20 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureSaturations> Parameters::Register<Parameters::VtkWriteFractureSaturations>
("Include the phase saturations in the VTK output files"); ("Include the phase saturations in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureMobilities> Parameters::Register<Parameters::VtkWriteFractureMobilities>
("Include the phase mobilities in the VTK output files"); ("Include the phase mobilities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureRelativePermeabilities> Parameters::Register<Parameters::VtkWriteFractureRelativePermeabilities>
("Include the phase relative permeabilities in the " ("Include the phase relative permeabilities in the "
"VTK output files"); "VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFracturePorosity> Parameters::Register<Parameters::VtkWriteFracturePorosity>
("Include the porosity in the VTK output files"); ("Include the porosity in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureIntrinsicPermeabilities> Parameters::Register<Parameters::VtkWriteFractureIntrinsicPermeabilities>
("Include the intrinsic permeability in the VTK output files"); ("Include the intrinsic permeability in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureFilterVelocities> Parameters::Register<Parameters::VtkWriteFractureFilterVelocities>
("Include in the filter velocities of the phases in the VTK output files"); ("Include in the filter velocities of the phases in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFractureVolumeFraction> Parameters::Register<Parameters::VtkWriteFractureVolumeFraction>
("Add the fraction of the total volume which is " ("Add the fraction of the total volume which is "
"occupied by fractures in the VTK output"); "occupied by fractures in the VTK output");
} }
@ -339,43 +290,43 @@ public:
private: private:
static bool saturationOutput_() static bool saturationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureSaturations>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureSaturations>();
return val; return val;
} }
static bool mobilityOutput_() static bool mobilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureMobilities>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureMobilities>();
return val; return val;
} }
static bool relativePermeabilityOutput_() static bool relativePermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureRelativePermeabilities>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureRelativePermeabilities>();
return val; return val;
} }
static bool porosityOutput_() static bool porosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFracturePorosity>(); static bool val = Parameters::Get<Parameters::VtkWriteFracturePorosity>();
return val; return val;
} }
static bool intrinsicPermeabilityOutput_() static bool intrinsicPermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureIntrinsicPermeabilities>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureIntrinsicPermeabilities>();
return val; return val;
} }
static bool volumeFractionOutput_() static bool volumeFractionOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureVolumeFraction>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureVolumeFraction>();
return val; return val;
} }
static bool velocityOutput_() static bool velocityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFractureFilterVelocities>(); static bool val = Parameters::Get<Parameters::VtkWriteFractureFilterVelocities>();
return val; return val;
} }

View File

@ -34,51 +34,18 @@
#include <opm/models/discretization/common/fvbaseparameters.hh> #include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK energy output
struct VtkEnergy {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the energy module
template<class TypeTag, class MyTypeTag>
struct VtkWriteInternalEnergies { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteEnthalpies { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSolidInternalEnergy { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteThermalConductivity { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteSolidInternalEnergy { static constexpr bool value = false; };
struct VtkWriteSolidInternalEnergy<TypeTag, Properties::TTag::VtkEnergy> struct VtkWriteThermalConductivity { static constexpr bool value = false; };
{ static constexpr bool value = false; }; struct VtkWriteInternalEnergies { static constexpr bool value = false; };
struct VtkWriteEnthalpies { static constexpr bool value = false; };
template<class TypeTag> } // namespace Opm::Parameters
struct VtkWriteThermalConductivity<TypeTag, Properties::TTag::VtkEnergy>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteInternalEnergies<TypeTag, Properties::TTag::VtkEnergy>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteEnthalpies<TypeTag, Properties::TTag::VtkEnergy>
{ static constexpr bool value = false; };
} // namespace Opm::Properties
namespace Opm { namespace Opm {
/*! /*!
@ -125,16 +92,16 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteSolidInternalEnergy> Parameters::Register<Parameters::VtkWriteSolidInternalEnergy>
("Include the volumetric internal energy of solid" ("Include the volumetric internal energy of solid"
"matrix in the VTK output files"); "matrix in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteThermalConductivity> Parameters::Register<Parameters::VtkWriteThermalConductivity>
("Include the total thermal conductivity of the" ("Include the total thermal conductivity of the"
"medium in the VTK output files"); "medium in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteEnthalpies> Parameters::Register<Parameters::VtkWriteEnthalpies>
("Include the specific enthalpy of the phases in " ("Include the specific enthalpy of the phases in "
"the VTK output files"); "the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteInternalEnergies> Parameters::Register<Parameters::VtkWriteInternalEnergies>
("Include the specific internal energy of the " ("Include the specific internal energy of the "
"phases in the VTK output files"); "phases in the VTK output files");
} }
@ -209,25 +176,25 @@ public:
private: private:
static bool solidInternalEnergyOutput_() static bool solidInternalEnergyOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSolidInternalEnergy>(); static bool val = Parameters::Get<Parameters::VtkWriteSolidInternalEnergy>();
return val; return val;
} }
static bool thermalConductivityOutput_() static bool thermalConductivityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteThermalConductivity>(); static bool val = Parameters::Get<Parameters::VtkWriteThermalConductivity>();
return val; return val;
} }
static bool enthalpyOutput_() static bool enthalpyOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteEnthalpies>(); static bool val = Parameters::Get<Parameters::VtkWriteEnthalpies>();
return val; return val;
} }
static bool internalEnergyOutput_() static bool internalEnergyOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteInternalEnergies>(); static bool val = Parameters::Get<Parameters::VtkWriteInternalEnergies>();
return val; return val;
} }

View File

@ -27,117 +27,38 @@
#ifndef EWOMS_VTK_MULTI_PHASE_MODULE_HH #ifndef EWOMS_VTK_MULTI_PHASE_MODULE_HH
#define EWOMS_VTK_MULTI_PHASE_MODULE_HH #define EWOMS_VTK_MULTI_PHASE_MODULE_HH
#include "vtkmultiwriter.hh" #include <dune/common/fvector.hh>
#include "baseoutputmodule.hh"
#include <opm/material/common/MathToolbox.hpp> #include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh> #include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/io/baseoutputmodule.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/io/vtkmultiwriter.hh>
#include <dune/common/fvector.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
#include <cstdio> #include <cstdio>
namespace Opm::Properties::TTag {
// create new type tag for the VTK multi-phase output
struct VtkMultiPhase {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag>
struct VtkWriteExtrusionFactor { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePressures { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteDensities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteSaturations { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteMobilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteRelativePermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteViscosities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteAverageMolarMasses { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePorosity { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteIntrinsicPermeabilities { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePotentialGradients { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteFilterVelocities { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteExtrusionFactor { static constexpr bool value = false; };
struct VtkWriteExtrusionFactor<TypeTag, Properties::TTag::VtkMultiPhase> struct VtkWritePressures { static constexpr bool value = true; };
{ static constexpr bool value = false; }; struct VtkWriteDensities { static constexpr bool value = true; };
struct VtkWriteSaturations { static constexpr bool value = true; };
struct VtkWriteMobilities { static constexpr bool value = false; };
struct VtkWriteRelativePermeabilities { static constexpr bool value = true; };
struct VtkWriteViscosities { static constexpr bool value = false; };
struct VtkWriteAverageMolarMasses { static constexpr bool value = false; };
struct VtkWritePorosity { static constexpr bool value = true; };
struct VtkWriteIntrinsicPermeabilities { static constexpr bool value = false; };
struct VtkWritePotentialGradients { static constexpr bool value = false; };
struct VtkWriteFilterVelocities { static constexpr bool value = false; };
template<class TypeTag> } // namespace Opm::Parameters
struct VtkWritePressures<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteDensities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteSaturations<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteMobilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteRelativePermeabilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteViscosities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteAverageMolarMasses<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWritePorosity<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = true; };
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWritePotentialGradients<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, Properties::TTag::VtkMultiPhase>
{ static constexpr bool value = false; };
} // namespace Opm::Properties
namespace Opm { namespace Opm {
@ -197,29 +118,29 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteExtrusionFactor> Parameters::Register<Parameters::VtkWriteExtrusionFactor>
("Include the extrusion factor of the degrees of freedom into the VTK output files"); ("Include the extrusion factor of the degrees of freedom into the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePressures> Parameters::Register<Parameters::VtkWritePressures>
("Include the phase pressures in the VTK output files"); ("Include the phase pressures in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteDensities> Parameters::Register<Parameters::VtkWriteDensities>
("Include the phase densities in the VTK output files"); ("Include the phase densities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteSaturations> Parameters::Register<Parameters::VtkWriteSaturations>
("Include the phase saturations in the VTK output files"); ("Include the phase saturations in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteMobilities> Parameters::Register<Parameters::VtkWriteMobilities>
("Include the phase mobilities in the VTK output files"); ("Include the phase mobilities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteRelativePermeabilities> Parameters::Register<Parameters::VtkWriteRelativePermeabilities>
("Include the phase relative permeabilities in the VTK output files"); ("Include the phase relative permeabilities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteViscosities> Parameters::Register<Parameters::VtkWriteViscosities>
("Include component phase viscosities in the VTK output files"); ("Include component phase viscosities in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteAverageMolarMasses> Parameters::Register<Parameters::VtkWriteAverageMolarMasses>
("Include the average phase mass in the VTK output files"); ("Include the average phase mass in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePorosity> Parameters::Register<Parameters::VtkWritePorosity>
("Include the porosity in the VTK output files"); ("Include the porosity in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteIntrinsicPermeabilities> Parameters::Register<Parameters::VtkWriteIntrinsicPermeabilities>
("Include the intrinsic permeability in the VTK output files"); ("Include the intrinsic permeability in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteFilterVelocities> Parameters::Register<Parameters::VtkWriteFilterVelocities>
("Include in the filter velocities of the phases the VTK output files"); ("Include in the filter velocities of the phases the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWritePotentialGradients> Parameters::Register<Parameters::VtkWritePotentialGradients>
("Include the phase pressure potential gradients in the VTK output files"); ("Include the phase pressure potential gradients in the VTK output files");
} }
@ -454,73 +375,73 @@ public:
private: private:
static bool extrusionFactorOutput_() static bool extrusionFactorOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteExtrusionFactor>(); static bool val = Parameters::Get<Parameters::VtkWriteExtrusionFactor>();
return val; return val;
} }
static bool pressureOutput_() static bool pressureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePressures>(); static bool val = Parameters::Get<Parameters::VtkWritePressures>();
return val; return val;
} }
static bool densityOutput_() static bool densityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteDensities>(); static bool val = Parameters::Get<Parameters::VtkWriteDensities>();
return val; return val;
} }
static bool saturationOutput_() static bool saturationOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteSaturations>(); static bool val = Parameters::Get<Parameters::VtkWriteSaturations>();
return val; return val;
} }
static bool mobilityOutput_() static bool mobilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteMobilities>(); static bool val = Parameters::Get<Parameters::VtkWriteMobilities>();
return val; return val;
} }
static bool relativePermeabilityOutput_() static bool relativePermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteRelativePermeabilities>(); static bool val = Parameters::Get<Parameters::VtkWriteRelativePermeabilities>();
return val; return val;
} }
static bool viscosityOutput_() static bool viscosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteViscosities>(); static bool val = Parameters::Get<Parameters::VtkWriteViscosities>();
return val; return val;
} }
static bool averageMolarMassOutput_() static bool averageMolarMassOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteAverageMolarMasses>(); static bool val = Parameters::Get<Parameters::VtkWriteAverageMolarMasses>();
return val; return val;
} }
static bool porosityOutput_() static bool porosityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePorosity>(); static bool val = Parameters::Get<Parameters::VtkWritePorosity>();
return val; return val;
} }
static bool intrinsicPermeabilityOutput_() static bool intrinsicPermeabilityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteIntrinsicPermeabilities>(); static bool val = Parameters::Get<Parameters::VtkWriteIntrinsicPermeabilities>();
return val; return val;
} }
static bool velocityOutput_() static bool velocityOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteFilterVelocities>(); static bool val = Parameters::Get<Parameters::VtkWriteFilterVelocities>();
return val; return val;
} }
static bool potentialGradientOutput_() static bool potentialGradientOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePotentialGradients>(); static bool val = Parameters::Get<Parameters::VtkWritePotentialGradients>();
return val; return val;
} }

View File

@ -35,22 +35,9 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK primary variables output
struct VtkPhasePresence {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the primary variables module struct VtkWritePhasePresence { static constexpr bool value = false; };
template<class TypeTag, class MyTypeTag>
struct VtkWritePhasePresence { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct VtkWritePhasePresence<TypeTag, Properties::TTag::VtkPhasePresence>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -86,7 +73,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWritePhasePresence> Parameters::Register<Parameters::VtkWritePhasePresence>
("Include the phase presence pseudo primary " ("Include the phase presence pseudo primary "
"variable in the VTK output files"); "variable in the VTK output files");
} }
@ -137,7 +124,7 @@ public:
private: private:
static bool phasePresenceOutput_() static bool phasePresenceOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePhasePresence>(); static bool val = Parameters::Get<Parameters::VtkWritePhasePresence>();
return val; return val;
} }

View File

@ -35,36 +35,11 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK primary variables output
struct VtkPrimaryVars {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the primary variables module struct VtkWritePrimaryVars { static constexpr bool value = false; };
template<class TypeTag, class MyTypeTag> struct VtkWriteProcessRank { static constexpr bool value = false; };
struct VtkWritePrimaryVars { using type = Properties::UndefinedProperty; }; struct VtkWriteDofIndex { static constexpr bool value = false; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteProcessRank { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteDofIndex { using type = Properties::UndefinedProperty; };
template<class TypeTag>
struct VtkWritePrimaryVars<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteProcessRank<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteDofIndex<TypeTag, Properties::TTag::VtkPrimaryVars>
{ static constexpr bool value = false; };
} // namespace Opm::Properties } // namespace Opm::Properties
@ -102,11 +77,11 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWritePrimaryVars> Parameters::Register<Parameters::VtkWritePrimaryVars>
("Include the primary variables into the VTK output files"); ("Include the primary variables into the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteProcessRank> Parameters::Register<Parameters::VtkWriteProcessRank>
("Include the MPI process rank into the VTK output files"); ("Include the MPI process rank into the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteDofIndex> Parameters::Register<Parameters::VtkWriteDofIndex>
("Include the index of the degrees of freedom into the VTK output files"); ("Include the index of the degrees of freedom into the VTK output files");
} }
@ -178,17 +153,17 @@ public:
private: private:
static bool primaryVarsOutput_() static bool primaryVarsOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWritePrimaryVars>(); static bool val = Parameters::Get<Parameters::VtkWritePrimaryVars>();
return val; return val;
} }
static bool processRankOutput_() static bool processRankOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteProcessRank>(); static bool val = Parameters::Get<Parameters::VtkWriteProcessRank>();
return val; return val;
} }
static bool dofIndexOutput_() static bool dofIndexOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteDofIndex>(); static bool val = Parameters::Get<Parameters::VtkWriteDofIndex>();
return val; return val;
} }

View File

@ -27,40 +27,21 @@
#ifndef OPM_VTK_PTFLASH_MODULE_HH #ifndef OPM_VTK_PTFLASH_MODULE_HH
#define OPM_VTK_PTFLASH_MODULE_HH #define OPM_VTK_PTFLASH_MODULE_HH
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/material/common/MathToolbox.hpp> #include <opm/material/common/MathToolbox.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh> #include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/io/baseoutputmodule.hh>
#include <opm/models/io/vtkmultiwriter.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK PTFlash output
struct VtkPTFlash {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the composition module
template<class TypeTag, class MyTypeTag>
struct VtkWriteLiquidMoleFractions { using type = Properties::UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct VtkWriteEquilibriumConstants { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteLiquidMoleFractions { static constexpr bool value = false; };
struct VtkWriteLiquidMoleFractions<TypeTag, Properties::TTag::VtkPTFlash> struct VtkWriteEquilibriumConstants { static constexpr bool value = false; };
{ static constexpr bool value = false; };
template<class TypeTag>
struct VtkWriteEquilibriumConstants<TypeTag, Properties::TTag::VtkPTFlash>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -105,9 +86,9 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteLiquidMoleFractions> Parameters::Register<Parameters::VtkWriteLiquidMoleFractions>
("Include liquid mole fractions (L) in the VTK output files"); ("Include liquid mole fractions (L) in the VTK output files");
Parameters::registerParam<TypeTag, Parameters::VtkWriteEquilibriumConstants> Parameters::Register<Parameters::VtkWriteEquilibriumConstants>
("Include equilibrium constants (K) in the VTK output files"); ("Include equilibrium constants (K) in the VTK output files");
} }
@ -169,13 +150,13 @@ public:
private: private:
static bool LOutput_() static bool LOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteLiquidMoleFractions>(); static bool val = Parameters::Get<Parameters::VtkWriteLiquidMoleFractions>();
return val; return val;
} }
static bool equilConstOutput_() static bool equilConstOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteEquilibriumConstants>(); static bool val = Parameters::Get<Parameters::VtkWriteEquilibriumConstants>();
return val; return val;
} }

View File

@ -37,23 +37,10 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties::TTag {
// create new type tag for the VTK temperature output
struct VtkTemperature {};
} // namespace Opm::Properties::TTag
namespace Opm::Parameters { namespace Opm::Parameters {
// create the property tags needed for the temperature module
template<class TypeTag, class MyTypeTag>
struct VtkWriteTemperature { using type = Properties::UndefinedProperty; };
// set default values for what quantities to output // set default values for what quantities to output
template<class TypeTag> struct VtkWriteTemperature { static constexpr bool value = true; };
struct VtkWriteTemperature<TypeTag, Properties::TTag::VtkTemperature>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters } // namespace Opm::Parameters
@ -91,7 +78,7 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::VtkWriteTemperature> Parameters::Register<Parameters::VtkWriteTemperature>
("Include the temperature in the VTK output files"); ("Include the temperature in the VTK output files");
} }
@ -143,7 +130,7 @@ public:
private: private:
static bool temperatureOutput_() static bool temperatureOutput_()
{ {
static bool val = Parameters::get<TypeTag, Parameters::VtkWriteTemperature>(); static bool val = Parameters::Get<Parameters::VtkWriteTemperature>();
return val; return val;
} }

View File

@ -69,10 +69,7 @@ namespace TTag {
/*! /*!
* \brief Define the type tag for the compositional NCP model. * \brief Define the type tag for the compositional NCP model.
*/ */
struct NcpModel { using InheritsFrom = std::tuple<VtkDiffusion, struct NcpModel { using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
VtkEnergy,
VtkComposition,
MultiPhaseBaseModel>; };
} // namespace TTag } // namespace TTag
//! Use the Ncp local jacobian operator for the compositional NCP model //! Use the Ncp local jacobian operator for the compositional NCP model

View File

@ -117,10 +117,10 @@ protected:
// make sure that the error never grows beyond the maximum // make sure that the error never grows beyond the maximum
// allowed one // allowed one
if (this->error_ > Parameters::get<TypeTag, Parameters::NewtonMaxError>()) if (this->error_ > Parameters::Get<Parameters::NewtonMaxError<Scalar>>())
throw Opm::NumericalProblem("Newton: Error "+std::to_string(double(this->error_))+ throw Opm::NumericalProblem("Newton: Error "+std::to_string(double(this->error_))+
+ " is larger than maximum allowed error of " + " is larger than maximum allowed error of "
+ std::to_string(Parameters::get<TypeTag, Parameters::NewtonMaxError>())); + std::to_string(Parameters::Get<Parameters::NewtonMaxError<Scalar>>()));
} }
/*! /*!

View File

@ -79,42 +79,6 @@ struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullC
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct NewtonVerbose<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr bool value = true; };
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr bool value = false; };
template<class TypeTag>
struct NewtonTolerance<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e-8;
};
// set the abortion tolerance to some very large value. if not
// overwritten at run-time this basically disables abortions
template<class TypeTag>
struct NewtonMaxError<TypeTag, Properties::TTag::NewtonMethod>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e100;
};
template<class TypeTag>
struct NewtonTargetIterations<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr int value = 10; };
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, Properties::TTag::NewtonMethod>
{ static constexpr int value = 20; };
} // namespace Opm::Parameters
namespace Opm { namespace Opm {
/*! /*!
* \ingroup Newton * \ingroup Newton
@ -154,7 +118,7 @@ public:
{ {
lastError_ = 1e100; lastError_ = 1e100;
error_ = 1e100; error_ = 1e100;
tolerance_ = Parameters::get<TypeTag, Parameters::NewtonTolerance>(); tolerance_ = Parameters::Get<Parameters::NewtonTolerance<Scalar>>();
numIterations_ = 0; numIterations_ = 0;
} }
@ -166,20 +130,20 @@ public:
{ {
LinearSolverBackend::registerParameters(); LinearSolverBackend::registerParameters();
Parameters::registerParam<TypeTag, Parameters::NewtonVerbose> Parameters::Register<Parameters::NewtonVerbose>
("Specify whether the Newton method should inform " ("Specify whether the Newton method should inform "
"the user about its progress or not"); "the user about its progress or not");
Parameters::registerParam<TypeTag, Parameters::NewtonWriteConvergence> Parameters::Register<Parameters::NewtonWriteConvergence>
("Write the convergence behaviour of the Newton " ("Write the convergence behaviour of the Newton "
"method to a VTK file"); "method to a VTK file");
Parameters::registerParam<TypeTag, Parameters::NewtonTargetIterations> Parameters::Register<Parameters::NewtonTargetIterations>
("The 'optimum' number of Newton iterations per time step"); ("The 'optimum' number of Newton iterations per time step");
Parameters::registerParam<TypeTag, Parameters::NewtonMaxIterations> Parameters::Register<Parameters::NewtonMaxIterations>
("The maximum number of Newton iterations per time step"); ("The maximum number of Newton iterations per time step");
Parameters::registerParam<TypeTag, Parameters::NewtonTolerance> Parameters::Register<Parameters::NewtonTolerance<Scalar>>
("The maximum raw error tolerated by the Newton" ("The maximum raw error tolerated by the Newton"
"method for considering a solution to be converged"); "method for considering a solution to be converged");
Parameters::registerParam<TypeTag, Parameters::NewtonMaxError> Parameters::Register<Parameters::NewtonMaxError<Scalar>>
("The maximum error tolerated by the Newton " ("The maximum error tolerated by the Newton "
"method to which does not cause an abort"); "method to which does not cause an abort");
} }
@ -544,7 +508,7 @@ protected:
*/ */
bool verbose_() const bool verbose_() const
{ {
return Parameters::get<TypeTag, Parameters::NewtonVerbose>() && (comm_.rank() == 0); return Parameters::Get<Parameters::NewtonVerbose>() && (comm_.rank() == 0);
} }
/*! /*!
@ -557,8 +521,9 @@ protected:
{ {
numIterations_ = 0; numIterations_ = 0;
if (Parameters::get<TypeTag, Parameters::NewtonWriteConvergence>()) if (Parameters::Get<Parameters::NewtonWriteConvergence>()) {
convergenceWriter_.beginTimeStep(); convergenceWriter_.beginTimeStep();
}
} }
/*! /*!
@ -609,7 +574,7 @@ protected:
{ {
const auto& constraintsMap = model().linearizer().constraintsMap(); const auto& constraintsMap = model().linearizer().constraintsMap();
lastError_ = error_; lastError_ = error_;
Scalar newtonMaxError = Parameters::get<TypeTag, Parameters::NewtonMaxError>(); Scalar newtonMaxError = Parameters::Get<Parameters::NewtonMaxError<Scalar>>();
// calculate the error as the maximum weighted tolerance of // calculate the error as the maximum weighted tolerance of
// the solution's residual // the solution's residual
@ -774,7 +739,7 @@ protected:
void writeConvergence_(const SolutionVector& currentSolution, void writeConvergence_(const SolutionVector& currentSolution,
const GlobalEqVector& solutionUpdate) const GlobalEqVector& solutionUpdate)
{ {
if (Parameters::get<TypeTag, Parameters::NewtonWriteConvergence>()) { if (Parameters::Get<Parameters::NewtonWriteConvergence>()) {
convergenceWriter_.beginIteration(); convergenceWriter_.beginIteration();
convergenceWriter_.writeFields(currentSolution, solutionUpdate); convergenceWriter_.writeFields(currentSolution, solutionUpdate);
convergenceWriter_.endIteration(); convergenceWriter_.endIteration();
@ -846,8 +811,9 @@ protected:
*/ */
void end_() void end_()
{ {
if (Parameters::get<TypeTag, Parameters::NewtonWriteConvergence>()) if (Parameters::Get<Parameters::NewtonWriteConvergence>()) {
convergenceWriter_.endTimeStep(); convergenceWriter_.endTimeStep();
}
} }
/*! /*!
@ -868,10 +834,10 @@ protected:
// optimal number of iterations we want to achieve // optimal number of iterations we want to achieve
int targetIterations_() const int targetIterations_() const
{ return Parameters::get<TypeTag, Parameters::NewtonTargetIterations>(); } { return Parameters::Get<Parameters::NewtonTargetIterations>(); }
// maximum number of iterations we do before giving up // maximum number of iterations we do before giving up
int maxIterations_() const int maxIterations_() const
{ return Parameters::get<TypeTag, Parameters::NewtonMaxIterations>(); } { return Parameters::Get<Parameters::NewtonMaxIterations>(); }
static bool enableConstraints_() static bool enableConstraints_()
{ return getPropValue<TypeTag, Properties::EnableConstraints>(); } { return getPropValue<TypeTag, Properties::EnableConstraints>(); }

View File

@ -23,32 +23,15 @@
#ifndef EWOMS_NEWTON_METHOD_PARAMETERS_HH #ifndef EWOMS_NEWTON_METHOD_PARAMETERS_HH
#define EWOMS_NEWTON_METHOD_PARAMETERS_HH #define EWOMS_NEWTON_METHOD_PARAMETERS_HH
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters { namespace Opm::Parameters {
//! Specifies whether the Newton method should print messages or not
template<class TypeTag, class MyTypeTag>
struct NewtonVerbose { using type = Properties::UndefinedProperty; };
//! Specifies whether the convergence rate and the global residual
//! gets written out to disk for every Newton iteration
template<class TypeTag, class MyTypeTag>
struct NewtonWriteConvergence { using type = Properties::UndefinedProperty; };
/*!
* \brief The value for the error below which convergence is declared
*
* This value can (and for the porous media models will) be changed to account for grid
* scaling and other effects.
*/
template<class TypeTag, class MyTypeTag>
struct NewtonTolerance { using type = Properties::UndefinedProperty; };
//! The maximum error which may occur in a simulation before the //! The maximum error which may occur in a simulation before the
//! Newton method for the time step is aborted //! Newton method for the time step is aborted
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct NewtonMaxError { using type = Properties::UndefinedProperty; }; struct NewtonMaxError { static constexpr Scalar value = 1e100; };
//! Number of maximum iterations for the Newton method.
struct NewtonMaxIterations { static constexpr int value = 20; };
/*! /*!
* \brief The number of iterations at which the Newton method * \brief The number of iterations at which the Newton method
@ -58,12 +41,23 @@ struct NewtonMaxError { using type = Properties::UndefinedProperty; };
* is to scale the last time-step size by the deviation of the * is to scale the last time-step size by the deviation of the
* number of iterations used from the target steps. * number of iterations used from the target steps.
*/ */
template<class TypeTag, class MyTypeTag> struct NewtonTargetIterations { static constexpr int value = 10; };
struct NewtonTargetIterations { using type = Properties::UndefinedProperty; };
//! Number of maximum iterations for the Newton method. /*!
template<class TypeTag, class MyTypeTag> * \brief The value for the error below which convergence is declared
struct NewtonMaxIterations { using type = Properties::UndefinedProperty; }; *
* This value can (and for the porous media models will) be changed to account for grid
* scaling and other effects.
*/
template<class Scalar>
struct NewtonTolerance { static constexpr Scalar value = 1e-8; };
//! Specifies whether the Newton method should print messages or not
struct NewtonVerbose { static constexpr bool value = true; };
//! Specifies whether the convergence rate and the global residual
//! gets written out to disk for every Newton iteration
struct NewtonWriteConvergence { static constexpr bool value = false; };
} // end namespace Opm::Parameters } // end namespace Opm::Parameters

View File

@ -35,13 +35,13 @@
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp> #include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/models/common/multiphasebasemodel.hh>
#include <opm/models/common/energymodule.hh> #include <opm/models/common/energymodule.hh>
#include <opm/models/common/multiphasebasemodel.hh>
#include <opm/models/flash/flashratevector.hh>
#include <opm/models/flash/flashboundaryratevector.hh> #include <opm/models/flash/flashboundaryratevector.hh>
#include <opm/models/flash/flashextensivequantities.hh> #include <opm/models/flash/flashextensivequantities.hh>
#include <opm/models/flash/flashproperties.hh> #include <opm/models/flash/flashproperties.hh>
#include <opm/models/flash/flashratevector.hh>
#include <opm/models/io/vtkcompositionmodule.hh> #include <opm/models/io/vtkcompositionmodule.hh>
#include <opm/models/io/vtkdiffusionmodule.hh> #include <opm/models/io/vtkdiffusionmodule.hh>
@ -69,11 +69,7 @@ namespace Opm::Properties {
namespace TTag { namespace TTag {
//! The type tag for the isothermal single phase problems //! The type tag for the isothermal single phase problems
struct FlashModel { using InheritsFrom = std::tuple<VtkDiffusion, struct FlashModel { using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
VtkEnergy,
VtkComposition,
VtkPTFlash,
MultiPhaseBaseModel>; };
} // namespace TTag } // namespace TTag
//! Use the FlashLocalResidual function for the flash model //! Use the FlashLocalResidual function for the flash model

View File

@ -69,11 +69,7 @@ namespace TTag {
//! The type tag for the isothermal single phase problems //! The type tag for the isothermal single phase problems
struct PvsModel struct PvsModel
{ {
using InheritsFrom = std::tuple<VtkDiffusion, using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
VtkEnergy,
VtkComposition,
VtkPhasePresence,
MultiPhaseBaseModel>; };
} // namespace TTag } // namespace TTag
//! Use the PVS local jacobian operator for the PVS model //! Use the PVS local jacobian operator for the PVS model

View File

@ -75,16 +75,16 @@ namespace Linear {
\ \
static void registerParameters() \ static void registerParameters() \
{ \ { \
Parameters::registerParam<TypeTag, Parameters::PreconditionerOrder> \ Parameters::Register<Parameters::PreconditionerOrder> \
("The order of the preconditioner"); \ ("The order of the preconditioner"); \
Parameters::registerParam<TypeTag, Parameters::PreconditionerRelaxation> \ Parameters::Register<Parameters::PreconditionerRelaxation<Scalar>> \
("The relaxation factor of the preconditioner"); \ ("The relaxation factor of the preconditioner"); \
} \ } \
\ \
void prepare(IstlMatrix& matrix) \ void prepare(IstlMatrix& matrix) \
{ \ { \
int order = Parameters::get<TypeTag, Parameters::PreconditionerOrder>(); \ int order = Parameters::Get<Parameters::PreconditionerOrder>(); \
Scalar relaxationFactor = Parameters::get<TypeTag, Parameters::PreconditionerRelaxation>(); \ Scalar relaxationFactor = Parameters::Get<Parameters::PreconditionerRelaxation<Scalar>>(); \
seqPreCond_ = new SequentialPreconditioner(matrix, order, \ seqPreCond_ = new SequentialPreconditioner(matrix, order, \
relaxationFactor); \ relaxationFactor); \
} \ } \
@ -118,14 +118,14 @@ namespace Linear {
\ \
static void registerParameters() \ static void registerParameters() \
{ \ { \
Parameters::registerParam<TypeTag, Parameters::PreconditionerRelaxation> \ Parameters::Register<Parameters::PreconditionerRelaxation<Scalar>> \
("The relaxation factor of the preconditioner"); \ ("The relaxation factor of the preconditioner"); \
} \ } \
\ \
void prepare(OverlappingMatrix& matrix) \ void prepare(OverlappingMatrix& matrix) \
{ \ { \
Scalar relaxationFactor = \ Scalar relaxationFactor = \
Parameters::get<TypeTag, Parameters::PreconditionerRelaxation>(); \ Parameters::Get<Parameters::PreconditionerRelaxation<Scalar>>();\
seqPreCond_ = new SequentialPreconditioner(matrix, \ seqPreCond_ = new SequentialPreconditioner(matrix, \
relaxationFactor); \ relaxationFactor); \
} \ } \
@ -155,7 +155,7 @@ class PreconditionerWrapperILU
using OverlappingMatrix = GetPropType<TypeTag, Properties::OverlappingMatrix>; using OverlappingMatrix = GetPropType<TypeTag, Properties::OverlappingMatrix>;
using OverlappingVector = GetPropType<TypeTag, Properties::OverlappingVector>; using OverlappingVector = GetPropType<TypeTag, Properties::OverlappingVector>;
static constexpr int order = getPropValue<TypeTag, Parameters::PreconditionerOrder>(); static constexpr int order = 0;
public: public:
using SequentialPreconditioner = Dune::SeqILU<OverlappingMatrix, OverlappingVector, OverlappingVector, order>; using SequentialPreconditioner = Dune::SeqILU<OverlappingMatrix, OverlappingVector, OverlappingVector, order>;
@ -165,13 +165,15 @@ public:
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::PreconditionerRelaxation> Parameters::Register<Parameters::PreconditionerRelaxation<Scalar>>
("The relaxation factor of the preconditioner"); ("The relaxation factor of the preconditioner");
Parameters::Register<Parameters::PreconditionerOrder>
("The order of the preconditioner");
} }
void prepare(OverlappingMatrix& matrix) void prepare(OverlappingMatrix& matrix)
{ {
Scalar relaxationFactor = Parameters::get<TypeTag, Parameters::PreconditionerRelaxation>(); Scalar relaxationFactor = Parameters::Get<Parameters::PreconditionerRelaxation<Scalar>>();
// create the sequential preconditioner. // create the sequential preconditioner.
seqPreCond_ = new SequentialPreconditioner(matrix, relaxationFactor); seqPreCond_ = new SequentialPreconditioner(matrix, relaxationFactor);

View File

@ -79,12 +79,12 @@ namespace Opm::Linear {
ScalarProduct& parScalarProduct, \ ScalarProduct& parScalarProduct, \
Preconditioner& parPreCond) \ Preconditioner& parPreCond) \
{ \ { \
Scalar tolerance = Parameters::get<TypeTag, Parameters::LinearSolverTolerance>(); \ Scalar tolerance = Parameters::Get<Parameters::LinearSolverTolerance<Scalar>>(); \
int maxIter = Parameters::get<TypeTag, Parameters::LinearSolverMaxIterations>(); \ int maxIter = Parameters::Get<Parameters::LinearSolverMaxIterations>();\
\ \
int verbosity = 0; \ int verbosity = 0; \
if (parOperator.overlap().myRank() == 0) \ if (parOperator.overlap().myRank() == 0) \
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); \ verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>(); \
solver_ = std::make_shared<RawSolver>(parOperator, parScalarProduct, \ solver_ = std::make_shared<RawSolver>(parOperator, parScalarProduct, \
parPreCond, tolerance, maxIter, \ parPreCond, tolerance, maxIter, \
verbosity); \ verbosity); \
@ -125,7 +125,7 @@ public:
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::GMResRestart> Parameters::Register<Parameters::GMResRestart>
("Number of iterations after which the GMRES linear solver is restarted"); ("Number of iterations after which the GMRES linear solver is restarted");
} }
@ -134,13 +134,13 @@ public:
ScalarProduct& parScalarProduct, ScalarProduct& parScalarProduct,
Preconditioner& parPreCond) Preconditioner& parPreCond)
{ {
Scalar tolerance = Parameters::get<TypeTag, Parameters::LinearSolverTolerance>(); Scalar tolerance = Parameters::Get<Parameters::LinearSolverTolerance<Scalar>>();
int maxIter = Parameters::get<TypeTag, Parameters::LinearSolverMaxIterations>(); int maxIter = Parameters::Get<Parameters::LinearSolverMaxIterations>();
int verbosity = 0; int verbosity = 0;
if (parOperator.overlap().myRank() == 0) if (parOperator.overlap().myRank() == 0)
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>();
int restartAfter = Parameters::get<TypeTag, Parameters::GMResRestart>(); int restartAfter = Parameters::Get<Parameters::GMResRestart>();
solver_ = std::make_shared<RawSolver>(parOperator, solver_ = std::make_shared<RawSolver>(parOperator,
parScalarProduct, parScalarProduct,
parPreCond, parPreCond,

View File

@ -29,29 +29,22 @@
#ifndef EWOMS_LINALG_PARAMETERS_HH #ifndef EWOMS_LINALG_PARAMETERS_HH
#define EWOMS_LINALG_PARAMETERS_HH #define EWOMS_LINALG_PARAMETERS_HH
#include <opm/models/utils/parametersystem.hh>
namespace Opm::Parameters { namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct AmgCoarsenTarget { using type = Properties::UndefinedProperty; };
//! number of iterations between solver restarts for the GMRES solver //! number of iterations between solver restarts for the GMRES solver
template<class TypeTag, class MyTypeTag> struct GMResRestart { static constexpr int value = 10; };
struct GMResRestart { using type = Properties::UndefinedProperty; };
/*! /*!
* \brief Maximum accepted error of the norm of the residual. * \brief Maximum accepted error of the norm of the residual.
*/ */
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LinearSolverAbsTolerance { using type = Properties::UndefinedProperty; }; struct LinearSolverAbsTolerance { static constexpr Scalar value = -1.0; };
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LinearSolverMaxError { using type = Properties::UndefinedProperty; }; struct LinearSolverMaxError { static constexpr Scalar value = 1e7; };
//! Maximum number of iterations eyecuted by the linear solver //! Maximum number of iterations eyecuted by the linear solver
template<class TypeTag, class MyTypeTag> struct LinearSolverMaxIterations { static constexpr int value = 1000; };
struct LinearSolverMaxIterations { using type = Properties::UndefinedProperty; };
/*! /*!
* \brief The size of the algebraic overlap of the linear solver. * \brief The size of the algebraic overlap of the linear solver.
@ -60,14 +53,13 @@ struct LinearSolverMaxIterations { using type = Properties::UndefinedProperty; }
* of a grid, but it is only existant for the linear system of * of a grid, but it is only existant for the linear system of
* equations. * equations.
*/ */
template<class TypeTag, class MyTypeTag> struct LinearSolverOverlapSize { static constexpr unsigned value = 2; };
struct LinearSolverOverlapSize { using type = Properties::UndefinedProperty; };
/*! /*!
* \brief Maximum accepted error of the solution of the linear solver. * \brief Maximum accepted error of the solution of the linear solver.
*/ */
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct LinearSolverTolerance { using type = Properties::UndefinedProperty; }; struct LinearSolverTolerance { static constexpr Scalar value = 1e-3; };
/*! /*!
* \brief Specifies the verbosity of the linear solver * \brief Specifies the verbosity of the linear solver
@ -76,16 +68,14 @@ struct LinearSolverTolerance { using type = Properties::UndefinedProperty; };
* property to 1 prints aggregated convergence rates, 2 prints the * property to 1 prints aggregated convergence rates, 2 prints the
* convergence rate of every iteration of the scheme. * convergence rate of every iteration of the scheme.
*/ */
template<class TypeTag, class MyTypeTag> struct LinearSolverVerbosity { static constexpr int value = 0; };
struct LinearSolverVerbosity { using type = Properties::UndefinedProperty; };
//! The order of the sequential preconditioner //! The order of the sequential preconditioner
template<class TypeTag, class MyTypeTag> struct PreconditionerOrder { static constexpr int value = 0; };
struct PreconditionerOrder { using type = Properties::UndefinedProperty; };
//! The relaxation factor of the preconditioner //! The relaxation factor of the preconditioner
template<class TypeTag, class MyTypeTag> template<class Scalar>
struct PreconditionerRelaxation { using type = Properties::UndefinedProperty; }; struct PreconditionerRelaxation { static constexpr Scalar value = 1.0; };
} // namespace Opm::Parameters } // namespace Opm::Parameters

View File

@ -69,16 +69,7 @@ namespace Opm::Parameters {
//! The target number of DOFs per processor for the parallel algebraic //! The target number of DOFs per processor for the parallel algebraic
//! multi-grid solver //! multi-grid solver
template<class TypeTag> struct AmgCoarsenTarget { static constexpr int value = 5000; };
struct AmgCoarsenTarget<TypeTag, Properties::TTag::ParallelAmgLinearSolver>
{ static constexpr int value = 5000; };
template<class TypeTag>
struct LinearSolverMaxError<TypeTag, Properties::TTag::ParallelAmgLinearSolver>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e7;
};
} }
@ -160,10 +151,10 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::LinearSolverMaxError> Parameters::Register<Parameters::LinearSolverMaxError<Scalar>>
("The maximum residual error which the linear solver tolerates " ("The maximum residual error which the linear solver tolerates "
"without giving up"); "without giving up");
Parameters::registerParam<TypeTag, Parameters::AmgCoarsenTarget> Parameters::Register<Parameters::AmgCoarsenTarget>
("The coarsening target for the agglomerations of " ("The coarsening target for the agglomerations of "
"the AMG preconditioner"); "the AMG preconditioner");
} }
@ -203,24 +194,25 @@ protected:
const auto& gridView = this->simulator_.gridView(); const auto& gridView = this->simulator_.gridView();
using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>; using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>;
Scalar linearSolverTolerance = Parameters::get<TypeTag, Parameters::LinearSolverTolerance>(); Scalar linearSolverTolerance = Parameters::Get<Parameters::LinearSolverTolerance<Scalar>>();
Scalar linearSolverAbsTolerance = Parameters::get<TypeTag, Parameters::LinearSolverAbsTolerance>(); Scalar linearSolverAbsTolerance = Parameters::Get<Parameters::LinearSolverAbsTolerance<Scalar>>();
if(linearSolverAbsTolerance < 0.0) if (linearSolverAbsTolerance < 0.0) {
linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance()/100.0; linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance()/100.0;
}
convCrit_.reset(new CCC(gridView.comm(), convCrit_.reset(new CCC(gridView.comm(),
/*residualReductionTolerance=*/linearSolverTolerance, /*residualReductionTolerance=*/linearSolverTolerance,
/*absoluteResidualTolerance=*/linearSolverAbsTolerance, /*absoluteResidualTolerance=*/linearSolverAbsTolerance,
Parameters::get<TypeTag, Parameters::LinearSolverMaxError>())); Parameters::Get<Parameters::LinearSolverMaxError<Scalar>>()));
auto bicgstabSolver = auto bicgstabSolver =
std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct); std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct);
int verbosity = 0; int verbosity = 0;
if (parOperator.overlap().myRank() == 0) if (parOperator.overlap().myRank() == 0)
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>();
bicgstabSolver->setVerbosity(verbosity); bicgstabSolver->setVerbosity(verbosity);
bicgstabSolver->setMaxIterations(Parameters::get<TypeTag, Parameters::LinearSolverMaxIterations>()); bicgstabSolver->setMaxIterations(Parameters::Get<Parameters::LinearSolverMaxIterations>());
bicgstabSolver->setLinearOperator(&parOperator); bicgstabSolver->setLinearOperator(&parOperator);
bicgstabSolver->setRhs(this->overlappingb_); bicgstabSolver->setRhs(this->overlappingb_);
@ -284,7 +276,7 @@ protected:
int verbosity = 0; int verbosity = 0;
if (this->simulator_.vanguard().gridView().comm().rank() == 0) if (this->simulator_.vanguard().gridView().comm().rank() == 0)
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>();
using SmootherArgs = typename Dune::Amg::SmootherTraits<ParallelSmoother>::Arguments; using SmootherArgs = typename Dune::Amg::SmootherTraits<ParallelSmoother>::Arguments;
@ -299,7 +291,7 @@ protected:
// Dune::Amg::FirstDiagonal>> // Dune::Amg::FirstDiagonal>>
using CoarsenCriterion = Dune::Amg:: using CoarsenCriterion = Dune::Amg::
CoarsenCriterion<Dune::Amg::SymmetricCriterion<IstlMatrix, Dune::Amg::FrobeniusNorm> >; CoarsenCriterion<Dune::Amg::SymmetricCriterion<IstlMatrix, Dune::Amg::FrobeniusNorm> >;
int coarsenTarget = Parameters::get<TypeTag, Parameters::AmgCoarsenTarget>(); int coarsenTarget = Parameters::Get<Parameters::AmgCoarsenTarget>();
CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget); CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget);
coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension, coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension,
/*aggregateSizePerDim=*/3); /*aggregateSizePerDim=*/3);

View File

@ -152,15 +152,15 @@ public:
*/ */
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::LinearSolverTolerance> Parameters::Register<Parameters::LinearSolverTolerance<Scalar>>
("The maximum allowed error between of the linear solver"); ("The maximum allowed error between of the linear solver");
Parameters::registerParam<TypeTag, Parameters::LinearSolverAbsTolerance> Parameters::Register<Parameters::LinearSolverAbsTolerance<Scalar>>
("The maximum accepted error of the norm of the residual"); ("The maximum accepted error of the norm of the residual");
Parameters::registerParam<TypeTag, Parameters::LinearSolverOverlapSize> Parameters::Register<Parameters::LinearSolverOverlapSize>
("The size of the algebraic overlap for the linear solver"); ("The size of the algebraic overlap for the linear solver");
Parameters::registerParam<TypeTag, Parameters::LinearSolverMaxIterations> Parameters::Register<Parameters::LinearSolverMaxIterations>
("The maximum number of iterations of the linear solver"); ("The maximum number of iterations of the linear solver");
Parameters::registerParam<TypeTag, Parameters::LinearSolverVerbosity> Parameters::Register<Parameters::LinearSolverVerbosity>
("The verbosity level of the linear solver"); ("The verbosity level of the linear solver");
PreconditionerWrapper::registerParameters(); PreconditionerWrapper::registerParameters();
@ -195,7 +195,7 @@ public:
simulator_.model().dofMapper()); simulator_.model().dofMapper());
// create the overlapping Jacobian matrix // create the overlapping Jacobian matrix
unsigned overlapSize = Parameters::get<TypeTag, Parameters::LinearSolverOverlapSize>(); unsigned overlapSize = Parameters::Get<Parameters::LinearSolverOverlapSize>();
overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(), overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(),
borderListCreator.borderList(), borderListCreator.borderList(),
borderListCreator.blackList(), borderListCreator.blackList(),
@ -444,36 +444,4 @@ struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
//! set the default number of maximum iterations for the linear solver
template<class TypeTag>
struct LinearSolverMaxIterations<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{ static constexpr int value = 1000; };
//! set the default overlap size to 2
template<class TypeTag>
struct LinearSolverOverlapSize<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{ static constexpr unsigned value = 2; };
//! make the linear solver shut up by default
template<class TypeTag>
struct LinearSolverVerbosity<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{ static constexpr int value = 0; };
//! set the preconditioner order to 0 by default
template<class TypeTag>
struct PreconditionerOrder<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{ static constexpr int value = 0; };
//! set the preconditioner relaxation parameter to 1.0 by default
template<class TypeTag>
struct PreconditionerRelaxation<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1.0;
};
} // namespace Opm::Parameters
#endif #endif

View File

@ -59,17 +59,6 @@ struct LinearSolverBackend<TypeTag, TTag::ParallelBiCGStabLinearSolver>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct LinearSolverMaxError<TypeTag, Properties::TTag::ParallelBiCGStabLinearSolver>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 1e7;
};
}
namespace Opm::Linear { namespace Opm::Linear {
/*! /*!
@ -131,7 +120,7 @@ public:
{ {
ParentType::registerParameters(); ParentType::registerParameters();
Parameters::registerParam<TypeTag, Parameters::LinearSolverMaxError> Parameters::Register<Parameters::LinearSolverMaxError<Scalar>>
("The maximum residual error which the linear solver tolerates" ("The maximum residual error which the linear solver tolerates"
" without giving up"); " without giving up");
} }
@ -146,24 +135,24 @@ protected:
const auto& gridView = this->simulator_.gridView(); const auto& gridView = this->simulator_.gridView();
using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>; using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>;
Scalar linearSolverTolerance = Parameters::get<TypeTag, Parameters::LinearSolverTolerance>(); Scalar linearSolverTolerance = Parameters::Get<Parameters::LinearSolverTolerance<Scalar>>();
Scalar linearSolverAbsTolerance = Parameters::get<TypeTag, Parameters::LinearSolverAbsTolerance>(); Scalar linearSolverAbsTolerance = Parameters::Get<Parameters::LinearSolverAbsTolerance<Scalar>>();
if(linearSolverAbsTolerance < 0.0) if(linearSolverAbsTolerance < 0.0)
linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance() / 100.0; linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance() / 100.0;
convCrit_.reset(new CCC(gridView.comm(), convCrit_.reset(new CCC(gridView.comm(),
/*residualReductionTolerance=*/linearSolverTolerance, /*residualReductionTolerance=*/linearSolverTolerance,
/*absoluteResidualTolerance=*/linearSolverAbsTolerance, /*absoluteResidualTolerance=*/linearSolverAbsTolerance,
Parameters::get<TypeTag, Parameters::LinearSolverMaxError>())); Parameters::Get<Parameters::LinearSolverMaxError<Scalar>>()));
auto bicgstabSolver = auto bicgstabSolver =
std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct); std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct);
int verbosity = 0; int verbosity = 0;
if (parOperator.overlap().myRank() == 0) if (parOperator.overlap().myRank() == 0)
verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>();
bicgstabSolver->setVerbosity(verbosity); bicgstabSolver->setVerbosity(verbosity);
bicgstabSolver->setMaxIterations(Parameters::get<TypeTag, Parameters::LinearSolverMaxIterations>()); bicgstabSolver->setMaxIterations(Parameters::Get<Parameters::LinearSolverMaxIterations>());
bicgstabSolver->setLinearOperator(&parOperator); bicgstabSolver->setLinearOperator(&parOperator);
bicgstabSolver->setRhs(this->overlappingb_); bicgstabSolver->setRhs(this->overlappingb_);

View File

@ -158,13 +158,4 @@ struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
} // namespace Opm::Properties } // namespace Opm::Properties
namespace Opm::Parameters {
//! set the GMRes restart parameter to 10 by default
template<class TypeTag>
struct GMResRestart<TypeTag, Properties::TTag::ParallelIstlLinearSolver>
{ static constexpr int value = 10; };
}
#endif #endif

View File

@ -73,7 +73,7 @@ public:
static void registerParameters() static void registerParameters()
{ {
Parameters::registerParam<TypeTag, Parameters::LinearSolverVerbosity> Parameters::Register<Parameters::LinearSolverVerbosity>
("The verbosity level of the linear solver"); ("The verbosity level of the linear solver");
} }
@ -114,7 +114,7 @@ public:
{ {
Vector bTmp(b); Vector bTmp(b);
int verbosity = Parameters::get<TypeTag, Parameters::LinearSolverVerbosity>(); int verbosity = Parameters::Get<Parameters::LinearSolverVerbosity>();
Dune::InverseOperatorResult result; Dune::InverseOperatorResult result;
Dune::SuperLU<Matrix> solver(A, verbosity > 0); Dune::SuperLU<Matrix> solver(A, verbosity > 0);
solver.apply(x, bTmp, result); solver.apply(x, bTmp, result);