Merge pull request #904 from akva2/fvbasediscretization_param_split

Start separating (compile time) Properties from (runtime) Parameters
This commit is contained in:
Bård Skaflestad 2024-07-01 13:21:18 +02:00 committed by GitHub
commit 13964c96be
63 changed files with 762 additions and 439 deletions

View File

@ -32,6 +32,7 @@
#include <opm/material/common/quad.hpp>
#endif
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/flash/flashmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -42,14 +43,20 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionFlashEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
struct Co2InjectionFlashEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
// use automatic differentiation for this simulator
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
// use the flash solver adapted to the CO2 injection problem
template<class TypeTag>
@ -62,7 +69,8 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = quad; };
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
{ using type = quad; };
#else
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashEcfvProblem>

View File

@ -28,7 +28,10 @@
*/
#include "config.h"
// this must be included before the vanguard
#include <opm/material/common/quad.hpp>
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/flash/flashmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -39,17 +42,23 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionFlashNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
struct Co2InjectionFlashNiEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
{ static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
// use the CO2 injection problem adapted flash solver
template<class TypeTag>
@ -62,7 +71,8 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = quad; };
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
{ using type = quad; };
#else
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>

View File

@ -28,7 +28,10 @@
*/
#include "config.h"
// this must be included before the vanguard
#include <opm/material/common/quad.hpp>
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/flash/flashmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -39,13 +42,19 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionFlashNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
struct Co2InjectionFlashNiVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { static constexpr bool value = true; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
{ static constexpr bool value = true; };
// use the CO2 injection problem adapted flash solver
template<class TypeTag>
@ -58,7 +67,8 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { using type = quad; };
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
{ using type = quad; };
#else
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>

View File

@ -32,6 +32,7 @@
#include <opm/material/common/quad.hpp>
#endif
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/flash/flashmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -42,10 +43,14 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionFlashVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
struct Co2InjectionFlashVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
// use the flash solver adapted to the CO2 injection problem
template<class TypeTag>
@ -58,7 +63,8 @@ struct FlashSolver<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem> { using type = quad; };
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
{ using type = quad; };
#else
template<class TypeTag>
struct NewtonTolerance<TypeTag, TTag::Co2InjectionFlashVcfvProblem>

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -37,7 +38,9 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionImmiscibleNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
struct Co2InjectionImmiscibleNiEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
} // end namespace TTag
template<class TypeTag>
@ -45,11 +48,13 @@ struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvPr
{ using type = TTag::EcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem>
{ static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -43,10 +44,12 @@ struct Co2InjectionImmiscibleNiVcfvProblem
} // namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -44,7 +45,8 @@ struct Co2InjectionImmiscibleVcfvProblem
} // namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -37,10 +38,15 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionNcpEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
struct Co2InjectionNcpEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -37,16 +38,24 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionNcpNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
struct Co2InjectionNcpNiEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem>
{ static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -37,12 +38,18 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionNcpNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
struct Co2InjectionNcpNiVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpNiVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpNiVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiVcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiVcfvProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -38,10 +39,15 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionNcpVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
struct Co2InjectionNcpVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionNcpVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -37,10 +38,15 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionPvsEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
struct Co2InjectionPvsEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -37,17 +38,23 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionPvsNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
struct Co2InjectionPvsNiEcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem>
{ static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -37,13 +38,19 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionPvsNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
struct Co2InjectionPvsNiVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsNiVcfvProblem> { using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiVcfvProblem> { static constexpr bool value = true; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsNiVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiVcfvProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -38,10 +39,15 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct Co2InjectionPvsVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
struct Co2InjectionPvsVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionPvsVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -37,7 +38,9 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct CuvetteProblem { using InheritsFrom = std::tuple<CuvetteBaseProblem, PvsModel>; };
struct CuvetteProblem
{ using InheritsFrom = std::tuple<CuvetteBaseProblem, PvsModel>; };
} // end namespace TTag
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
#include "problems/groundwaterproblem.hh"
@ -35,7 +36,10 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct GroundWaterProblem { using InheritsFrom = std::tuple<GroundWaterBaseProblem, ImmiscibleSinglePhaseModel>; };
struct GroundWaterProblem
{ using InheritsFrom = std::tuple<GroundWaterBaseProblem, ImmiscibleSinglePhaseModel>; };
} // end namespace TTag
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -36,7 +37,8 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct InfiltrationProblem { using InheritsFrom = std::tuple<InfiltrationBaseProblem, PvsModel>; };
struct InfiltrationProblem
{ using InheritsFrom = std::tuple<InfiltrationBaseProblem, PvsModel>; };
} // end namespace TTag
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -37,14 +38,19 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct RichardsLensEcfvProblem { using InheritsFrom = std::tuple<RichardsLensProblem>; };
struct RichardsLensEcfvProblem
{ using InheritsFrom = std::tuple<RichardsLensProblem>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::RichardsLensEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::RichardsLensEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
//! Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::RichardsLensEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::RichardsLensEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -37,10 +38,15 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct RichardsLensVcfvProblem { using InheritsFrom = std::tuple<RichardsLensProblem>; };
struct RichardsLensVcfvProblem
{ using InheritsFrom = std::tuple<RichardsLensProblem>; };
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::RichardsLensVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::RichardsLensVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
#include <opm/models/immiscible/immisciblemodel.hh>
@ -37,7 +38,9 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, ImmiscibleModel>; };
struct ObstacleProblem
{ using InheritsFrom = std::tuple<ObstacleBaseProblem, ImmiscibleModel>; };
} // end namespace TTag
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -37,7 +38,10 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, NcpModel>; };
struct ObstacleProblem
{ using InheritsFrom = std::tuple<ObstacleBaseProblem, NcpModel>; };
} // end namespace TTag
} // namespace Opm::Properties

View File

@ -29,6 +29,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -39,12 +40,16 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, PvsModel>; };
struct ObstacleProblem
{ using InheritsFrom = std::tuple<ObstacleBaseProblem, PvsModel>; };
} // end namespace TTag
// Verbosity of the PVS model (0=silent, 1=medium, 2=chatty)
template<class TypeTag>
struct PvsVerbosity<TypeTag, TTag::ObstacleProblem> { static constexpr int value = 1; };
struct PvsVerbosity<TypeTag, TTag::ObstacleProblem>
{ static constexpr int value = 1; };
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh>
@ -37,12 +38,16 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct OutflowProblem { using InheritsFrom = std::tuple<OutflowBaseProblem, PvsModel>; };
struct OutflowProblem
{ using InheritsFrom = std::tuple<OutflowBaseProblem, PvsModel>; };
} // end namespace TTag
// Verbosity of the PVS model (0=silent, 1=medium, 2=chatty)
template<class TypeTag>
struct PvsVerbosity<TypeTag, TTag::OutflowProblem> { static constexpr int value = 1; };
struct PvsVerbosity<TypeTag, TTag::OutflowProblem>
{ static constexpr int value = 1; };
} // namespace Opm::Properties

View File

@ -80,14 +80,6 @@ struct FluidSystem<TypeTag, TTag::CuvetteBaseProblem>
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::CuvetteBaseProblem> { static constexpr bool value = true; };
// Set the maximum time step
template<class TypeTag>
struct MaxTimeStepSize<TypeTag, TTag::CuvetteBaseProblem>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 600.;
};
// Set the material Law
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::CuvetteBaseProblem>
@ -146,6 +138,18 @@ struct GridFile<TypeTag, TTag::CuvetteBaseProblem> { static constexpr auto value
} // namespace Opm::Properties
namespace Opm::Parameters {
// Set the maximum time step
template<class TypeTag>
struct MaxTimeStepSize<TypeTag, Properties::TTag::CuvetteBaseProblem>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 600.;
};
} // namespace Opm::Parameters
namespace Opm {
/*!
* \ingroup TestProblems

View File

@ -225,15 +225,21 @@ struct InitialTimeStepSize<TypeTag, TTag::LensBaseProblem>
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
// enable the storage cache by default for this problem
template<class TypeTag>
struct EnableStorageCache<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// enable the cache for intensive quantities by default for this problem
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Properties
// enable the storage cache by default for this problem
template<class TypeTag>
struct EnableStorageCache<TypeTag, Properties::TTag::LensBaseProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm {

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/blackoil/blackoilmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -39,16 +40,21 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ReservoirBlackOilEcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
struct ReservoirBlackOilEcfvProblem
{ using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
} // end namespace TTag
// Select the element centered finite volume method as spatial discretization
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirBlackOilEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirBlackOilEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
// Use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::ReservoirBlackOilEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::ReservoirBlackOilEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/blackoil/blackoilmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -38,12 +39,16 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ReservoirBlackOilVcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
struct ReservoirBlackOilVcfvProblem
{ using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
} // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirBlackOilVcfvProblem> { using type = TTag::VcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirBlackOilVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
} // namespace Opm::Properties

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
@ -38,16 +39,21 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ReservoirNcpEcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
struct ReservoirNcpEcfvProblem
{ using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
} // end namespace TTag
// Select the element centered finite volume method as spatial discretization
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirNcpEcfvProblem> { using type = TTag::EcfvDiscretization; };
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirNcpEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
//! use automatic differentiation to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::ReservoirNcpEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
struct LocalLinearizerSplice<TypeTag, TTag::ReservoirNcpEcfvProblem>
{ using type = TTag::AutoDiffLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -28,6 +28,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/ncp/ncpmodel.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
@ -39,17 +40,16 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct ReservoirNcpVcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
struct ReservoirNcpVcfvProblem
{ using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
} // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirNcpVcfvProblem> { using type = TTag::VcfvDiscretization; };
// enable the storage cache for this problem so that the storage cache receives wider
// testing
template<class TypeTag>
struct EnableStorageCache<TypeTag, TTag::ReservoirNcpVcfvProblem> { static constexpr bool value = true; };
struct SpatialDiscretizationSplice<TypeTag, TTag::ReservoirNcpVcfvProblem>
{ using type = TTag::VcfvDiscretization; };
// reduce the base epsilon for the finite difference method to 10^-11. for some reason
// the simulator converges better with this. (TODO: use automatic differentiation?)
@ -60,9 +60,18 @@ struct BaseEpsilon<TypeTag, TTag::ReservoirNcpVcfvProblem>
static constexpr type value = 1e-11;
};
} // namespace Opm::Properties
namespace Opm::Parameters {
// enable the storage cache for this problem so that the storage cache receives wider
// testing
template<class TypeTag>
struct EnableStorageCache<TypeTag, Properties::TTag::ReservoirNcpVcfvProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
int main(int argc, char **argv)
{
using ProblemTypeTag = Opm::Properties::TTag::ReservoirNcpVcfvProblem;

View File

@ -27,6 +27,7 @@
*/
#include "config.h"
#include <opm/models/io/dgfvanguard.hh>
#include <opm/models/utils/start.hh>
#include <opm/models/pvs/pvsmodel.hh>
#include "problems/waterairproblem.hh"
@ -35,11 +36,13 @@ namespace Opm::Properties {
// Create new type tags
namespace TTag {
struct WaterAirProblem { using InheritsFrom = std::tuple<WaterAirBaseProblem, PvsModel>; };
struct WaterAirProblem
{ using InheritsFrom = std::tuple<WaterAirBaseProblem, PvsModel>; };
} // end namespace TTag
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::WaterAirProblem> { static constexpr bool value = true; };
struct EnableEnergy<TypeTag, TTag::WaterAirProblem>
{ static constexpr bool value = true; };
} // namespace Opm::Properties

View File

@ -30,9 +30,9 @@
#include "blackoilproperties.hh"
#include <opm/common/OpmLog/OpmLog.hpp>
#include <dune/common/fvector.hh>
#include <opm/models/blackoil/blackoilfoamparams.hh>
#include <opm/common/OpmLog/OpmLog.hpp>
#if HAVE_ECL_INPUT
#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
@ -40,10 +40,12 @@
#include <opm/input/eclipse/EclipseState/Tables/FoammobTable.hpp>
#endif
#include <dune/common/fvector.hh>
#include <opm/models/blackoil/blackoilfoamparams.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <string>
#include <math.h>
namespace Opm {
@ -187,7 +189,7 @@ public:
Simulator&)
{
if constexpr (enableFoam) {
if (Parameters::get<TypeTag, Properties::EnableVtkOutput>()) {
if (Parameters::get<TypeTag, Parameters::EnableVtkOutput>()) {
OpmLog::warning("VTK output requested, currently unsupported by the foam module.");
}
}

View File

@ -28,20 +28,22 @@
#ifndef EWOMS_MULTI_PHASE_BASE_PROBLEM_HH
#define EWOMS_MULTI_PHASE_BASE_PROBLEM_HH
#include "multiphasebaseproperties.hh"
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <opm/models/common/directionalmobility.hh>
#include <opm/models/discretization/common/fvbaseproblem.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <dune/grid/common/partitionset.hh>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/common/Means.hpp>
#include <opm/material/densead/Evaluation.hpp>
#include <opm/utility/CopyablePtr.hpp>
#include <opm/models/common/directionalmobility.hh>
#include <opm/models/common/multiphasebaseproperties.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <opm/models/discretization/common/fvbaseproblem.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/utility/CopyablePtr.hpp>
namespace Opm {
/*!

View File

@ -93,15 +93,20 @@ struct ExtensiveQuantities<TypeTag, TTag::DiscreteFractureModel>
template<class TypeTag>
struct UseTwoPointGradients<TypeTag, TTag::DiscreteFractureModel> { static constexpr bool value = true; };
} // namespace Opm::Properties
namespace Opm::Parameters {
// The intensive quantity cache cannot be used by the discrete fracture model, because
// the intensive quantities of a control degree of freedom are not identical to the
// intensive quantities of the other intensive quantities of the same of the same degree
// of freedom. This is because the fracture properties (volume, permeability, etc) are
// specific for each...
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::DiscreteFractureModel> { static constexpr bool value = false; };
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::DiscreteFractureModel>
{ static constexpr bool value = false; };
} // namespace Opm::Properties
} // namespace Opm::Parameters
namespace Opm {
@ -132,7 +137,7 @@ public:
DiscreteFractureModel(Simulator& simulator)
: ParentType(simulator)
{
if (Parameters::get<TypeTag, Properties::EnableIntensiveQuantityCache>()) {
if (Parameters::get<TypeTag, Parameters::EnableIntensiveQuantityCache>()) {
throw std::runtime_error("The discrete fracture model does not work in conjunction "
"with intensive quantities caching");
}

View File

@ -120,18 +120,6 @@ struct DiscExtensiveQuantities<TypeTag, TTag::FvBaseDiscretization> { using type
template<class TypeTag>
struct GradientCalculator<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseGradientCalculator<TypeTag>; };
//! The maximum allowed number of timestep divisions for the
//! Newton solver
template<class TypeTag>
struct MaxTimeStepDivisions<TypeTag, TTag::FvBaseDiscretization> { static constexpr unsigned value = 10; };
//! By default, do not continue with a non-converged solution instead of giving up
//! if we encounter a time step size smaller than the minimum time
//! step size.
template<class TypeTag>
struct ContinueOnConvergenceError<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
/*!
* \brief A vector of quanties, each for one equation.
*/
@ -213,8 +201,6 @@ struct ConstraintsContext<TypeTag, TTag::FvBaseDiscretization> { using type = Fv
template<class TypeTag>
struct ThreadManager<TypeTag, TTag::FvBaseDiscretization> { using type = ::Opm::ThreadManager<TypeTag>; };
template<class TypeTag>
struct ThreadsPerProcess<TypeTag, TTag::FvBaseDiscretization> { static constexpr int value = 1; };
template<class TypeTag>
struct UseLinearizationLock<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = true; };
/*!
@ -223,64 +209,14 @@ struct UseLinearizationLock<TypeTag, TTag::FvBaseDiscretization> { static conste
template<class TypeTag>
struct Linearizer<TypeTag, TTag::FvBaseDiscretization> { using type = FvBaseLinearizer<TypeTag>; };
//! use an unlimited time step size by default
template<class TypeTag>
struct MaxTimeStepSize<TypeTag, TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = std::numeric_limits<type>::infinity();
};
//! By default, accept any time step larger than zero
template<class TypeTag>
struct MinTimeStepSize<TypeTag, TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Scalar>;
static constexpr type value = 0.0;
};
//! Disable grid adaptation by default
template<class TypeTag>
struct EnableGridAdaptation<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
//! By default, write the simulation output to the current working directory
template<class TypeTag>
struct OutputDir<TypeTag, TTag::FvBaseDiscretization> { static constexpr auto value = "."; };
//! Enable the VTK output by default
template<class TypeTag>
struct EnableVtkOutput<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = true; };
//! By default, write the VTK output to asynchronously to disk
//!
//! This has only an effect if EnableVtkOutput is true
template<class TypeTag>
struct EnableAsyncVtkOutput<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = true; };
//! Set the format of the VTK output to ASCII by default
template<class TypeTag>
struct VtkOutputFormat<TypeTag, TTag::FvBaseDiscretization> { static constexpr int value = Dune::VTK::ascii; };
// disable caching the storage term by default
template<class TypeTag>
struct EnableStorageCache<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
// disable constraints by default
template<class TypeTag>
struct EnableConstraints<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
// by default, disable the intensive quantity cache. If the intensive quantities are
// relatively cheap to calculate, the cache basically does not yield any performance
// impact because of the intensive quantity cache will cause additional pressure on the
// CPU caches...
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
// do not use thermodynamic hints by default. If you enable this, make sure to also
// enable the intensive quantity cache above to avoid getting an exception...
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, TTag::FvBaseDiscretization> { static constexpr bool value = false; };
// 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
@ -337,6 +273,84 @@ struct DiscreteFunction<TypeTag, TTag::FvBaseDiscretization> {
} // namespace Opm::Properties
namespace Opm::Parameters {
template<class TypeTag>
struct ThreadsPerProcess<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr int value = 1; };
//! Disable grid adaptation by default
template<class TypeTag>
struct EnableGridAdaptation<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
//! By default, write the simulation output to the current working directory
template<class TypeTag>
struct OutputDir<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr auto value = "."; };
//! Enable the VTK output by default
template<class TypeTag>
struct EnableVtkOutput<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = true; };
//! By default, write the VTK output to asynchronously to disk
//!
//! This has only an effect if EnableVtkOutput is true
template<class TypeTag>
struct EnableAsyncVtkOutput<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = true; };
//! use an unlimited time step size by default
template<class TypeTag>
struct MaxTimeStepSize<TypeTag, Properties::TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = std::numeric_limits<type>::infinity();
};
//! By default, accept any time step larger than zero
template<class TypeTag>
struct MinTimeStepSize<TypeTag, Properties::TTag::FvBaseDiscretization>
{
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = 0.0;
};
//! The maximum allowed number of timestep divisions for the
//! Newton solver
template<class TypeTag>
struct MaxTimeStepDivisions<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr unsigned value = 10; };
//! By default, do not continue with a non-converged solution instead of giving up
//! if we encounter a time step size smaller than the minimum time
//! step size.
template<class TypeTag>
struct ContinueOnConvergenceError<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
//! by default, disable the intensive quantity cache. If the intensive quantities are
//! relatively cheap to calculate, the cache basically does not yield any performance
//! impact because of the intensive quantity cache will cause additional pressure on the
//! CPU caches...
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
// disable caching the storage term by default
template<class TypeTag>
struct EnableStorageCache<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
// do not use thermodynamic hints by default. If you enable this, make sure to also
// enable the intensive quantity cache above to avoid getting an exception...
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, Properties::TTag::FvBaseDiscretization>
{ static constexpr bool value = false; };
} // namespace Opm::Parameters
namespace Opm {
/*!
@ -453,10 +467,10 @@ public:
, newtonMethod_(simulator)
, localLinearizer_(ThreadManager::maxThreads())
, linearizer_(new Linearizer())
, enableGridAdaptation_(Parameters::get<TypeTag, Properties::EnableGridAdaptation>() )
, enableIntensiveQuantityCache_(Parameters::get<TypeTag, Properties::EnableIntensiveQuantityCache>())
, enableStorageCache_(Parameters::get<TypeTag, Properties::EnableStorageCache>())
, enableThermodynamicHints_(Parameters::get<TypeTag, Properties::EnableThermodynamicHints>())
, enableGridAdaptation_(Parameters::get<TypeTag, Parameters::EnableGridAdaptation>() )
, enableIntensiveQuantityCache_(Parameters::get<TypeTag, Parameters::EnableIntensiveQuantityCache>())
, enableStorageCache_(Parameters::get<TypeTag, Parameters::EnableStorageCache>())
, enableThermodynamicHints_(Parameters::get<TypeTag, Parameters::EnableThermodynamicHints>())
{
bool isEcfv = std::is_same<Discretization, EcfvDiscretization<TypeTag> >::value;
if (enableGridAdaptation_ && !isEcfv)
@ -464,7 +478,7 @@ public:
"element-centered finite volume discretization (is: "
+Dune::className<Discretization>()+")");
enableStorageCache_ = Parameters::get<TypeTag, Properties::EnableStorageCache>();
enableStorageCache_ = Parameters::get<TypeTag, Parameters::EnableStorageCache>();
PrimaryVariables::init();
size_t numDof = asImp_().numGridDof();
@ -510,17 +524,17 @@ public:
// register runtime parameters of the output modules
VtkPrimaryVarsModule<TypeTag>::registerParameters();
Parameters::registerParam<TypeTag, Properties::EnableGridAdaptation>
Parameters::registerParam<TypeTag, Parameters::EnableGridAdaptation>
("Enable adaptive grid refinement/coarsening");
Parameters::registerParam<TypeTag, Properties::EnableVtkOutput>
Parameters::registerParam<TypeTag, Parameters::EnableVtkOutput>
("Global switch for turning on writing VTK files");
Parameters::registerParam<TypeTag, Properties::EnableThermodynamicHints>
Parameters::registerParam<TypeTag, Parameters::EnableThermodynamicHints>
("Enable thermodynamic hints");
Parameters::registerParam<TypeTag, Properties::EnableIntensiveQuantityCache>
Parameters::registerParam<TypeTag, Parameters::EnableIntensiveQuantityCache>
("Turn on caching of intensive quantities");
Parameters::registerParam<TypeTag, Properties::EnableStorageCache>
Parameters::registerParam<TypeTag, Parameters::EnableStorageCache>
("Store previous storage terms and avoid re-calculating them.");
Parameters::registerParam<TypeTag, Properties::OutputDir>
Parameters::registerParam<TypeTag, Parameters::OutputDir>
("The directory to which result files are written");
}

View File

@ -30,11 +30,13 @@
#include "fvbaseproperties.hh"
#include <opm/models/discretization/common/linearizationtype.hh>
#include <opm/models/utils/alignedallocator.hh>
#include <dune/common/fvector.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/linearizationtype.hh>
#include <opm/models/utils/alignedallocator.hh>
#include <vector>
namespace Opm {
@ -95,7 +97,7 @@ public:
{
// remember the simulator object
simulatorPtr_ = &simulator;
enableStorageCache_ = Parameters::get<TypeTag, Properties::EnableStorageCache>();
enableStorageCache_ = Parameters::get<TypeTag, Parameters::EnableStorageCache>();
stashedDofIdx_ = -1;
focusDofIdx_ = -1;
}

View File

@ -0,0 +1,141 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
* \ingroup FiniteVolumeDiscretizations
*
* \brief Declare the properties used by the infrastructure code of
* the finite volume discretizations.
*/
#ifndef EWOMS_FV_BASE_PARAMETERS_HH
#define EWOMS_FV_BASE_PARAMETERS_HH
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters {
template<class TypeTag, class MyTypeTag>
struct ThreadsPerProcess { using type = Properties::UndefinedProperty; };
/*!
* \brief Switch to enable or disable grid adaptation
*
* Currently grid adaptation requires the presence of the dune-FEM module. If it is not
* available and grid adaptation is enabled, an exception is thrown.
*/
template<class TypeTag, class MyTypeTag>
struct EnableGridAdaptation { using type = Properties::UndefinedProperty; };
/*!
* \brief The directory to which simulation output ought to be written to.
*/
template<class TypeTag, class MyTypeTag>
struct OutputDir { using type = Properties::UndefinedProperty; };
/*!
* \brief Global switch to enable or disable the writing of VTK output files
*
* If writing VTK files is disabled, then the WriteVtk$FOO options do
* not have any effect...
*/
template<class TypeTag, class MyTypeTag>
struct EnableVtkOutput { using type = Properties::UndefinedProperty; };
/*!
* \brief Determines if the VTK output is written to disk asynchronously
*
* I.e. written to disk using a separate thread. This has only an effect if
* EnableVtkOutput is true and if the simulation is run sequentially. The reasons for
* this not being used for MPI-parallel simulations are that Dune's VTK output code does
* not support multi-threaded multi-process VTK output and even if it would, the result
* would be slower than when using synchronous output.
*/
template<class TypeTag, class MyTypeTag>
struct EnableAsyncVtkOutput { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify the maximum size of a time integration [s].
*
* The default is to not limit the step size.
*/
template<class TypeTag, class MyTypeTag>
struct MaxTimeStepSize { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify the minimal size of a time integration [s].
*
* The default is to not limit the step size.
*/
template<class TypeTag, class MyTypeTag>
struct MinTimeStepSize { using type = Properties::UndefinedProperty; };
/*!
* \brief The maximum allowed number of timestep divisions for the
* Newton solver.
*/
template<class TypeTag, class MyTypeTag>
struct MaxTimeStepDivisions { using type = Properties::UndefinedProperty; };
/*!
* \brief Continue with a non-converged solution instead of giving up
* if we encounter a time step size smaller than the minimum time
* step size.
*/
template<class TypeTag, class MyTypeTag>
struct ContinueOnConvergenceError { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify whether all intensive quantities for the grid should be
* cached in the discretization.
*
* This potentially reduces the CPU time, but comes at the cost of
* higher memory consumption. In turn, the higher memory requirements
* may cause the simulation to exhibit worse cache coherence behavior
* which eats some of the computational benefits again.
*/
template<class TypeTag, class MyTypeTag>
struct EnableIntensiveQuantityCache { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify whether the storage terms for previous solutions should be cached.
*
* This potentially reduces the CPU time, but comes at the cost of higher memory
* consumption.
*/
template<class TypeTag, class MyTypeTag>
struct EnableStorageCache { using type = Properties::UndefinedProperty; };
/*!
* \brief Specify whether to use the already calculated solutions as
* starting values of the intensive quantities.
*
* This only makes sense if the calculation of the intensive quantities is
* very expensive (e.g. for non-linear fugacity functions where the
* solver converges faster).
*/
template<class TypeTag, class MyTypeTag>
struct EnableThermodynamicHints { using type = Properties::UndefinedProperty; };
} // namespace Opm::Parameters
#endif

View File

@ -28,7 +28,8 @@
#ifndef EWOMS_FV_BASE_PROBLEM_HH
#define EWOMS_FV_BASE_PROBLEM_HH
#include "fvbaseproperties.hh"
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/io/vtkmultiwriter.hh>
#include <opm/models/io/restart.hh>
@ -141,12 +142,12 @@ public:
if (enableVtkOutput_()) {
bool asyncVtkOutput =
simulator_.gridView().comm().size() == 1 &&
Parameters::get<TypeTag, Properties::EnableAsyncVtkOutput>();
Parameters::get<TypeTag, Parameters::EnableAsyncVtkOutput>();
// asynchonous VTK output currently does not work in conjunction with grid
// adaptivity because the async-IO code assumes that the grid stays
// constant. complain about that case.
bool enableGridAdaptation = Parameters::get<TypeTag, Properties::EnableGridAdaptation>();
bool enableGridAdaptation = Parameters::get<TypeTag, Parameters::EnableGridAdaptation>();
if (asyncVtkOutput && enableGridAdaptation)
throw std::runtime_error("Asynchronous VTK output currently cannot be used "
"at the same time as grid adaptivity");
@ -168,16 +169,16 @@ public:
static void registerParameters()
{
Model::registerParameters();
Parameters::registerParam<TypeTag, Properties::MaxTimeStepSize>
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepSize>
("The maximum size to which all time steps are limited to [s]");
Parameters::registerParam<TypeTag, Properties::MinTimeStepSize>
Parameters::registerParam<TypeTag, Parameters::MinTimeStepSize>
("The minimum size to which all time steps are limited to [s]");
Parameters::registerParam<TypeTag, Properties::MaxTimeStepDivisions>
Parameters::registerParam<TypeTag, Parameters::MaxTimeStepDivisions>
("The maximum number of divisions by two of the timestep size "
"before the simulation bails out");
Parameters::registerParam<TypeTag, Properties::EnableAsyncVtkOutput>
Parameters::registerParam<TypeTag, Parameters::EnableAsyncVtkOutput>
("Dispatch a separate thread to write the VTK output");
Parameters::registerParam<TypeTag, Properties::ContinueOnConvergenceError>
Parameters::registerParam<TypeTag, Parameters::ContinueOnConvergenceError>
("Continue with a non-converged solution instead of giving up "
"if we encounter a time step size smaller than the minimum time "
"step size.");
@ -203,7 +204,7 @@ public:
*/
std::string outputDir() const
{
std::string outputDir = Parameters::get<TypeTag, Properties::OutputDir>();
std::string outputDir = Parameters::get<TypeTag, Parameters::OutputDir>();
if (outputDir.empty())
outputDir = ".";
@ -559,14 +560,14 @@ public:
* \brief Returns the minimum allowable size of a time step.
*/
Scalar minTimeStepSize() const
{ return Parameters::get<TypeTag, Properties::MinTimeStepSize>(); }
{ return Parameters::get<TypeTag, Parameters::MinTimeStepSize>(); }
/*!
* \brief Returns the maximum number of subsequent failures for the time integration
* before giving up.
*/
unsigned maxTimeIntegrationFailures() const
{ return Parameters::get<TypeTag, Properties::MaxTimeStepDivisions>(); }
{ return Parameters::get<TypeTag, Parameters::MaxTimeStepDivisions>(); }
/*!
* \brief Returns if we should continue with a non-converged solution instead of
@ -574,7 +575,7 @@ public:
* step size.
*/
bool continueOnConvergenceError() const
{ return Parameters::get<TypeTag, Properties::ContinueOnConvergenceError>(); }
{ return Parameters::get<TypeTag, Parameters::ContinueOnConvergenceError>(); }
/*!
* \brief Impose the next time step size to be used externally.
@ -592,7 +593,7 @@ public:
if (nextTimeStepSize_ > 0.0)
return nextTimeStepSize_;
Scalar dtNext = std::min(Parameters::get<TypeTag, Properties::MaxTimeStepSize>(),
Scalar dtNext = std::min(Parameters::get<TypeTag, Parameters::MaxTimeStepSize>(),
newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
if (dtNext < simulator().maxTimeStepSize()
@ -811,7 +812,7 @@ protected:
private:
bool enableVtkOutput_() const
{ return Parameters::get<TypeTag, Properties::EnableVtkOutput>(); }
{ return Parameters::get<TypeTag, Parameters::EnableVtkOutput>(); }
//! Returns the implementation of the problem (i.e. static polymorphism)
Implementation& asImp_()

View File

@ -31,7 +31,6 @@
#define EWOMS_FV_BASE_PROPERTIES_HH
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/io/dgfvanguard.hh>
namespace Opm::Properties {
@ -51,25 +50,10 @@ struct FvBaseDiscretization
} // namespace TTag
//! set the splices for the finite volume discretizations
template<class TypeTag, class MyTypeTag>
struct LinearSolverSplice { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LocalLinearizerSplice { using type = UndefinedProperty; };
template<class TypeTag>
struct Splices<TypeTag, TTag::FvBaseDiscretization>
{
using type = std::tuple<GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LinearSolverSplice>,
GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LocalLinearizerSplice>>;
};
//! use a parallel BiCGStab linear solver by default
template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::FvBaseDiscretization> { using type = TTag::ParallelBiCGStabLinearSolver; };
//! by default, use finite differences to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::FvBaseDiscretization> { using type = TTag::FiniteDifferenceLocalLinearizer; };
/*!
* \brief Representation of a function evaluation and all necessary derivatives with
@ -189,8 +173,6 @@ struct GridCommHandleFactory { using type = UndefinedProperty; };
*/
template<class TypeTag, class MyTypeTag>
struct ThreadManager { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct ThreadsPerProcess { using type = UndefinedProperty; };
//! use locking to prevent race conditions when linearizing the global system of
//! equations in multi-threaded mode. (setting this property to true is always save, but
@ -201,42 +183,6 @@ struct UseLinearizationLock { using type = UndefinedProperty; };
// high-level simulation control
/*!
* \brief Switch to enable or disable grid adaptation
*
* Currently grid adaptation requires the presence of the dune-FEM module. If it is not
* available and grid adaptation is enabled, an exception is thrown.
*/
template<class TypeTag, class MyTypeTag>
struct EnableGridAdaptation { using type = UndefinedProperty; };
/*!
* \brief The directory to which simulation output ought to be written to.
*/
template<class TypeTag, class MyTypeTag>
struct OutputDir { using type = UndefinedProperty; };
/*!
* \brief Global switch to enable or disable the writing of VTK output files
*
* If writing VTK files is disabled, then the WriteVtk$FOO options do
* not have any effect...
*/
template<class TypeTag, class MyTypeTag>
struct EnableVtkOutput { using type = UndefinedProperty; };
/*!
* \brief Determines if the VTK output is written to disk asynchronously
*
* I.e. written to disk using a separate thread. This has only an effect if
* EnableVtkOutput is true and if the simulation is run sequentially. The reasons for
* this not being used for MPI-parallel simulations are that Dune's VTK output code does
* not support multi-threaded multi-process VTK output and even if it would, the result
* would be slower than when using synchronous output.
*/
template<class TypeTag, class MyTypeTag>
struct EnableAsyncVtkOutput { using type = UndefinedProperty; };
/*!
* \brief Specify the format the VTK output is written to disk
*
@ -253,69 +199,6 @@ struct VtkOutputFormat { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct EnableConstraints { using type = UndefinedProperty; };
/*!
* \brief Specify the maximum size of a time integration [s].
*
* The default is to not limit the step size.
*/
template<class TypeTag, class MyTypeTag>
struct MaxTimeStepSize { using type = UndefinedProperty; };
/*!
* \brief Specify the minimal size of a time integration [s].
*
* The default is to not limit the step size.
*/
template<class TypeTag, class MyTypeTag>
struct MinTimeStepSize { using type = UndefinedProperty; };
/*!
* \brief The maximum allowed number of timestep divisions for the
* Newton solver.
*/
template<class TypeTag, class MyTypeTag>
struct MaxTimeStepDivisions { using type = UndefinedProperty; };
/*!
* \brief Continue with a non-converged solution instead of giving up
* if we encounter a time step size smaller than the minimum time
* step size.
*/
template<class TypeTag, class MyTypeTag>
struct ContinueOnConvergenceError { using type = UndefinedProperty; };
/*!
* \brief Specify whether all intensive quantities for the grid should be
* cached in the discretization.
*
* This potentially reduces the CPU time, but comes at the cost of
* higher memory consumption. In turn, the higher memory requirements
* may cause the simulation to exhibit worse cache coherence behavior
* which eats some of the computational benefits again.
*/
template<class TypeTag, class MyTypeTag>
struct EnableIntensiveQuantityCache { using type = UndefinedProperty; };
/*!
* \brief Specify whether the storage terms for previous solutions should be cached.
*
* This potentially reduces the CPU time, but comes at the cost of higher memory
* consumption.
*/
template<class TypeTag, class MyTypeTag>
struct EnableStorageCache { using type = UndefinedProperty; };
/*!
* \brief Specify whether to use the already calculated solutions as
* starting values of the intensive quantities.
*
* This only makes sense if the calculation of the intensive quantities is
* very expensive (e.g. for non-linear fugacity functions where the
* solver converges faster).
*/
template<class TypeTag, class MyTypeTag>
struct EnableThermodynamicHints { using type = UndefinedProperty; };
// mappers from local to global DOF indices
/*!
@ -354,13 +237,29 @@ struct ExtensiveStorageTerm { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct UseVolumetricResidual { using type = UndefinedProperty; };
//! Specify if experimental features should be enabled or not.
template<class TypeTag, class MyTypeTag>
struct EnableExperiments { using type = UndefinedProperty; };
// Set defaults
//! set the splices for the finite volume discretizations
template<class TypeTag>
struct Vanguard<TypeTag, TTag::NumericModel> { using type = Opm::DgfVanguard<TypeTag>; };
struct Splices<TypeTag, TTag::FvBaseDiscretization>
{
using type = std::tuple<GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LinearSolverSplice>,
GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LocalLinearizerSplice>>;
};
//! use a parallel BiCGStab linear solver by default
template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::FvBaseDiscretization>
{ using type = TTag::ParallelBiCGStabLinearSolver; };
//! by default, use finite differences to linearize the system of PDEs
template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::FvBaseDiscretization>
{ using type = TTag::FiniteDifferenceLocalLinearizer; };
} // namespace Opm::Properties

View File

@ -112,17 +112,6 @@ struct ExtensiveQuantities<TypeTag, TTag::FlashModel> { using type = Opm::FlashE
template<class TypeTag>
struct Indices<TypeTag, TTag::FlashModel> { using type = Opm::FlashIndices<TypeTag, /*PVIdx=*/0>; };
// The updates of intensive quantities tend to be _very_ expensive for this
// model, so let's try to minimize the number of required ones
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::FlashModel> { static constexpr bool value = true; };
// since thermodynamic hints are basically free if the cache for intensive quantities is
// enabled, and this model usually shows quite a performance improvment if they are
// enabled, let's enable them by default.
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, TTag::FlashModel> { static constexpr bool value = true; };
// disable molecular diffusion by default
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlashModel> { static constexpr bool value = false; };
@ -133,6 +122,23 @@ struct EnableEnergy<TypeTag, TTag::FlashModel> { static constexpr bool value = f
} // namespace Opm::Properties
namespace Opm::Parameters {
// The updates of intensive quantities tend to be _very_ expensive for this
// model, so let's try to minimize the number of required ones
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::FlashModel>
{ static constexpr bool value = true; };
// since thermodynamic hints are basically free if the cache for intensive quantities is
// enabled, and this model usually shows quite a performance improvment if they are
// enabled, let's enable them by default.
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, Properties::TTag::FlashModel>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm {
/*!

View File

@ -28,6 +28,7 @@
#define EWOMS_CUBE_GRID_VANGUARD_HH
#include <opm/models/io/basevanguard.hh>
#include <opm/models/utils/basicparameters.hh>
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
@ -66,7 +67,7 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::DomainSizeX>
@ -111,7 +112,7 @@ public:
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
}
unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
unsigned numRefinements = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
cubeGrid_->globalRefine(static_cast<int>(numRefinements));

View File

@ -64,7 +64,7 @@ public:
{
Parameters::registerParam<TypeTag,Properties::GridFile>
("The file name of the DGF file to load");
Parameters::registerParam<TypeTag,Properties::GridGlobalRefinements>
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
}
@ -76,7 +76,7 @@ public:
: ParentType(simulator)
{
const std::string dgfFileName = Parameters::get<TypeTag, Properties::GridFile>();
unsigned numRefinments = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
unsigned numRefinments = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
{
// create DGF GridPtr from a dgf file

View File

@ -28,8 +28,11 @@
#define EWOMS_STRUCTURED_GRID_VANGUARD_HH
#include <opm/models/io/basevanguard.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/basicparameters.hh>
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
@ -42,7 +45,6 @@
#include <dune/common/fvector.hh>
#include <dune/common/version.hh>
#include <vector>
#include <memory>
namespace Opm {
@ -106,7 +108,7 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
Parameters::registerParam<TypeTag, Parameters::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::DomainSizeX>
@ -165,7 +167,7 @@ public:
// use DGF parser to create a grid from interval block
gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
unsigned numRefinements = Parameters::get<TypeTag, Parameters::GridGlobalRefinements>();
gridPtr_->globalRefine(static_cast<int>(numRefinements));
this->finalizeInit_();

View File

@ -27,19 +27,19 @@
#ifndef EWOMS_VTK_BLACK_OIL_ENERGY_MODULE_HH
#define EWOMS_VTK_BLACK_OIL_ENERGY_MODULE_HH
#include <opm/material/densead/Math.hpp>
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <dune/common/fvector.hh>
#include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
namespace Opm::Properties {
namespace TTag {
@ -130,7 +130,7 @@ public:
*/
void allocBuffers()
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableEnergy)
@ -152,7 +152,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableEnergy)

View File

@ -27,19 +27,19 @@
#ifndef EWOMS_VTK_BLACK_OIL_MICP_MODULE_HH
#define EWOMS_VTK_BLACK_OIL_MICP_MODULE_HH
#include <opm/material/densead/Math.hpp>
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <dune/common/fvector.hh>
#include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
namespace Opm::Properties {
namespace TTag {
@ -134,7 +134,7 @@ public:
*/
void allocBuffers()
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableMICP)
@ -158,7 +158,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableMICP)

View File

@ -27,18 +27,19 @@
#ifndef EWOMS_VTK_BLACK_OIL_MODULE_HH
#define EWOMS_VTK_BLACK_OIL_MODULE_HH
#include <opm/material/densead/Math.hpp>
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
#include <opm/material/densead/Math.hpp>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Properties {
@ -216,7 +217,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) {
@ -424,9 +425,8 @@ private:
ScalarBuffer primaryVarsMeaningPressure_;
ScalarBuffer primaryVarsMeaningWater_;
ScalarBuffer primaryVarsMeaningGas_;
};
} // namespace Opm
#endif

View File

@ -27,19 +27,19 @@
#ifndef EWOMS_VTK_BLACK_OIL_POLYMER_MODULE_HH
#define EWOMS_VTK_BLACK_OIL_POLYMER_MODULE_HH
#include <opm/material/densead/Math.hpp>
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <dune/common/fvector.hh>
#include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
namespace Opm::Properties {
namespace TTag {
@ -143,7 +143,7 @@ public:
*/
void allocBuffers()
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enablePolymer)
@ -169,7 +169,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enablePolymer)

View File

@ -27,19 +27,19 @@
#ifndef EWOMS_VTK_BLACK_OIL_SOLVENT_MODULE_HH
#define EWOMS_VTK_BLACK_OIL_SOLVENT_MODULE_HH
#include <opm/material/densead/Math.hpp>
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <dune/common/fvector.hh>
#include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/blackoil/blackoilproperties.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
namespace Opm::Properties {
namespace TTag {
@ -136,7 +136,7 @@ public:
*/
void allocBuffers()
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableSolvent)
@ -160,7 +160,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
if (!enableSolvent)

View File

@ -30,11 +30,13 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/material/common/MathToolbox.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/material/common/MathToolbox.hpp>
namespace Opm::Properties {
namespace TTag {
@ -170,7 +172,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -31,12 +31,14 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/material/densead/Evaluation.hpp>
#include <opm/material/densead/Math.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
namespace Opm::Properties {
namespace TTag {
@ -138,7 +140,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -30,15 +30,16 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <dune/common/fvector.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/material/common/Valgrind.hpp>
#include <dune/common/fvector.hh>
#include <cstdio>
#include <string_view>
namespace Opm::Properties {
@ -190,7 +191,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
const auto& fractureMapper = elemCtx.simulator().vanguard().fractureMapper();

View File

@ -30,6 +30,8 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
@ -148,7 +150,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -30,16 +30,17 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <dune/common/fvector.hh>
#include <cstdio>
#include <string_view>
namespace Opm::Properties {
@ -238,7 +239,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
const auto& problem = elemCtx.problem();

View File

@ -30,6 +30,8 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
@ -103,7 +105,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -27,6 +27,8 @@
#ifndef EWOMS_VTK_PRIMARY_VARS_MODULE_HH
#define EWOMS_VTK_PRIMARY_VARS_MODULE_HH
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/io/baseoutputmodule.hh>
#include <opm/models/io/vtkmultiwriter.hh>
@ -122,7 +124,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
const auto& elementMapper = elemCtx.model().elementMapper();

View File

@ -30,11 +30,13 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/material/common/MathToolbox.hpp>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/material/common/MathToolbox.hpp>
namespace Opm::Properties {
namespace TTag {
@ -125,7 +127,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -30,6 +30,8 @@
#include "vtkmultiwriter.hh"
#include "baseoutputmodule.hh"
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
@ -109,7 +111,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
if (!Parameters::get<TypeTag, Parameters::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {

View File

@ -31,7 +31,7 @@
#include <omp.h>
#endif
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
@ -60,7 +60,7 @@ public:
*/
static void registerParameters()
{
Parameters::registerParam<TypeTag, Properties::ThreadsPerProcess>
Parameters::registerParam<TypeTag, Parameters::ThreadsPerProcess>
("The maximum number of threads to be instantiated per process "
"('-1' means 'automatic')");
}
@ -78,7 +78,7 @@ public:
{
if (queryCommandLineParameter)
{
numThreads_ = Parameters::get<TypeTag, Properties::ThreadsPerProcess>();
numThreads_ = Parameters::get<TypeTag, Parameters::ThreadsPerProcess>();
// some safety checks. This is pretty ugly macro-magic, but so what?
#if !defined(_OPENMP)

View File

@ -127,17 +127,6 @@ struct ExtensiveQuantities<TypeTag, TTag::FlashModel> { using type = Opm::FlashE
template<class TypeTag>
struct Indices<TypeTag, TTag::FlashModel> { using type = Opm::FlashIndices<TypeTag, /*PVIdx=*/0>; };
// The updates of intensive quantities tend to be _very_ expensive for this
// model, so let's try to minimize the number of required ones
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::FlashModel> { static constexpr bool value = true; };
// since thermodynamic hints are basically free if the cache for intensive quantities is
// enabled, and this model usually shows quite a performance improvment if they are
// enabled, let's enable them by default.
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, TTag::FlashModel> { static constexpr bool value = true; };
// disable molecular diffusion by default
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlashModel> { static constexpr bool value = false; };
@ -148,6 +137,23 @@ struct EnableEnergy<TypeTag, TTag::FlashModel> { static constexpr bool value = f
} // namespace Opm::Properties
namespace Opm::Parameters {
// The updates of intensive quantities tend to be _very_ expensive for this
// model, so let's try to minimize the number of required ones
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, Properties::TTag::FlashModel>
{ static constexpr bool value = true; };
// since thermodynamic hints are basically free if the cache for intensive quantities is
// enabled, and this model usually shows quite a performance improvment if they are
// enabled, let's enable them by default.
template<class TypeTag>
struct EnableThermodynamicHints<TypeTag, Properties::TTag::FlashModel>
{ static constexpr bool value = true; };
} // namespace Opm::Parameters
namespace Opm {
/*!

View File

@ -0,0 +1,47 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
*
* \brief Defines some fundamental parameters for all models.
*/
#ifndef EWOMS_BASIC_PARAMETERS_HH
#define EWOMS_BASIC_PARAMETERS_HH
#include <opm/models/utils/propertysystem.hh>
namespace Opm::Parameters {
//! Property which tells the Vanguard how often the grid should be refined
//! after creation.
template<class TypeTag, class MyTypeTag>
struct GridGlobalRefinements { using type = Properties::UndefinedProperty; };
//! Property provides the name of the file from which the additional runtime
//! parameters should to be loaded from
template<class TypeTag, class MyTypeTag>
struct ParameterFile { using type = Properties::UndefinedProperty; };
} // namespace Opm:Parameters
#endif

View File

@ -30,14 +30,19 @@
#include <dune/common/parametertree.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/basicparameters.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
#if HAVE_DUNE_FEM
#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#endif
#include <string>
namespace Opm {
template<class TypeTag> class DgfVanguard;
}
namespace Opm::Properties {
@ -100,16 +105,6 @@ template<class TypeTag, class MyTypeTag>
struct GridPart { using type = UndefinedProperty; };
#endif
//! Property which tells the Vanguard how often the grid should be refined
//! after creation.
template<class TypeTag, class MyTypeTag>
struct GridGlobalRefinements { using type = UndefinedProperty; };
//! Property provides the name of the file from which the additional runtime
//! parameters should to be loaded from
template<class TypeTag, class MyTypeTag>
struct ParameterFile { using type = UndefinedProperty; };
/*!
* \brief Print all properties on startup?
*
@ -229,15 +224,6 @@ template<class TypeTag>
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
#endif
//! Set a value for the ParameterFile property
template<class TypeTag>
struct ParameterFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
//! Set the number of refinement levels of the grid to 0. This does not belong
//! here, strictly speaking.
template<class TypeTag>
struct GridGlobalRefinements<TypeTag, TTag::NumericModel> { static constexpr unsigned value = 0; };
//! By default, print the properties on startup
template<class TypeTag>
struct PrintProperties<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
@ -274,7 +260,24 @@ struct RestartTime<TypeTag, TTag::NumericModel>
template<class TypeTag>
struct PredeterminedTimeStepsFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
template<class TypeTag>
struct Vanguard<TypeTag, TTag::NumericModel> { using type = Opm::DgfVanguard<TypeTag>; };
} // namespace Opm::Properties
namespace Opm::Parameters {
//! Set the number of refinement levels of the grid to 0. This does not belong
//! here, strictly speaking.
template<class TypeTag>
struct GridGlobalRefinements<TypeTag, Properties::TTag::NumericModel>
{ static constexpr unsigned value = 0; };
//! Set a value for the ParameterFile property
template<class TypeTag>
struct ParameterFile<TypeTag, Properties::TTag::NumericModel>
{ static constexpr auto value = ""; };
}
#endif

View File

@ -78,7 +78,7 @@ static inline void registerAllParameters_(bool finalizeRegistration = true)
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>;
Parameters::registerParam<TypeTag, Properties::ParameterFile>
Parameters::registerParam<TypeTag, Parameters::ParameterFile>
("An .ini file which contains a set of run-time parameters");
Parameters::registerParam<TypeTag, Properties::PrintProperties>
("Print the values of the compile time properties at "
@ -150,7 +150,7 @@ static inline int setupParameters_(int argc,
return status;
}
const std::string paramFileName = Parameters::get<TypeTag, Properties::ParameterFile>(false);
const std::string paramFileName = Parameters::get<TypeTag, Parameters::ParameterFile>(false);
if (!paramFileName.empty()) {
////////////////////////////////////////////////////////////
// add the parameters specified using an .ini file