[properties] replace macro calls by native C++

This commit is contained in:
Bernd Flemisch 2020-06-08 16:41:02 +02:00
parent 2e13e846ff
commit 880c5223ac
201 changed files with 3253 additions and 2436 deletions

View File

@ -40,7 +40,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionFlashEcfvProblem, INHERITS_FROM(FlashModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionFlashEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionFlashEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
// use automatic differentiation for this simulator
@ -49,14 +52,15 @@ SET_TAG_PROP(Co2InjectionFlashEcfvProblem, LocalLinearizerSplice, AutoDiffLocalL
// use the flash solver adapted to the CO2 injection problem
SET_TYPE_PROP(
Co2InjectionFlashEcfvProblem, FlashSolver,
Opm::Co2InjectionFlash<typename GET_PROP_TYPE(TypeTag, Scalar),
typename GET_PROP_TYPE(TypeTag, FluidSystem)>);
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>);
// the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it,
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
SET_TYPE_PROP(Co2InjectionFlashEcfvProblem, Scalar, quad);
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = quad; };
// the default linear solver used for this problem (-> AMG) cannot be used with quadruple
// precision scalars... (this seems to only apply to Dune >= 2.4)
@ -69,6 +73,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionFlashEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionFlashEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -37,10 +37,14 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionFlashNiEcfvProblem, INHERITS_FROM(FlashModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionFlashNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionFlashNiEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
SET_BOOL_PROP(Co2InjectionFlashNiEcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
SET_TAG_PROP(Co2InjectionFlashNiEcfvProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
@ -48,14 +52,15 @@ SET_TAG_PROP(Co2InjectionFlashNiEcfvProblem, LocalLinearizerSplice, AutoDiffLoca
// use the CO2 injection problem adapted flash solver
SET_TYPE_PROP(
Co2InjectionFlashNiEcfvProblem, FlashSolver,
Opm::Co2InjectionFlash<typename GET_PROP_TYPE(TypeTag, Scalar),
typename GET_PROP_TYPE(TypeTag, FluidSystem)>);
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>);
// the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it,
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
SET_TYPE_PROP(Co2InjectionFlashNiEcfvProblem, Scalar, quad);
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = quad; };
// the default linear solver used for this problem (-> AMG) cannot be used with quadruple
// precision scalars... (this seems to only apply to Dune >= 2.4)
@ -68,6 +73,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionFlashNiEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionFlashNiEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -37,22 +37,27 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionFlashNiVcfvProblem, INHERITS_FROM(FlashModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionFlashNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionFlashNiVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
SET_BOOL_PROP(Co2InjectionFlashNiVcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { static constexpr bool value = true; };
// use the CO2 injection problem adapted flash solver
SET_TYPE_PROP(
Co2InjectionFlashNiVcfvProblem, FlashSolver,
Opm::Co2InjectionFlash<typename GET_PROP_TYPE(TypeTag, Scalar),
typename GET_PROP_TYPE(TypeTag, FluidSystem)>);
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>);
// the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it,
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
SET_TYPE_PROP(Co2InjectionFlashNiVcfvProblem, Scalar, quad);
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { using type = quad; };
// the default linear solver used for this problem (-> AMG) cannot be used with quadruple
// precision scalars... (this seems to only apply to Dune >= 2.4)
@ -65,6 +70,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionFlashNiVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionFlashNiVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -40,20 +40,24 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionFlashVcfvProblem, INHERITS_FROM(FlashModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionFlashVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, FlashModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionFlashVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
// use the flash solver adapted to the CO2 injection problem
SET_TYPE_PROP(
Co2InjectionFlashVcfvProblem, FlashSolver,
Opm::Co2InjectionFlash<typename GET_PROP_TYPE(TypeTag, Scalar),
typename GET_PROP_TYPE(TypeTag, FluidSystem)>);
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>);
// the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it,
// else we increase the tolerance of the Newton solver
#if HAVE_QUAD
SET_TYPE_PROP(Co2InjectionFlashVcfvProblem, Scalar, quad);
template<class TypeTag>
struct Scalar<TypeTag, TTag::Co2InjectionFlashVcfvProblem> { using type = quad; };
// the default linear solver used for this problem (-> AMG) cannot be used with quadruple
// precision scalars... (this seems to only apply to Dune >= 2.4)
@ -66,6 +70,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionFlashVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionFlashVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -49,6 +49,6 @@ END_PROPERTIES
////////////////////////
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionImmiscibleEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionImmiscibleEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -40,7 +40,8 @@ NEW_TYPE_TAG(Co2InjectionImmiscibleNiEcfvProblem, INHERITS_FROM(ImmiscibleModel,
SET_TAG_PROP(Co2InjectionImmiscibleNiEcfvProblem, SpatialDiscretizationSplice,
EcfvDiscretization);
SET_BOOL_PROP(Co2InjectionImmiscibleNiEcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem> { static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
SET_TAG_PROP(Co2InjectionImmiscibleNiEcfvProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
@ -52,6 +53,6 @@ END_PROPERTIES
////////////////////////
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionImmiscibleNiEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionImmiscibleNiEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -39,7 +39,8 @@ NEW_TYPE_TAG(Co2InjectionImmiscibleNiVcfvProblem, INHERITS_FROM(ImmiscibleModel,
Co2InjectionBaseProblem));
SET_TAG_PROP(Co2InjectionImmiscibleNiVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
SET_BOOL_PROP(Co2InjectionImmiscibleNiVcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem> { static constexpr bool value = true; };
END_PROPERTIES
@ -48,6 +49,6 @@ END_PROPERTIES
////////////////////////
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionImmiscibleNiVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionImmiscibleNiVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -47,6 +47,6 @@ END_PROPERTIES
////////////////////////
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionImmiscibleVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionImmiscibleVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,13 +35,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionNcpEcfvProblem, INHERITS_FROM(NcpModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionNcpEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionNcpEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionNcpEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionNcpEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,9 +35,13 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionNcpNiEcfvProblem, INHERITS_FROM(NcpModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionNcpNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionNcpNiEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
SET_BOOL_PROP(Co2InjectionNcpNiEcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiEcfvProblem> { static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
SET_TAG_PROP(Co2InjectionNcpNiEcfvProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
@ -46,6 +50,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionNcpNiEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionNcpNiEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,14 +35,18 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionNcpNiVcfvProblem, INHERITS_FROM(NcpModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionNcpNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionNcpNiVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
SET_BOOL_PROP(Co2InjectionNcpNiVcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionNcpNiVcfvProblem> { static constexpr bool value = true; };
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionNcpNiVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionNcpNiVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -36,13 +36,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionNcpVcfvProblem, INHERITS_FROM(NcpModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionNcpVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, NcpModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionNcpVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionNcpVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionNcpVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,13 +35,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionPvsEcfvProblem, INHERITS_FROM(PvsModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionPvsEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionPvsEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionPvsEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionPvsEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,10 +35,14 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionPvsNiEcfvProblem, INHERITS_FROM(PvsModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionPvsNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionPvsNiEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
SET_BOOL_PROP(Co2InjectionPvsNiEcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiEcfvProblem> { static constexpr bool value = true; };
//! Use automatic differentiation to linearize the system of PDEs
SET_TAG_PROP(Co2InjectionPvsNiEcfvProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
@ -47,6 +51,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionPvsNiEcfvProblem) EcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionPvsNiEcfvProblem EcfvProblemTypeTag;
return Opm::start<EcfvProblemTypeTag>(argc, argv);
}

View File

@ -35,15 +35,19 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionPvsNiVcfvProblem, INHERITS_FROM(PvsModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionPvsNiVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionPvsNiVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
SET_BOOL_PROP(Co2InjectionPvsNiVcfvProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionPvsNiVcfvProblem> { static constexpr bool value = true; };
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionPvsNiVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionPvsNiVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -36,13 +36,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionPvsVcfvProblem, INHERITS_FROM(PvsModel, Co2InjectionBaseProblem));
// Create new type tags
namespace TTag {
struct Co2InjectionPvsVcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, PvsModel>; };
} // end namespace TTag
SET_TAG_PROP(Co2InjectionPvsVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(Co2InjectionPvsVcfvProblem) VcfvProblemTypeTag;
typedef Opm::Properties::TTag::Co2InjectionPvsVcfvProblem VcfvProblemTypeTag;
return Opm::start<VcfvProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(CuvetteProblem, INHERITS_FROM(PvsModel, CuvetteBaseProblem));
// Create new type tags
namespace TTag {
struct CuvetteProblem { using InheritsFrom = std::tuple<CuvetteBaseProblem, PvsModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(CuvetteProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::CuvetteProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(DiffusionProblem, INHERITS_FROM(FlashModel, DiffusionBaseProblem));
// Create new type tags
namespace TTag {
struct DiffusionProblem { using InheritsFrom = std::tuple<DiffusionBaseProblem, FlashModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(DiffusionProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::DiffusionProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(DiffusionProblem, INHERITS_FROM(NcpModel, DiffusionBaseProblem));
// Create new type tags
namespace TTag {
struct DiffusionProblem { using InheritsFrom = std::tuple<DiffusionBaseProblem, NcpModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(DiffusionProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::DiffusionProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(DiffusionProblem, INHERITS_FROM(PvsModel, DiffusionBaseProblem));
// Create new type tags
namespace TTag {
struct DiffusionProblem { using InheritsFrom = std::tuple<DiffusionBaseProblem, PvsModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(DiffusionProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::DiffusionProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,13 +34,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(FingerProblemEcfv, INHERITS_FROM(ImmiscibleTwoPhaseModel, FingerBaseProblem));
// Create new type tags
namespace TTag {
struct FingerProblemEcfv { using InheritsFrom = std::tuple<FingerBaseProblem, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
SET_TAG_PROP(FingerProblemEcfv, SpatialDiscretizationSplice, EcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(FingerProblemEcfv) ProblemTypeTag;
typedef Opm::Properties::TTag::FingerProblemEcfv ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,13 +34,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(FingerProblemVcfv, INHERITS_FROM(ImmiscibleTwoPhaseModel, FingerBaseProblem));
// Create new type tags
namespace TTag {
struct FingerProblemVcfv { using InheritsFrom = std::tuple<FingerBaseProblem, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
SET_TAG_PROP(FingerProblemVcfv, SpatialDiscretizationSplice, VcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(FingerProblemVcfv) ProblemTypeTag;
typedef Opm::Properties::TTag::FingerProblemVcfv ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -32,6 +32,6 @@
int main(int argc, char **argv)
{
typedef TTAG(FractureProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::FractureProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(GroundWaterProblem, INHERITS_FROM(ImmiscibleSinglePhaseModel, GroundWaterBaseProblem));
// Create new type tags
namespace TTag {
struct GroundWaterProblem { using InheritsFrom = std::tuple<GroundWaterBaseProblem, ImmiscibleSinglePhaseModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(GroundWaterProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::GroundWaterProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,12 +33,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(InfiltrationProblem, INHERITS_FROM(PvsModel, InfiltrationBaseProblem));
// Create new type tags
namespace TTag {
struct InfiltrationProblem { using InheritsFrom = std::tuple<InfiltrationBaseProblem, PvsModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(InfiltrationProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::InfiltrationProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,6 +34,6 @@
int main(int argc, char **argv)
{
typedef TTAG(LensProblemEcfvAd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemEcfvAd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -35,7 +35,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(LensProblemEcfvAd, INHERITS_FROM(ImmiscibleTwoPhaseModel, LensBaseProblem));
// Create new type tags
namespace TTag {
struct LensProblemEcfvAd { using InheritsFrom = std::tuple<LensBaseProblem, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
// use the element centered finite volume spatial discretization
SET_TAG_PROP(LensProblemEcfvAd, SpatialDiscretizationSplice, EcfvDiscretization);
@ -44,7 +47,8 @@ SET_TAG_PROP(LensProblemEcfvAd, SpatialDiscretizationSplice, EcfvDiscretization)
SET_TAG_PROP(LensProblemEcfvAd, LocalLinearizerSplice, AutoDiffLocalLinearizer);
// this problem works fine if the linear solver uses single precision scalars
SET_TYPE_PROP(LensProblemEcfvAd, LinearSolverScalar, float);
template<class TypeTag>
struct LinearSolverScalar<TypeTag, TTag::LensProblemEcfvAd> { using type = float; };
END_PROPERTIES

View File

@ -36,7 +36,8 @@
BEGIN_PROPERTIES
// Use Dune-grid's GeometryGrid< YaspGrid >
SET_PROP(LensProblemEcfvAd, Grid )
template<class TypeTag>
struct Grid <TypeTag, TTag::LensProblemEcfvAd>
{
template< class ctype, unsigned int dim, unsigned int dimworld >
class IdentityCoordFct
@ -86,6 +87,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(LensProblemEcfvAd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemEcfvAd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -43,6 +43,6 @@ int mainCU1(int argc, char **argv);
int mainCU1(int argc, char **argv)
{
typedef TTAG(LensProblemEcfvAd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemEcfvAd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -43,6 +43,6 @@ int mainCU2(int argc, char **argv);
int mainCU2(int argc, char **argv)
{
typedef TTAG(LensProblemEcfvAd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemEcfvAd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,20 +34,24 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(LensProblemVcfvAd, INHERITS_FROM(ImmiscibleTwoPhaseModel, LensBaseProblem));
// Create new type tags
namespace TTag {
struct LensProblemVcfvAd { using InheritsFrom = std::tuple<LensBaseProblem, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
// use automatic differentiation for this simulator
SET_TAG_PROP(LensProblemVcfvAd, LocalLinearizerSplice, AutoDiffLocalLinearizer);
// use linear finite element gradients if dune-localfunctions is available
#if HAVE_DUNE_LOCALFUNCTIONS
SET_BOOL_PROP(LensProblemVcfvAd, UseP1FiniteElementGradients, true);
template<class TypeTag>
struct UseP1FiniteElementGradients<TypeTag, TTag::LensProblemVcfvAd> { static constexpr bool value = true; };
#endif
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(LensProblemVcfvAd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemVcfvAd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,20 +34,24 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(LensProblemVcfvFd, INHERITS_FROM(ImmiscibleTwoPhaseModel, LensBaseProblem));
// Create new type tags
namespace TTag {
struct LensProblemVcfvFd { using InheritsFrom = std::tuple<LensBaseProblem, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
// use the finite difference methodfor this simulator
SET_TAG_PROP(LensProblemVcfvFd, LocalLinearizerSplice, FiniteDifferenceLocalLinearizer);
// use linear finite element gradients if dune-localfunctions is available
#if HAVE_DUNE_LOCALFUNCTIONS
SET_BOOL_PROP(LensProblemVcfvFd, UseP1FiniteElementGradients, true);
template<class TypeTag>
struct UseP1FiniteElementGradients<TypeTag, TTag::LensProblemVcfvFd> { static constexpr bool value = true; };
#endif
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(LensProblemVcfvFd) ProblemTypeTag;
typedef Opm::Properties::TTag::LensProblemVcfvFd ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,7 +34,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(RichardsLensEcfvProblem, INHERITS_FROM(RichardsLensProblem));
// Create new type tags
namespace TTag {
struct RichardsLensEcfvProblem { using InheritsFrom = std::tuple<RichardsLensProblem>; };
} // end namespace TTag
SET_TAG_PROP(RichardsLensEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
//! Use automatic differentiation to linearize the system of PDEs
@ -44,6 +47,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(RichardsLensEcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::RichardsLensEcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,13 +34,16 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(RichardsLensVcfvProblem, INHERITS_FROM(RichardsLensProblem));
// Create new type tags
namespace TTag {
struct RichardsLensVcfvProblem { using InheritsFrom = std::tuple<RichardsLensProblem>; };
} // end namespace TTag
SET_TAG_PROP(RichardsLensVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(RichardsLensVcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::RichardsLensVcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,12 +34,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ObstacleProblem, INHERITS_FROM(ImmiscibleModel, ObstacleBaseProblem));
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, ImmiscibleModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ObstacleProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ObstacleProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,12 +34,15 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ObstacleProblem, INHERITS_FROM(NcpModel, ObstacleBaseProblem));
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, NcpModel>; };
} // end namespace TTag
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ObstacleProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ObstacleProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -35,15 +35,19 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ObstacleProblem, INHERITS_FROM(PvsModel, ObstacleBaseProblem));
// Create new type tags
namespace TTag {
struct ObstacleProblem { using InheritsFrom = std::tuple<ObstacleBaseProblem, PvsModel>; };
} // end namespace TTag
// Verbosity of the PVS model (0=silent, 1=medium, 2=chatty)
SET_INT_PROP(ObstacleProblem, PvsVerbosity, 1);
template<class TypeTag>
struct PvsVerbosity<TypeTag, TTag::ObstacleProblem> { static constexpr int value = 1; };
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ObstacleProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ObstacleProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -33,15 +33,19 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(OutflowProblem, INHERITS_FROM(PvsModel, OutflowBaseProblem));
// Create new type tags
namespace TTag {
struct OutflowProblem { using InheritsFrom = std::tuple<OutflowBaseProblem, PvsModel>; };
} // end namespace TTag
// Verbosity of the PVS model (0=silent, 1=medium, 2=chatty)
SET_INT_PROP(OutflowProblem, PvsVerbosity, 1);
template<class TypeTag>
struct PvsVerbosity<TypeTag, TTag::OutflowProblem> { static constexpr int value = 1; };
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(OutflowProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::OutflowProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -37,13 +37,14 @@ NEW_TYPE_TAG(PowerInjectionDarcyAdProblem,
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem));
SET_TYPE_PROP(PowerInjectionDarcyAdProblem, FluxModule, Opm::DarcyFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionDarcyAdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; };
SET_TAG_PROP(PowerInjectionDarcyAdProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(PowerInjectionDarcyAdProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::PowerInjectionDarcyAdProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -37,13 +37,14 @@ NEW_TYPE_TAG(PowerInjectionDarcyFdProblem,
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem));
SET_TYPE_PROP(PowerInjectionDarcyFdProblem, FluxModule, Opm::DarcyFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionDarcyFdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; };
SET_TAG_PROP(PowerInjectionDarcyFdProblem, LocalLinearizerSplice, FiniteDifferenceLocalLinearizer);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(PowerInjectionDarcyFdProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::PowerInjectionDarcyFdProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -37,13 +37,14 @@ NEW_TYPE_TAG(PowerInjectionForchheimerAdProblem,
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem));
SET_TYPE_PROP(PowerInjectionForchheimerAdProblem, FluxModule, Opm::ForchheimerFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerAdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; };
SET_TAG_PROP(PowerInjectionForchheimerAdProblem, LocalLinearizerSplice, AutoDiffLocalLinearizer);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(PowerInjectionForchheimerAdProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::PowerInjectionForchheimerAdProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -37,13 +37,14 @@ NEW_TYPE_TAG(PowerInjectionForchheimerFdProblem,
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem));
SET_TYPE_PROP(PowerInjectionForchheimerFdProblem, FluxModule, Opm::ForchheimerFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerFdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; };
SET_TAG_PROP(PowerInjectionForchheimerFdProblem, LocalLinearizerSplice, FiniteDifferenceLocalLinearizer);
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(PowerInjectionForchheimerFdProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::PowerInjectionForchheimerFdProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -73,29 +73,40 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(Co2InjectionBaseProblem);
// declare the CO2 injection problem specific property tags
NEW_PROP_TAG(FluidSystemPressureLow);
NEW_PROP_TAG(FluidSystemPressureHigh);
NEW_PROP_TAG(FluidSystemNumPressure);
NEW_PROP_TAG(FluidSystemTemperatureLow);
NEW_PROP_TAG(FluidSystemTemperatureHigh);
NEW_PROP_TAG(FluidSystemNumTemperature);
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureLow { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemPressureHigh { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumPressure { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureLow { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemTemperatureHigh { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct FluidSystemNumTemperature { using type = UndefinedProperty; };
NEW_PROP_TAG(MaxDepth);
NEW_PROP_TAG(Temperature);
NEW_PROP_TAG(SimulationName);
template<class TypeTag, class MyTypeTag>
struct MaxDepth { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct Temperature { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct SimulationName { using type = UndefinedProperty; };
// Set the grid type
SET_TYPE_PROP(Co2InjectionBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(Co2InjectionBaseProblem, Problem,
Opm::Co2InjectionProblem<TypeTag>);
// Set fluid configuration
SET_PROP(Co2InjectionBaseProblem, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::Co2InjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::Co2Injection::CO2Tables CO2Tables;
public:
@ -104,14 +115,15 @@ public:
};
// Set the material Law
SET_PROP(Co2InjectionBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::Co2InjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::liquidPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gasPhaseIdx> Traits;
@ -126,11 +138,12 @@ public:
};
// Set the thermal conduction law
SET_PROP(Co2InjectionBaseProblem, ThermalConductionLaw)
template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::Co2InjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
// define the material law parameterized by absolute saturations
@ -139,24 +152,28 @@ public:
// set the energy storage law for the solid phase
SET_TYPE_PROP(Co2InjectionBaseProblem, SolidEnergyLaw,
Opm::ConstantSolidHeatCapLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>);
// Use the algebraic multi-grid linear solver for this problem
SET_TAG_PROP(Co2InjectionBaseProblem, LinearSolverSplice, ParallelAmgLinearSolver);
// Write the Newton convergence behavior to disk?
SET_BOOL_PROP(Co2InjectionBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr bool value = false; };
// Enable gravity
SET_BOOL_PROP(Co2InjectionBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr bool value = true; };
// set the defaults for the problem specific properties
SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemPressureLow, 3e7);
SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemPressureHigh, 4e7);
SET_INT_PROP(Co2InjectionBaseProblem, FluidSystemNumPressure, 100);
template<class TypeTag>
struct FluidSystemNumPressure<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr int value = 100; };
SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemTemperatureLow, 290);
SET_SCALAR_PROP(Co2InjectionBaseProblem, FluidSystemTemperatureHigh, 500);
SET_INT_PROP(Co2InjectionBaseProblem, FluidSystemNumTemperature, 100);
template<class TypeTag>
struct FluidSystemNumTemperature<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr int value = 100; };
SET_SCALAR_PROP(Co2InjectionBaseProblem, MaxDepth, 2500);
SET_SCALAR_PROP(Co2InjectionBaseProblem, Temperature, 293.15);
@ -197,20 +214,20 @@ namespace Opm {
* hydrostatic pressure is assumed.
*/
template <class TypeTag>
class Co2InjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class Co2InjectionProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { dim = GridView::dimension };
enum { dimWorld = GridView::dimensionworld };
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum { numPhases = FluidSystem::numPhases };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
@ -219,15 +236,15 @@ class Co2InjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
enum { conti0EqIdx = Indices::conti0EqIdx };
enum { contiCO2EqIdx = conti0EqIdx + CO2Idx };
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLaw) ThermalConductionLaw;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLaw> ThermalConductionLaw;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
typedef typename ThermalConductionLaw::Params ThermalConductionLawParams;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -356,7 +373,7 @@ public:
std::ostringstream oss;
oss << EWOMS_GET_PARAM(TypeTag, std::string, SimulationName)
<< "_" << Model::name();
if (GET_PROP_VALUE(TypeTag, EnableEnergy))
if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni";
oss << "_" << Model::discretizationName();
return oss.str();

View File

@ -63,28 +63,32 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(CuvetteBaseProblem);
// Set the grid type
SET_TYPE_PROP(CuvetteBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::CuvetteBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(CuvetteBaseProblem, Problem, Opm::CuvetteProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::CuvetteBaseProblem> { using type = Opm::CuvetteProblem<TypeTag>; };
// Set the fluid system
SET_TYPE_PROP(
CuvetteBaseProblem, FluidSystem,
Opm::H2OAirMesityleneFluidSystem<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>);
// Enable gravity
SET_BOOL_PROP(CuvetteBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::CuvetteBaseProblem> { static constexpr bool value = true; };
// Set the maximum time step
SET_SCALAR_PROP(CuvetteBaseProblem, MaxTimeStepSize, 600.);
// Set the material Law
SET_PROP(CuvetteBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::CuvetteBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::ThreePhaseMaterialTraits<
Scalar,
@ -98,14 +102,15 @@ public:
// set the energy storage law for the solid phase
SET_TYPE_PROP(CuvetteBaseProblem, SolidEnergyLaw,
Opm::ConstantSolidHeatCapLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>);
// Set the thermal conduction law
SET_PROP(CuvetteBaseProblem, ThermalConductionLaw)
template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::CuvetteBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
// define the material law parameterized by absolute saturations
@ -152,26 +157,26 @@ namespace Opm {
* of the domain requires much longer (about 10 days simulated time).
*/
template <class TypeTag>
class CuvetteProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class CuvetteProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLawParams) ThermalConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLawParams> ThermalConductionLawParams;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum { numPhases = FluidSystem::numPhases };
enum { numComponents = FluidSystem::numComponents };
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };

View File

@ -57,30 +57,35 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(DiffusionBaseProblem);
// Set the grid implementation to be used
SET_TYPE_PROP(DiffusionBaseProblem, Grid, Dune::YaspGrid</*dim=*/1>);
template<class TypeTag>
struct Grid<TypeTag, TTag::DiffusionBaseProblem> { using type = Dune::YaspGrid</*dim=*/1>; };
// set the Vanguard property
SET_TYPE_PROP(DiffusionBaseProblem, Vanguard, Opm::CubeGridVanguard<TypeTag>);
template<class TypeTag>
struct Vanguard<TypeTag, TTag::DiffusionBaseProblem> { using type = Opm::CubeGridVanguard<TypeTag>; };
// Set the problem property
SET_TYPE_PROP(DiffusionBaseProblem, Problem, Opm::DiffusionProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::DiffusionBaseProblem> { using type = Opm::DiffusionProblem<TypeTag>; };
// Set the fluid system
SET_PROP(DiffusionBaseProblem, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::DiffusionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::H2ON2FluidSystem<Scalar> type;
};
// Set the material Law
SET_PROP(DiffusionBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::DiffusionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
static_assert(FluidSystem::numPhases == 2,
"A fluid system with two phases is required "
@ -95,19 +100,24 @@ public:
};
// Enable molecular diffusion for this problem
SET_BOOL_PROP(DiffusionBaseProblem, EnableDiffusion, true);
template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::DiffusionBaseProblem> { static constexpr bool value = true; };
// Disable gravity
SET_BOOL_PROP(DiffusionBaseProblem, EnableGravity, false);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::DiffusionBaseProblem> { static constexpr bool value = false; };
// define the properties specific for the diffusion problem
SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeX, 1.0);
SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeY, 1.0);
SET_SCALAR_PROP(DiffusionBaseProblem, DomainSizeZ, 1.0);
SET_INT_PROP(DiffusionBaseProblem, CellsX, 250);
SET_INT_PROP(DiffusionBaseProblem, CellsY, 1);
SET_INT_PROP(DiffusionBaseProblem, CellsZ, 1);
template<class TypeTag>
struct CellsX<TypeTag, TTag::DiffusionBaseProblem> { static constexpr int value = 250; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::DiffusionBaseProblem> { static constexpr int value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::DiffusionBaseProblem> { static constexpr int value = 1; };
// The default for the end time of the simulation
SET_SCALAR_PROP(DiffusionBaseProblem, EndTime, 1e6);
@ -129,16 +139,16 @@ namespace Opm {
* diffusion.
*/
template <class TypeTag>
class DiffusionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class DiffusionProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum {
// number of phases
@ -157,12 +167,12 @@ class DiffusionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
dimWorld = GridView::dimensionworld
};
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;

View File

@ -64,7 +64,10 @@ class FingerProblem;
BEGIN_PROPERTIES
NEW_TYPE_TAG(FingerBaseProblem, INHERITS_FROM(StructuredGridVanguard));
// Create new type tags
namespace TTag {
struct FingerBaseProblem { using InheritsFrom = std::tuple<StructuredGridVanguard>; };
} // end namespace TTag
#if HAVE_DUNE_ALUGRID
// use dune-alugrid if available
@ -77,36 +80,41 @@ SET_TYPE_PROP(FingerBaseProblem,
#endif
// declare the properties used by the finger problem
NEW_PROP_TAG(InitialWaterSaturation);
template<class TypeTag, class MyTypeTag>
struct InitialWaterSaturation { using type = UndefinedProperty; };
// Set the problem property
SET_TYPE_PROP(FingerBaseProblem, Problem, Opm::FingerProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::FingerBaseProblem> { using type = Opm::FingerProblem<TypeTag>; };
// Set the wetting phase
SET_PROP(FingerBaseProblem, WettingPhase)
template<class TypeTag>
struct WettingPhase<TypeTag, TTag::FingerBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the non-wetting phase
SET_PROP(FingerBaseProblem, NonwettingPhase)
template<class TypeTag>
struct NonwettingPhase<TypeTag, TTag::FingerBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::GasPhase<Scalar, Opm::Air<Scalar> > type;
};
// Set the material Law
SET_PROP(FingerBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FingerBaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx> Traits;
@ -117,16 +125,20 @@ SET_PROP(FingerBaseProblem, MaterialLaw)
};
// Write the solutions of individual newton iterations?
SET_BOOL_PROP(FingerBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::FingerBaseProblem> { static constexpr bool value = false; };
// Use forward differences instead of central differences
SET_INT_PROP(FingerBaseProblem, NumericDifferenceMethod, +1);
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::FingerBaseProblem> { static constexpr int value = +1; };
// Enable constraints
SET_INT_PROP(FingerBaseProblem, EnableConstraints, true);
template<class TypeTag>
struct EnableConstraints<TypeTag, TTag::FingerBaseProblem> { static constexpr int value = true; };
// Enable gravity
SET_BOOL_PROP(FingerBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::FingerBaseProblem> { static constexpr bool value = true; };
// define the properties specific for the finger problem
SET_SCALAR_PROP(FingerBaseProblem, DomainSizeX, 0.1);
@ -135,9 +147,12 @@ SET_SCALAR_PROP(FingerBaseProblem, DomainSizeZ, 0.1);
SET_SCALAR_PROP(FingerBaseProblem, InitialWaterSaturation, 0.01);
SET_INT_PROP(FingerBaseProblem, CellsX, 20);
SET_INT_PROP(FingerBaseProblem, CellsY, 70);
SET_INT_PROP(FingerBaseProblem, CellsZ, 1);
template<class TypeTag>
struct CellsX<TypeTag, TTag::FingerBaseProblem> { static constexpr int value = 20; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::FingerBaseProblem> { static constexpr int value = 70; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::FingerBaseProblem> { static constexpr int value = 1; };
// The default for the end time of the simulation
SET_SCALAR_PROP(FingerBaseProblem, EndTime, 215);
@ -165,21 +180,21 @@ namespace Opm {
* discretization is fine enough.
*/
template <class TypeTag>
class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class FingerProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
//!\cond SKIP_THIS
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::WettingPhase> WettingPhase;
typedef GetPropType<TypeTag, Properties::NonwettingPhase> NonwettingPhase;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Constraints> Constraints;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum {
// number of phases
@ -197,16 +212,16 @@ class FingerProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
dimWorld = GridView::dimensionworld
};
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Stencil) Stencil;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Stencil> Stencil;
enum { codim = Stencil::Entity::codimension };
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef typename GET_PROP(TypeTag, MaterialLaw)::ParkerLenhard ParkerLenhard;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;

View File

@ -68,7 +68,10 @@ class FractureProblem;
BEGIN_PROPERTIES
// Create a type tag for the problem
NEW_TYPE_TAG(FractureProblem, INHERITS_FROM(DiscreteFractureModel));
// Create new type tags
namespace TTag {
struct FractureProblem { using InheritsFrom = std::tuple<DiscreteFractureModel>; };
} // end namespace TTag
// Set the grid type
SET_TYPE_PROP(
@ -76,40 +79,45 @@ SET_TYPE_PROP(
Dune::ALUGrid</*dim=*/2, /*dimWorld=*/2, Dune::simplex, Dune::nonconforming>);
// Set the Vanguard property
SET_TYPE_PROP(FractureProblem, Vanguard, Opm::DgfVanguard<TypeTag>);
template<class TypeTag>
struct Vanguard<TypeTag, TTag::FractureProblem> { using type = Opm::DgfVanguard<TypeTag>; };
// Set the problem property
SET_TYPE_PROP(FractureProblem, Problem, Opm::FractureProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::FractureProblem> { using type = Opm::FractureProblem<TypeTag>; };
// Set the wetting phase
SET_PROP(FractureProblem, WettingPhase)
template<class TypeTag>
struct WettingPhase<TypeTag, TTag::FractureProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the non-wetting phase
SET_PROP(FractureProblem, NonwettingPhase)
template<class TypeTag>
struct NonwettingPhase<TypeTag, TTag::FractureProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::DNAPL<Scalar> > type;
};
// Set the material Law
SET_PROP(FractureProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FractureProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { wettingPhaseIdx = FluidSystem::wettingPhaseIdx };
enum { nonWettingPhaseIdx = FluidSystem::nonWettingPhaseIdx };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx>
@ -125,14 +133,16 @@ public:
};
// Enable the energy equation
SET_BOOL_PROP(FractureProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::FractureProblem> { static constexpr bool value = true; };
// Set the thermal conduction law
SET_PROP(FractureProblem, ThermalConductionLaw)
template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::FractureProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
// define the material law parameterized by absolute saturations
@ -141,13 +151,15 @@ public:
// set the energy storage law for the solid phase
SET_TYPE_PROP(FractureProblem, SolidEnergyLaw,
Opm::ConstantSolidHeatCapLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>);
// Disable gravity
SET_BOOL_PROP(FractureProblem, EnableGravity, false);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::FractureProblem> { static constexpr bool value = false; };
// For this problem, we use constraints to specify the left boundary
SET_BOOL_PROP(FractureProblem, EnableConstraints, true);
template<class TypeTag>
struct EnableConstraints<TypeTag, TTag::FractureProblem> { static constexpr bool value = true; };
// Set the default value for the file name of the grid
SET_STRING_PROP(FractureProblem, GridFile, "data/fracture.art.dgf");
@ -174,25 +186,25 @@ namespace Opm {
* where the pressure is kept constant.
*/
template <class TypeTag>
class FractureProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class FractureProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLawParams) ThermalConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::WettingPhase> WettingPhase;
typedef GetPropType<TypeTag, Properties::NonwettingPhase> NonwettingPhase;
typedef GetPropType<TypeTag, Properties::Constraints> Constraints;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLawParams> ThermalConductionLawParams;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum {
// phase indices

View File

@ -53,29 +53,41 @@ class GroundWaterProblem;
BEGIN_PROPERTIES
NEW_TYPE_TAG(GroundWaterBaseProblem);
namespace TTag {
struct GroundWaterBaseProblem {};
}
NEW_PROP_TAG(LensLowerLeftX);
NEW_PROP_TAG(LensLowerLeftY);
NEW_PROP_TAG(LensLowerLeftZ);
NEW_PROP_TAG(LensUpperRightX);
NEW_PROP_TAG(LensUpperRightY);
NEW_PROP_TAG(LensUpperRightZ);
NEW_PROP_TAG(Permeability);
NEW_PROP_TAG(PermeabilityLens);
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftZ { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightZ { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct Permeability { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct PermeabilityLens { using type = UndefinedProperty; };
SET_PROP(GroundWaterBaseProblem, Fluid)
template<class TypeTag>
struct Fluid<TypeTag, TTag::GroundWaterBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the grid type
SET_TYPE_PROP(GroundWaterBaseProblem, Grid, Dune::YaspGrid<2>);
// SET_TYPE_PROP(GroundWaterBaseProblem, Grid, Dune::SGrid<2, 2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::YaspGrid<2>; };
// struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::SGrid<2, 2>; };
SET_TYPE_PROP(GroundWaterBaseProblem, Problem,
Opm::GroundWaterProblem<TypeTag>);
@ -90,7 +102,8 @@ SET_SCALAR_PROP(GroundWaterBaseProblem, Permeability, 1e-10);
SET_SCALAR_PROP(GroundWaterBaseProblem, PermeabilityLens, 1e-12);
// Enable gravity
SET_BOOL_PROP(GroundWaterBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::GroundWaterBaseProblem> { static constexpr bool value = true; };
// The default for the end time of the simulation
SET_SCALAR_PROP(GroundWaterBaseProblem, EndTime, 1);
@ -123,16 +136,16 @@ namespace Opm {
* occupied by a rectangular lens of lower permeability.
*/
template <class TypeTag>
class GroundWaterProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class GroundWaterProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum {
numPhases = FluidSystem::numPhases,
@ -144,12 +157,12 @@ class GroundWaterProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
pressure0Idx = Indices::pressure0Idx
};
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;

View File

@ -57,7 +57,8 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(InfiltrationBaseProblem);
// Set the grid type
SET_TYPE_PROP(InfiltrationBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::InfiltrationBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(InfiltrationBaseProblem, Problem,
@ -66,23 +67,27 @@ SET_TYPE_PROP(InfiltrationBaseProblem, Problem,
// Set the fluid system
SET_TYPE_PROP(
InfiltrationBaseProblem, FluidSystem,
Opm::H2OAirMesityleneFluidSystem<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>);
// Enable gravity?
SET_BOOL_PROP(InfiltrationBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::InfiltrationBaseProblem> { static constexpr bool value = true; };
// Write newton convergence?
SET_BOOL_PROP(InfiltrationBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::InfiltrationBaseProblem> { static constexpr bool value = false; };
// -1 backward differences, 0: central differences, +1: forward differences
SET_INT_PROP(InfiltrationBaseProblem, NumericDifferenceMethod, 1);
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::InfiltrationBaseProblem> { static constexpr int value = 1; };
// Set the material Law
SET_PROP(InfiltrationBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::InfiltrationBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::ThreePhaseMaterialTraits<
Scalar,
@ -130,24 +135,24 @@ namespace Opm {
* except for the small infiltration zone in the upper left part.
*/
template <class TypeTag>
class InfiltrationProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class InfiltrationProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Model> Model;
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum {
// equation indices
conti0EqIdx = Indices::conti0EqIdx,

View File

@ -58,51 +58,65 @@ class LensProblem;
BEGIN_PROPERTIES
NEW_TYPE_TAG(LensBaseProblem, INHERITS_FROM(StructuredGridVanguard));
// Create new type tags
namespace TTag {
struct LensBaseProblem { using InheritsFrom = std::tuple<StructuredGridVanguard>; };
} // end namespace TTag
// declare the properties specific for the lens problem
NEW_PROP_TAG(LensLowerLeftX);
NEW_PROP_TAG(LensLowerLeftY);
NEW_PROP_TAG(LensLowerLeftZ);
NEW_PROP_TAG(LensUpperRightX);
NEW_PROP_TAG(LensUpperRightY);
NEW_PROP_TAG(LensUpperRightZ);
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensLowerLeftZ { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightX { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightY { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LensUpperRightZ { using type = UndefinedProperty; };
// Set the problem property
SET_TYPE_PROP(LensBaseProblem, Problem, Opm::LensProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::LensBaseProblem> { using type = Opm::LensProblem<TypeTag>; };
// Use Dune-grid's YaspGrid
SET_TYPE_PROP(LensBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::LensBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the wetting phase
SET_PROP(LensBaseProblem, WettingPhase)
template<class TypeTag>
struct WettingPhase<TypeTag, TTag::LensBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the non-wetting phase
SET_PROP(LensBaseProblem, NonwettingPhase)
template<class TypeTag>
struct NonwettingPhase<TypeTag, TTag::LensBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::DNAPL<Scalar> > type;
};
// Set the material Law
SET_PROP(LensBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::LensBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { wettingPhaseIdx = FluidSystem::wettingPhaseIdx };
enum { nonWettingPhaseIdx = FluidSystem::nonWettingPhaseIdx };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx> Traits;
@ -117,13 +131,16 @@ public:
};
// Write the solutions of individual newton iterations?
SET_BOOL_PROP(LensBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = false; };
// Use forward differences instead of central differences
SET_INT_PROP(LensBaseProblem, NumericDifferenceMethod, +1);
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::LensBaseProblem> { static constexpr int value = +1; };
// Enable gravity
SET_BOOL_PROP(LensBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
// define the properties specific for the lens problem
SET_SCALAR_PROP(LensBaseProblem, LensLowerLeftX, 1.0);
@ -137,9 +154,12 @@ SET_SCALAR_PROP(LensBaseProblem, DomainSizeX, 6.0);
SET_SCALAR_PROP(LensBaseProblem, DomainSizeY, 4.0);
SET_SCALAR_PROP(LensBaseProblem, DomainSizeZ, 1.0);
SET_INT_PROP(LensBaseProblem, CellsX, 48);
SET_INT_PROP(LensBaseProblem, CellsY, 32);
SET_INT_PROP(LensBaseProblem, CellsZ, 16);
template<class TypeTag>
struct CellsX<TypeTag, TTag::LensBaseProblem> { static constexpr int value = 48; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::LensBaseProblem> { static constexpr int value = 32; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::LensBaseProblem> { static constexpr int value = 16; };
// The default for the end time of the simulation
SET_SCALAR_PROP(LensBaseProblem, EndTime, 30e3);
@ -148,13 +168,16 @@ SET_SCALAR_PROP(LensBaseProblem, EndTime, 30e3);
SET_SCALAR_PROP(LensBaseProblem, InitialTimeStepSize, 250);
// By default, include the intrinsic permeability tensor to the VTK output files
SET_BOOL_PROP(LensBaseProblem, VtkWriteIntrinsicPermeabilities, true);
template<class TypeTag>
struct VtkWriteIntrinsicPermeabilities<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
// enable the storage cache by default for this problem
SET_BOOL_PROP(LensBaseProblem, EnableStorageCache, true);
template<class TypeTag>
struct EnableStorageCache<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
// enable the cache for intensive quantities by default for this problem
SET_BOOL_PROP(LensBaseProblem, EnableIntensiveQuantityCache, true);
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::LensBaseProblem> { static constexpr bool value = true; };
END_PROPERTIES
@ -184,19 +207,19 @@ namespace Opm {
* saturation on both sides is zero.
*/
template <class TypeTag>
class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class LensProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::WettingPhase> WettingPhase;
typedef GetPropType<TypeTag, Properties::NonwettingPhase> NonwettingPhase;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum {
// number of phases
@ -214,11 +237,11 @@ class LensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
dimWorld = GridView::dimensionworld
};
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
@ -314,18 +337,18 @@ public:
static std::string briefDescription()
{
std::string thermal = "isothermal";
bool enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy);
bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
if (enableEnergy)
thermal = "non-isothermal";
std::string deriv = "finite difference";
typedef typename GET_PROP_TYPE(TypeTag, LocalLinearizerSplice) LLS;
bool useAutoDiff = std::is_same<LLS, TTAG(AutoDiffLocalLinearizer)>::value;
typedef GetPropType<TypeTag, Properties::LocalLinearizerSplice> LLS;
bool useAutoDiff = std::is_same<LLS, Properties::TTag::AutoDiffLocalLinearizer>::value;
if (useAutoDiff)
deriv = "automatic differentiation";
std::string disc = "vertex centered finite volume";
typedef typename GET_PROP_TYPE(TypeTag, Discretization) D;
typedef GetPropType<TypeTag, Properties::Discretization> D;
bool useEcfv = std::is_same<D, Opm::EcfvDiscretization<TypeTag>>::value;
if (useEcfv)
disc = "element centered finite volume";
@ -400,9 +423,9 @@ public:
*/
std::string name() const
{
typedef typename GET_PROP_TYPE(TypeTag, LocalLinearizerSplice) LLS;
typedef GetPropType<TypeTag, Properties::LocalLinearizerSplice> LLS;
bool useAutoDiff = std::is_same<LLS, TTAG(AutoDiffLocalLinearizer)>::value;
bool useAutoDiff = std::is_same<LLS, Properties::TTag::AutoDiffLocalLinearizer>::value;
std::ostringstream oss;
oss << "lens_" << Model::name()

View File

@ -62,22 +62,25 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(ObstacleBaseProblem);
// Set the grid type
SET_TYPE_PROP(ObstacleBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ObstacleBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(ObstacleBaseProblem, Problem, Opm::ObstacleProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::ObstacleBaseProblem> { using type = Opm::ObstacleProblem<TypeTag>; };
// Set fluid configuration
SET_TYPE_PROP(ObstacleBaseProblem, FluidSystem,
Opm::H2ON2FluidSystem<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::H2ON2FluidSystem<GetPropType<TypeTag, Properties::Scalar>>);
// Set the material Law
SET_PROP(ObstacleBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::ObstacleBaseProblem>
{
private:
// define the material law
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::liquidPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gasPhaseIdx>
@ -90,11 +93,12 @@ public:
};
// Set the thermal conduction law
SET_PROP(ObstacleBaseProblem, ThermalConductionLaw)
template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::ObstacleBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
// define the material law parameterized by absolute saturations
@ -103,10 +107,11 @@ public:
// set the energy storage law for the solid phase
SET_TYPE_PROP(ObstacleBaseProblem, SolidEnergyLaw,
Opm::ConstantSolidHeatCapLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>);
// Enable gravity
SET_BOOL_PROP(ObstacleBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::ObstacleBaseProblem> { static constexpr bool value = true; };
// The default for the end time of the simulation
SET_SCALAR_PROP(ObstacleBaseProblem, EndTime, 1e4);
@ -147,27 +152,27 @@ namespace Opm {
* and the right boundary where a free flow condition is assumed.
*/
template <class TypeTag>
class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class ObstacleProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLawParams) ThermalConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLawParams> ThermalConductionLawParams;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
enum {
// Grid and world dimension
dim = GridView::dimension,
dimWorld = GridView::dimensionworld,
numPhases = GET_PROP_VALUE(TypeTag, NumPhases),
numPhases = getPropValue<TypeTag, Properties::NumPhases>(),
gasPhaseIdx = FluidSystem::gasPhaseIdx,
liquidPhaseIdx = FluidSystem::liquidPhaseIdx,
H2OIdx = FluidSystem::H2OIdx,
@ -177,8 +182,8 @@ class ObstacleProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
typedef Dune::FieldVector<typename GridView::ctype, dimWorld> GlobalPosition;
typedef Dune::FieldVector<Scalar, numPhases> PhaseVector;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
public:
/*!

View File

@ -50,16 +50,19 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(OutflowBaseProblem);
// Set the grid type
SET_TYPE_PROP(OutflowBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::OutflowBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(OutflowBaseProblem, Problem, Opm::OutflowProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::OutflowBaseProblem> { using type = Opm::OutflowProblem<TypeTag>; };
// Set fluid system
SET_PROP(OutflowBaseProblem, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::OutflowBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
// Two-component single phase fluid system
@ -67,10 +70,12 @@ public:
};
// Disable gravity
SET_BOOL_PROP(OutflowBaseProblem, EnableGravity, false);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool value = false; };
// Also write mass fractions to the output
SET_BOOL_PROP(OutflowBaseProblem, VtkWriteMassFractions, true);
template<class TypeTag>
struct VtkWriteMassFractions<TypeTag, TTag::OutflowBaseProblem> { static constexpr bool value = true; };
// The default for the end time of the simulation
SET_SCALAR_PROP(OutflowBaseProblem, EndTime, 100);
@ -102,19 +107,19 @@ namespace Opm {
* used.
*/
template <class TypeTag>
class OutflowProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class OutflowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
// copy some indices for convenience
enum {

View File

@ -62,7 +62,8 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(PowerInjectionBaseProblem);
// Set the grid implementation to be used
SET_TYPE_PROP(PowerInjectionBaseProblem, Grid, Dune::YaspGrid</*dim=*/1>);
template<class TypeTag>
struct Grid<TypeTag, TTag::PowerInjectionBaseProblem> { using type = Dune::YaspGrid</*dim=*/1>; };
// set the Vanguard property
SET_TYPE_PROP(PowerInjectionBaseProblem, Vanguard,
@ -73,34 +74,37 @@ SET_TYPE_PROP(PowerInjectionBaseProblem, Problem,
Opm::PowerInjectionProblem<TypeTag>);
// Set the wetting phase
SET_PROP(PowerInjectionBaseProblem, WettingPhase)
template<class TypeTag>
struct WettingPhase<TypeTag, TTag::PowerInjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the non-wetting phase
SET_PROP(PowerInjectionBaseProblem, NonwettingPhase)
template<class TypeTag>
struct NonwettingPhase<TypeTag, TTag::PowerInjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::GasPhase<Scalar, Opm::Air<Scalar> > type;
};
// Set the material Law
SET_PROP(PowerInjectionBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::PowerInjectionBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { wettingPhaseIdx = FluidSystem::wettingPhaseIdx };
enum { nonWettingPhaseIdx = FluidSystem::nonWettingPhaseIdx };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx>
@ -116,19 +120,24 @@ public:
};
// Write out the filter velocities for this problem
SET_BOOL_PROP(PowerInjectionBaseProblem, VtkWriteFilterVelocities, true);
template<class TypeTag>
struct VtkWriteFilterVelocities<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = true; };
// Disable gravity
SET_BOOL_PROP(PowerInjectionBaseProblem, EnableGravity, false);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr bool value = false; };
// define the properties specific for the power injection problem
SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeX, 100.0);
SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeY, 1.0);
SET_SCALAR_PROP(PowerInjectionBaseProblem, DomainSizeZ, 1.0);
SET_INT_PROP(PowerInjectionBaseProblem, CellsX, 250);
SET_INT_PROP(PowerInjectionBaseProblem, CellsY, 1);
SET_INT_PROP(PowerInjectionBaseProblem, CellsZ, 1);
template<class TypeTag>
struct CellsX<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr int value = 250; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr int value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::PowerInjectionBaseProblem> { static constexpr int value = 1; };
// The default for the end time of the simulation
SET_SCALAR_PROP(PowerInjectionBaseProblem, EndTime, 100);
@ -152,21 +161,21 @@ namespace Opm {
* Systems, University of Stuttgart, 2011
*/
template <class TypeTag>
class PowerInjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class PowerInjectionProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::WettingPhase> WettingPhase;
typedef GetPropType<TypeTag, Properties::NonwettingPhase> NonwettingPhase;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
enum {
// number of phases
@ -184,8 +193,8 @@ class PowerInjectionProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
dimWorld = GridView::dimensionworld
};
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
@ -235,14 +244,14 @@ public:
{
std::ostringstream oss;
oss << "powerinjection_";
if (std::is_same<typename GET_PROP_TYPE(TypeTag, FluxModule),
if (std::is_same<GetPropType<TypeTag, Properties::FluxModule>,
Opm::DarcyFluxModule<TypeTag> >::value)
oss << "darcy";
else
oss << "forchheimer";
if (std::is_same<typename GET_PROP_TYPE(TypeTag, LocalLinearizerSplice),
TTAG(AutoDiffLocalLinearizer)>::value)
if (std::is_same<GetPropType<TypeTag, Properties::LocalLinearizerSplice>,
Properties::TTag::AutoDiffLocalLinearizer>::value)
oss << "_" << "ad";
else
oss << "_" << "fd";

View File

@ -62,24 +62,30 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(ReservoirBaseProblem);
// Maximum depth of the reservoir
NEW_PROP_TAG(MaxDepth);
template<class TypeTag, class MyTypeTag>
struct MaxDepth { using type = UndefinedProperty; };
// The temperature inside the reservoir
NEW_PROP_TAG(Temperature);
template<class TypeTag, class MyTypeTag>
struct Temperature { using type = UndefinedProperty; };
// The width of producer/injector wells as a fraction of the width of the spatial domain
NEW_PROP_TAG(WellWidth);
template<class TypeTag, class MyTypeTag>
struct WellWidth { using type = UndefinedProperty; };
// Set the grid type
SET_TYPE_PROP(ReservoirBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::ReservoirBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(ReservoirBaseProblem, Problem, Opm::ReservoirProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::ReservoirBaseProblem> { using type = Opm::ReservoirProblem<TypeTag>; };
// Set the material Law
SET_PROP(ReservoirBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::ReservoirBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::
ThreePhaseMaterialTraits<Scalar,
@ -92,13 +98,16 @@ public:
};
// Write the Newton convergence behavior to disk?
SET_BOOL_PROP(ReservoirBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::ReservoirBaseProblem> { static constexpr bool value = false; };
// Enable gravity
SET_BOOL_PROP(ReservoirBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::ReservoirBaseProblem> { static constexpr bool value = true; };
// Enable constraint DOFs?
SET_BOOL_PROP(ReservoirBaseProblem, EnableConstraints, true);
template<class TypeTag>
struct EnableConstraints<TypeTag, TTag::ReservoirBaseProblem> { static constexpr bool value = true; };
// set the defaults for some problem specific properties
SET_SCALAR_PROP(ReservoirBaseProblem, MaxDepth, 2500);
@ -124,10 +133,11 @@ SET_SCALAR_PROP(ReservoirBaseProblem, WellWidth, 0.01);
* though because other models are more generic and thus do not assume a particular fluid
* system.
*/
SET_PROP(ReservoirBaseProblem, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::ReservoirBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::BlackOilFluidSystem<Scalar> type;
@ -160,14 +170,14 @@ namespace Opm {
* the injector wells use a pressure which is 50% above the reservoir pressure.
*/
template <class TypeTag>
class ReservoirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class ReservoirProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
// Grid and world dimension
enum { dim = GridView::dimension };
@ -183,16 +193,16 @@ class ReservoirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
enum { oilCompIdx = FluidSystem::oilCompIdx };
enum { waterCompIdx = FluidSystem::waterCompIdx };
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::Constraints> Constraints;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;

View File

@ -53,33 +53,40 @@ class RichardsLensProblem;
BEGIN_PROPERTIES
NEW_TYPE_TAG(RichardsLensProblem, INHERITS_FROM(Richards));
// Create new type tags
namespace TTag {
struct RichardsLensProblem { using InheritsFrom = std::tuple<Richards>; };
} // end namespace TTag
// Use 2d YaspGrid
SET_TYPE_PROP(RichardsLensProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::RichardsLensProblem> { using type = Dune::YaspGrid<2>; };
// Set the physical problem to be solved
SET_TYPE_PROP(RichardsLensProblem, Problem, Opm::RichardsLensProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::RichardsLensProblem> { using type = Opm::RichardsLensProblem<TypeTag>; };
// Set the wetting phase
SET_PROP(RichardsLensProblem, WettingFluid)
template<class TypeTag>
struct WettingFluid<TypeTag, TTag::RichardsLensProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
};
// Set the material Law
SET_PROP(RichardsLensProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::RichardsLensProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { wettingPhaseIdx = FluidSystem::wettingPhaseIdx };
enum { nonWettingPhaseIdx = FluidSystem::nonWettingPhaseIdx };
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::wettingPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::nonWettingPhaseIdx>
@ -95,19 +102,24 @@ public:
};
// Enable gravitational acceleration
SET_BOOL_PROP(RichardsLensProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::RichardsLensProblem> { static constexpr bool value = true; };
// Use central differences to approximate the Jacobian matrix
SET_INT_PROP(RichardsLensProblem, NumericDifferenceMethod, 0);
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 0; };
// Set the maximum number of newton iterations of a time step
SET_INT_PROP(RichardsLensProblem, NewtonMaxIterations, 28);
template<class TypeTag>
struct NewtonMaxIterations<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 28; };
// Set the "desireable" number of newton iterations of a time step
SET_INT_PROP(RichardsLensProblem, NewtonTargetIterations, 18);
template<class TypeTag>
struct NewtonTargetIterations<TypeTag, TTag::RichardsLensProblem> { static constexpr int value = 18; };
// Do not write the intermediate results of the newton method
SET_BOOL_PROP(RichardsLensProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::RichardsLensProblem> { static constexpr bool value = false; };
// The default for the end time of the simulation
SET_SCALAR_PROP(RichardsLensProblem, EndTime, 3000);
@ -139,22 +151,22 @@ namespace Opm {
* instead of a \c DNAPL infiltrates from the top.
*/
template <class TypeTag>
class RichardsLensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class RichardsLensProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Stencil) Stencil;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Stencil> Stencil;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum {
// copy some indices for convenience
pressureWIdx = Indices::pressureWIdx,
@ -168,7 +180,7 @@ class RichardsLensProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
};
// get the material law from the property system
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
//! The parameters of the material law to be used
typedef typename MaterialLaw::Params MaterialLawParams;

View File

@ -63,17 +63,20 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(WaterAirBaseProblem);
// Set the grid type
SET_TYPE_PROP(WaterAirBaseProblem, Grid, Dune::YaspGrid<2>);
template<class TypeTag>
struct Grid<TypeTag, TTag::WaterAirBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property
SET_TYPE_PROP(WaterAirBaseProblem, Problem, Opm::WaterAirProblem<TypeTag>);
template<class TypeTag>
struct Problem<TypeTag, TTag::WaterAirBaseProblem> { using type = Opm::WaterAirProblem<TypeTag>; };
// Set the material Law
SET_PROP(WaterAirBaseProblem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::WaterAirBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::TwoPhaseMaterialTraits<Scalar,
/*wettingPhaseIdx=*/FluidSystem::liquidPhaseIdx,
/*nonWettingPhaseIdx=*/FluidSystem::gasPhaseIdx> Traits;
@ -89,11 +92,12 @@ public:
};
// Set the thermal conduction law
SET_PROP(WaterAirBaseProblem, ThermalConductionLaw)
template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::WaterAirBaseProblem>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
// define the material law parameterized by absolute saturations
@ -102,21 +106,24 @@ public:
// set the energy storage law for the solid phase
SET_TYPE_PROP(WaterAirBaseProblem, SolidEnergyLaw,
Opm::ConstantSolidHeatCapLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>);
// Set the fluid system. in this case, we use the one which describes
// air and water
SET_TYPE_PROP(WaterAirBaseProblem, FluidSystem,
Opm::H2OAirFluidSystem<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::H2OAirFluidSystem<GetPropType<TypeTag, Properties::Scalar>>);
// Enable gravity
SET_BOOL_PROP(WaterAirBaseProblem, EnableGravity, true);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::WaterAirBaseProblem> { static constexpr bool value = true; };
// Use forward differences instead of central differences
SET_INT_PROP(WaterAirBaseProblem, NumericDifferenceMethod, +1);
template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = +1; };
// Write newton convergence
SET_BOOL_PROP(WaterAirBaseProblem, NewtonWriteConvergence, false);
template<class TypeTag>
struct NewtonWriteConvergence<TypeTag, TTag::WaterAirBaseProblem> { static constexpr bool value = false; };
// The default for the end time of the simulation (1 year)
SET_SCALAR_PROP(WaterAirBaseProblem, EndTime, 1.0 * 365 * 24 * 60 * 60);
@ -138,7 +145,8 @@ SET_TYPE_PROP(WaterAirBaseProblem, PreconditionerWrapper,
SET_TYPE_PROP(WaterAirBaseProblem, PreconditionerWrapper,
Opm::Linear::PreconditionerWrapperILUn<TypeTag>);
#endif
SET_INT_PROP(WaterAirBaseProblem, PreconditionerOrder, 2);
template<class TypeTag>
struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; };
END_PROPERTIES
@ -172,16 +180,16 @@ namespace Opm {
* K/m.
*/
template <class TypeTag >
class WaterAirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
class WaterAirProblem : public GetPropType<TypeTag, Properties::BaseProblem>
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
// copy some indices for convenience
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum {
numPhases = FluidSystem::numPhases,
@ -205,19 +213,19 @@ class WaterAirProblem : public GET_PROP_TYPE(TypeTag, BaseProblem)
dimWorld = GridView::dimensionworld
};
static const bool enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy);
static const bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Constraints) Constraints;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLawParams) ThermalConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Constraints> Constraints;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLawParams> ThermalConductionLawParams;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
typedef typename GridView::ctype CoordScalar;
typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
@ -292,7 +300,7 @@ public:
{
std::ostringstream oss;
oss << "waterair_" << Model::name();
if (GET_PROP_VALUE(TypeTag, EnableEnergy))
if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni";
return oss.str();

View File

@ -35,7 +35,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ReservoirBlackOilEcfvProblem, INHERITS_FROM(BlackOilModel, ReservoirBaseProblem));
// Create new type tags
namespace TTag {
struct ReservoirBlackOilEcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
} // end namespace TTag
// Select the element centered finite volume method as spatial discretization
SET_TAG_PROP(ReservoirBlackOilEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
@ -47,6 +50,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ReservoirBlackOilEcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ReservoirBlackOilEcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,7 +34,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ReservoirBlackOilVcfvProblem, INHERITS_FROM(BlackOilModel, ReservoirBaseProblem));
// Create new type tags
namespace TTag {
struct ReservoirBlackOilVcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, BlackOilModel>; };
} // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization
SET_TAG_PROP(ReservoirBlackOilVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
@ -43,6 +46,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ReservoirBlackOilVcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ReservoirBlackOilVcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -34,7 +34,10 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ReservoirNcpEcfvProblem, INHERITS_FROM(NcpModel, ReservoirBaseProblem));
// Create new type tags
namespace TTag {
struct ReservoirNcpEcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
} // end namespace TTag
// Select the element centered finite volume method as spatial discretization
SET_TAG_PROP(ReservoirNcpEcfvProblem, SpatialDiscretizationSplice, EcfvDiscretization);
@ -46,6 +49,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ReservoirNcpEcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ReservoirNcpEcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -35,14 +35,18 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(ReservoirNcpVcfvProblem, INHERITS_FROM(NcpModel, ReservoirBaseProblem));
// Create new type tags
namespace TTag {
struct ReservoirNcpVcfvProblem { using InheritsFrom = std::tuple<ReservoirBaseProblem, NcpModel>; };
} // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization
SET_TAG_PROP(ReservoirNcpVcfvProblem, SpatialDiscretizationSplice, VcfvDiscretization);
// enable the storage cache for this problem so that the storage cache receives wider
// testing
SET_BOOL_PROP(ReservoirNcpVcfvProblem, EnableStorageCache, true);
template<class TypeTag>
struct EnableStorageCache<TypeTag, TTag::ReservoirNcpVcfvProblem> { static constexpr bool value = true; };
// 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?)
@ -53,6 +57,6 @@ END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(ReservoirNcpVcfvProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::ReservoirNcpVcfvProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -32,6 +32,6 @@
int main(int argc, char **argv)
{
typedef TTAG(Tutorial1Problem) TypeTag; /*@\label{tutorial1:set-type-tag}@*/
typedef Opm::Properties::TTag::Tutorial1Problem TypeTag; /*@\label{tutorial1:set-type-tag}@*/
return Opm::start<TypeTag>(argc, argv); /*@\label{tutorial1:call-start}@*/
}

View File

@ -60,7 +60,10 @@ class Tutorial1Problem;
BEGIN_PROPERTIES
// Create a new type tag for the problem
NEW_TYPE_TAG(Tutorial1Problem, INHERITS_FROM(ImmiscibleTwoPhaseModel)); /*@\label{tutorial1:create-type-tag}@*/
// Create new type tags
namespace TTag {
struct Tutorial1Problem { using InheritsFrom = std::tuple<ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization
SET_TAG_PROP(Tutorial1Problem, SpatialDiscretizationSplice,
@ -71,29 +74,32 @@ SET_TYPE_PROP(Tutorial1Problem, Problem,
Opm::Tutorial1Problem<TypeTag>); /*@\label{tutorial1:set-problem}@*/
// Set grid and the grid manager to be used
SET_TYPE_PROP(Tutorial1Problem, Grid, Dune::YaspGrid</*dim=*/2>); /*@\label{tutorial1:set-grid}@*/
SET_TYPE_PROP(Tutorial1Problem, Vanguard, Opm::CubeGridVanguard<TypeTag>); /*@\label{tutorial1:set-grid-manager}@*/
template<class TypeTag>
struct Grid<TypeTag, TTag::Tutorial1Problem> { using type = Dune::YaspGrid</*dim=*/2>; }; /*@\label{tutorial1:set-grid}@*/
template<class TypeTag>
struct Vanguard<TypeTag, TTag::Tutorial1Problem> { using type = Opm::CubeGridVanguard<TypeTag>; }; /*@\label{tutorial1:set-grid-manager}@*/
// Set the wetting phase /*@\label{tutorial1:2p-system-start}@*/
SET_TYPE_PROP(Tutorial1Problem,
WettingPhase, /*@\label{tutorial1:wettingPhase}@*/
Opm::LiquidPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Opm::SimpleH2O<typename GET_PROP_TYPE(TypeTag, Scalar)> >);
Opm::LiquidPhase<GetPropType<TypeTag, Properties::Scalar>,
Opm::SimpleH2O<GetPropType<TypeTag, Properties::Scalar>> >);
// Set the non-wetting phase
SET_TYPE_PROP(Tutorial1Problem,
NonwettingPhase, /*@\label{tutorial1:nonwettingPhase}@*/
Opm::LiquidPhase<typename GET_PROP_TYPE(TypeTag, Scalar),
Opm::LNAPL<typename GET_PROP_TYPE(TypeTag, Scalar)> >); /*@\label{tutorial1:2p-system-end}@*/
Opm::LiquidPhase<GetPropType<TypeTag, Properties::Scalar>,
Opm::LNAPL<GetPropType<TypeTag, Properties::Scalar>> >); /*@\label{tutorial1:2p-system-end}@*/
// Set the material law
SET_PROP(Tutorial1Problem, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::Tutorial1Problem>
{
private:
// create a class holding the necessary information for a
// two-phase capillary pressure law
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { wettingPhaseIdx = FluidSystem::wettingPhaseIdx };
enum { nonWettingPhaseIdx = FluidSystem::nonWettingPhaseIdx };
typedef Opm::TwoPhaseMaterialTraits<Scalar, wettingPhaseIdx, nonWettingPhaseIdx> Traits;
@ -109,7 +115,8 @@ public:
};
// Disable gravity
SET_BOOL_PROP(Tutorial1Problem, EnableGravity, false); /*@\label{tutorial1:gravity}@*/
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::Tutorial1Problem> { static constexpr bool value = false; }; /*@\label{tutorial1:gravity}@*/
// define how long the simulation should run [s]
SET_SCALAR_PROP(Tutorial1Problem, EndTime, 100e3); /*@\label{tutorial1:default-params-begin}@*/
@ -123,9 +130,12 @@ SET_SCALAR_PROP(Tutorial1Problem, DomainSizeY, 60.0);
SET_SCALAR_PROP(Tutorial1Problem, DomainSizeZ, 0.0);
// // define the number of cells used for discretizing the physical domain
SET_INT_PROP(Tutorial1Problem, CellsX, 100);
SET_INT_PROP(Tutorial1Problem, CellsY, 1);
SET_INT_PROP(Tutorial1Problem, CellsZ, 1); /*@\label{tutorial1:default-params-end}@*/
template<class TypeTag>
struct CellsX<TypeTag, TTag::Tutorial1Problem> { static constexpr int value = 100; };
template<class TypeTag>
struct CellsY<TypeTag, TTag::Tutorial1Problem> { static constexpr int value = 1; };
template<class TypeTag>
struct CellsZ<TypeTag, TTag::Tutorial1Problem> { static constexpr int value = 1; }; /*@\label{tutorial1:default-params-end}@*/
END_PROPERTIES
@ -133,11 +143,11 @@ namespace Opm {
//! Tutorial problem using the "immiscible" model.
template <class TypeTag>
class Tutorial1Problem
: public GET_PROP_TYPE(TypeTag, BaseProblem) /*@\label{tutorial1:def-problem}@*/
: public GetPropType<TypeTag, Properties::BaseProblem> /*@\label{tutorial1:def-problem}@*/
{
typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::BaseProblem> ParentType;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
// Grid dimension
enum { dimWorld = GridView::dimensionworld };
@ -146,14 +156,14 @@ class Tutorial1Problem
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
// eWoms specific types are specified via the property system
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams; /*@\label{tutorial1:matLawObjectType}@*/
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams; /*@\label{tutorial1:matLawObjectType}@*/
// phase indices
enum { numPhases = FluidSystem::numPhases };

View File

@ -33,14 +33,18 @@
BEGIN_PROPERTIES
NEW_TYPE_TAG(WaterAirProblem, INHERITS_FROM(PvsModel, WaterAirBaseProblem));
// Create new type tags
namespace TTag {
struct WaterAirProblem { using InheritsFrom = std::tuple<WaterAirBaseProblem, PvsModel>; };
} // end namespace TTag
SET_BOOL_PROP(WaterAirProblem, EnableEnergy, true);
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::WaterAirProblem> { static constexpr bool value = true; };
END_PROPERTIES
int main(int argc, char **argv)
{
typedef TTAG(WaterAirProblem) ProblemTypeTag;
typedef Opm::Properties::TTag::WaterAirProblem ProblemTypeTag;
return Opm::start<ProblemTypeTag>(argc, argv);
}

View File

@ -42,28 +42,28 @@ namespace Opm {
* \brief Implements a boundary vector for the fully implicit black-oil model.
*/
template <class TypeTag>
class BlackOilBoundaryRateVector : public GET_PROP_TYPE(TypeTag, RateVector)
class BlackOilBoundaryRateVector : public GetPropType<TypeTag, Properties::RateVector>
{
typedef typename GET_PROP_TYPE(TypeTag, RateVector) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, LocalResidual) LocalResidual;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::RateVector> ParentType;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::LocalResidual> LocalResidual;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
enum { conti0EqIdx = Indices::conti0EqIdx };
enum { contiEnergyEqIdx = Indices::contiEnergyEqIdx };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
static constexpr bool blackoilConserveSurfaceVolume = GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume);
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
typedef Opm::BlackOilEnergyModule<TypeTag, enableEnergy> EnergyModule;

View File

@ -55,21 +55,21 @@ namespace Opm {
* \brief Contains the high level supplements required to extend the black oil
* model by brine.
*/
template <class TypeTag, bool enableBrineV = GET_PROP_VALUE(TypeTag, EnableBrine)>
template <class TypeTag, bool enableBrineV = getPropValue<TypeTag, Properties::EnableBrine>()>
class BlackOilBrineModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -82,7 +82,7 @@ class BlackOilBrineModule
static constexpr unsigned enableBrine = enableBrineV;
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
static constexpr unsigned numPhases = FluidSystem::numPhases;
public:
@ -337,22 +337,22 @@ BlackOilBrineModule<TypeTag, enableBrineV>::referencePressure_;
* \brief Provides the volumetric quantities required for the equations needed by the
* brine extension of the black-oil model.
*/
template <class TypeTag, bool enableBrineV = GET_PROP_VALUE(TypeTag, EnableBrine)>
template <class TypeTag, bool enableBrineV = getPropValue<TypeTag, Properties::EnableBrine>()>
class BlackOilBrineIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef BlackOilBrineModule<TypeTag> BrineModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
static constexpr int saltConcentrationIdx = Indices::saltConcentrationIdx;
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
@ -396,9 +396,9 @@ protected:
template <class TypeTag>
class BlackOilBrineIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
void updateSaltConcentration_(const ElementContext& elemCtx OPM_UNUSED,

View File

@ -70,9 +70,9 @@ struct BlackOilDarcyFluxModule
template <class TypeTag>
class BlackOilDarcyExtensiveQuantities : public DarcyExtensiveQuantities<TypeTag>
{
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
public:
/*!

View File

@ -48,27 +48,27 @@ namespace Opm {
* \brief Contains the high level supplements required to extend the black oil
* model by energy.
*/
template <class TypeTag, bool enableEnergyV = GET_PROP_VALUE(TypeTag, EnableEnergy)>
template <class TypeTag, bool enableEnergyV = getPropValue<TypeTag, Properties::EnableEnergy>()>
class BlackOilEnergyModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
static constexpr unsigned temperatureIdx = Indices::temperatureIdx;
static constexpr unsigned contiEnergyEqIdx = Indices::contiEnergyEqIdx;
static constexpr unsigned enableEnergy = enableEnergyV;
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
static constexpr unsigned numPhases = FluidSystem::numPhases;
public:
@ -170,7 +170,7 @@ public:
Scalar refPoro = intQuants.referencePorosity();
const auto& uRock = Opm::decay<LhsEval>(intQuants.rockInternalEnergy());
storage[contiEnergyEqIdx] += (1.0 - refPoro)*uRock;
storage[contiEnergyEqIdx] *= GET_PROP_VALUE(TypeTag, BlackOilEnergyScalingFactor);
storage[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
}
static void computeFlux(RateVector& flux,
@ -198,7 +198,7 @@ public:
// diffusive energy flux
flux[contiEnergyEqIdx] += extQuants.energyFlux();
flux[contiEnergyEqIdx] *= GET_PROP_VALUE(TypeTag, BlackOilEnergyScalingFactor);
flux[contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
}
template <class UpstreamEval>
@ -324,23 +324,23 @@ public:
* \brief Provides the volumetric quantities required for the equations needed by the
* energys extension of the black-oil model.
*/
template <class TypeTag, bool enableEnergyV = GET_PROP_VALUE(TypeTag, EnableEnergy)>
template <class TypeTag, bool enableEnergyV = getPropValue<TypeTag, Properties::EnableEnergy>()>
class BlackOilEnergyIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLaw) SolidEnergyLaw;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLaw) ThermalConductionLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::SolidEnergyLaw> SolidEnergyLaw;
typedef GetPropType<TypeTag, Properties::ThermalConductionLaw> ThermalConductionLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef BlackOilEnergyModule<TypeTag> EnergyModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
static constexpr int temperatureIdx = Indices::temperatureIdx;
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
@ -407,14 +407,14 @@ protected:
template <class TypeTag>
class BlackOilEnergyIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
static constexpr bool enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature);
static constexpr bool enableTemperature = getPropValue<TypeTag, Properties::EnableTemperature>();
public:
void updateTemperature_(const ElementContext& elemCtx,
@ -457,18 +457,18 @@ protected:
* \brief Provides the energy specific extensive quantities to the generic black-oil
* module's extensive quantities.
*/
template <class TypeTag, bool enableEnergyV = GET_PROP_VALUE(TypeTag, EnableEnergy)>
template <class TypeTag, bool enableEnergyV = getPropValue<TypeTag, Properties::EnableEnergy>()>
class BlackOilEnergyExtensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -597,8 +597,8 @@ private:
template <class TypeTag>
class BlackOilEnergyExtensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
public:
void updateEnergy(const ElementContext& elemCtx OPM_UNUSED,

View File

@ -57,9 +57,9 @@ class BlackOilExtensiveQuantities
{
typedef MultiPhaseBaseExtensiveQuantities<TypeTag> MultiPhaseParent;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
/*!

View File

@ -57,21 +57,21 @@ namespace Opm {
* \brief Contains the high level supplements required to extend the black oil
* model to include the effects of foam.
*/
template <class TypeTag, bool enableFoamV = GET_PROP_VALUE(TypeTag, EnableFoam)>
template <class TypeTag, bool enableFoamV = getPropValue<TypeTag, Properties::EnableFoam>()>
class BlackOilFoamModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -82,9 +82,9 @@ class BlackOilFoamModule
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
static constexpr unsigned enableFoam = enableFoamV;
static constexpr bool enableVtkOutput = GET_PROP_VALUE(TypeTag, EnableVtkOutput);
static constexpr bool enableVtkOutput = getPropValue<TypeTag, Properties::EnableVtkOutput>();
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
static constexpr unsigned numPhases = FluidSystem::numPhases;
public:
@ -478,22 +478,22 @@ BlackOilFoamModule<TypeTag, enableFoam>::gasMobilityMultiplierTable_;
* \brief Provides the volumetric quantities required for the equations needed by the
* polymers extension of the black-oil model.
*/
template <class TypeTag, bool enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam)>
template <class TypeTag, bool enableFoam = getPropValue<TypeTag, Properties::EnableFoam>()>
class BlackOilFoamIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef BlackOilFoamModule<TypeTag> FoamModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
static constexpr int foamConcentrationIdx = Indices::foamConcentrationIdx;
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr unsigned oilPhaseIdx = FluidSystem::oilPhaseIdx;
@ -589,9 +589,9 @@ protected:
template <class TypeTag>
class BlackOilFoamIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
void foamPropertiesUpdate_(const ElementContext& elemCtx OPM_UNUSED,

View File

@ -52,36 +52,36 @@ namespace Opm {
*/
template <class TypeTag>
class BlackOilIntensiveQuantities
: public GET_PROP_TYPE(TypeTag, DiscIntensiveQuantities)
, public GET_PROP_TYPE(TypeTag, FluxModule)::FluxIntensiveQuantities
: public GetPropType<TypeTag, Properties::DiscIntensiveQuantities>
, public GetPropType<TypeTag, Properties::FluxModule>::FluxIntensiveQuantities
, public BlackOilSolventIntensiveQuantities<TypeTag>
, public BlackOilPolymerIntensiveQuantities<TypeTag>
, public BlackOilFoamIntensiveQuantities<TypeTag>
, public BlackOilBrineIntensiveQuantities<TypeTag>
, public BlackOilEnergyIntensiveQuantities<TypeTag>
{
typedef typename GET_PROP_TYPE(TypeTag, DiscIntensiveQuantities) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::DiscIntensiveQuantities> ParentType;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluxModule) FluxModule;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::FluxModule> FluxModule;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
enum { enableTemperature = GET_PROP_VALUE(TypeTag, EnableTemperature) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
enum { enableTemperature = getPropValue<TypeTag, Properties::EnableTemperature>() };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
enum { waterCompIdx = FluidSystem::waterCompIdx };
enum { oilCompIdx = FluidSystem::oilCompIdx };
enum { gasCompIdx = FluidSystem::gasCompIdx };

View File

@ -44,22 +44,22 @@ namespace Opm {
* \brief Calculates the local residual of the black oil model.
*/
template <class TypeTag>
class BlackOilLocalResidual : public GET_PROP_TYPE(TypeTag, DiscLocalResidual)
class BlackOilLocalResidual : public GetPropType<TypeTag, Properties::DiscLocalResidual>
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { conti0EqIdx = Indices::conti0EqIdx };
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
@ -75,8 +75,8 @@ class BlackOilLocalResidual : public GET_PROP_TYPE(TypeTag, DiscLocalResidual)
static const bool oilEnabled = Indices::oilEnabled;
static const bool compositionSwitchEnabled = (compositionSwitchIdx >= 0);
static constexpr bool blackoilConserveSurfaceVolume = GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume);
static constexpr bool enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy);
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
static constexpr bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef BlackOilSolventModule<TypeTag> SolventModule;
@ -212,7 +212,7 @@ public:
// scale the source term of the energy equation
if (enableEnergy)
source[Indices::contiEnergyEqIdx] *= GET_PROP_VALUE(TypeTag, BlackOilEnergyScalingFactor);
source[Indices::contiEnergyEqIdx] *= getPropValue<TypeTag, Properties::BlackOilEnergyScalingFactor>();
}
/*!

View File

@ -81,63 +81,80 @@ SET_TYPE_PROP(BlackOilModel, LocalResidual,
Opm::BlackOilLocalResidual<TypeTag>);
//! Use the black-oil specific newton method
SET_TYPE_PROP(BlackOilModel, NewtonMethod, Opm::BlackOilNewtonMethod<TypeTag>);
template<class TypeTag>
struct NewtonMethod<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilNewtonMethod<TypeTag>; };
//! The Model property
SET_TYPE_PROP(BlackOilModel, Model, Opm::BlackOilModel<TypeTag>);
template<class TypeTag>
struct Model<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilModel<TypeTag>; };
//! The Problem property
SET_TYPE_PROP(BlackOilModel, BaseProblem, Opm::BlackOilProblem<TypeTag>);
template<class TypeTag>
struct BaseProblem<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilProblem<TypeTag>; };
//! the RateVector property
SET_TYPE_PROP(BlackOilModel, RateVector, Opm::BlackOilRateVector<TypeTag>);
template<class TypeTag>
struct RateVector<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilRateVector<TypeTag>; };
//! the BoundaryRateVector property
SET_TYPE_PROP(BlackOilModel, BoundaryRateVector, Opm::BlackOilBoundaryRateVector<TypeTag>);
template<class TypeTag>
struct BoundaryRateVector<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilBoundaryRateVector<TypeTag>; };
//! the PrimaryVariables property
SET_TYPE_PROP(BlackOilModel, PrimaryVariables, Opm::BlackOilPrimaryVariables<TypeTag>);
template<class TypeTag>
struct PrimaryVariables<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilPrimaryVariables<TypeTag>; };
//! the IntensiveQuantities property
SET_TYPE_PROP(BlackOilModel, IntensiveQuantities, Opm::BlackOilIntensiveQuantities<TypeTag>);
template<class TypeTag>
struct IntensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilIntensiveQuantities<TypeTag>; };
//! the ExtensiveQuantities property
SET_TYPE_PROP(BlackOilModel, ExtensiveQuantities, Opm::BlackOilExtensiveQuantities<TypeTag>);
template<class TypeTag>
struct ExtensiveQuantities<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilExtensiveQuantities<TypeTag>; };
//! Use the the velocity module which is aware of the black-oil specific model extensions
//! (i.e., the polymer and solvent extensions)
SET_TYPE_PROP(BlackOilModel, FluxModule, Opm::BlackOilDarcyFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilDarcyFluxModule<TypeTag>; };
//! The indices required by the model
SET_TYPE_PROP(BlackOilModel, Indices,
Opm::BlackOilIndices<GET_PROP_VALUE(TypeTag, EnableSolvent),
GET_PROP_VALUE(TypeTag, EnablePolymer),
GET_PROP_VALUE(TypeTag, EnableEnergy),
GET_PROP_VALUE(TypeTag, EnableFoam),
GET_PROP_VALUE(TypeTag, EnableBrine),
Opm::BlackOilIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableFoam>(),
getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0>);
//! Set the fluid system to the black-oil fluid system by default
SET_PROP(BlackOilModel, FluidSystem)
template<class TypeTag>
struct FluidSystem<TypeTag, TTag::BlackOilModel>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
public:
typedef Opm::BlackOilFluidSystem<Scalar> type;
};
// by default, all ECL extension modules are disabled
SET_BOOL_PROP(BlackOilModel, EnableSolvent, false);
SET_BOOL_PROP(BlackOilModel, EnablePolymer, false);
SET_BOOL_PROP(BlackOilModel, EnablePolymerMW, false);
SET_BOOL_PROP(BlackOilModel, EnableFoam, false);
SET_BOOL_PROP(BlackOilModel, EnableBrine, false);
template<class TypeTag>
struct EnableSolvent<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
template<class TypeTag>
struct EnablePolymer<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
template<class TypeTag>
struct EnablePolymerMW<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableFoam<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableBrine<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
//! By default, the blackoil model is isothermal and does not conserve energy
SET_BOOL_PROP(BlackOilModel, EnableTemperature, false);
SET_BOOL_PROP(BlackOilModel, EnableEnergy, false);
template<class TypeTag>
struct EnableTemperature<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
//! by default, scale the energy equation by the inverse of the energy required to heat
//! up one kg of water by 30 Kelvin. If we conserve surface volumes, this must be divided
@ -145,11 +162,12 @@ SET_BOOL_PROP(BlackOilModel, EnableEnergy, false);
//! solvers that do not weight the components of the solutions do the right thing.
//! by default, don't scale the energy equation, i.e. assume that a reasonable linear
//! solver is used. (Not scaling it makes debugging quite a bit easier.)
SET_PROP(BlackOilModel, BlackOilEnergyScalingFactor)
template<class TypeTag>
struct BlackOilEnergyScalingFactor<TypeTag, TTag::BlackOilModel>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
static constexpr Scalar alpha = GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume) ? 1000.0 : 1.0;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
static constexpr Scalar alpha = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>() ? 1000.0 : 1.0;
public:
typedef Scalar type;
@ -158,7 +176,8 @@ public:
// by default, ebos formulates the conservation equations in terms of mass not surface
// volumes
SET_BOOL_PROP(BlackOilModel, BlackoilConserveSurfaceVolume, false);
template<class TypeTag>
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::BlackOilModel> { static constexpr bool value = false; };
END_PROPERTIES
@ -219,7 +238,8 @@ namespace Opm {
* \c FluxModule property. For example, the velocity model can by
* changed to the Forchheimer approach by
* \code
* SET_TYPE_PROP(MyProblemTypeTag, FluxModule, Opm::ForchheimerFluxModule<TypeTag>);
* template<class TypeTag>
struct FluxModule<TypeTag, TTag::MyProblemTypeTag> { using type = Opm::ForchheimerFluxModule<TypeTag>; };
* \endcode
*
* The primary variables used by this model are:
@ -230,20 +250,20 @@ template<class TypeTag >
class BlackOilModel
: public MultiPhaseBaseModel<TypeTag>
{
typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
typedef GetPropType<TypeTag, Properties::Model> Implementation;
typedef MultiPhaseBaseModel<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Discretization) Discretization;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Discretization> Discretization;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = FluidSystem::numComponents };
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
static const bool compositionSwitchEnabled = Indices::gasEnabled;
static const bool waterEnabled = Indices::waterEnabled;
@ -383,7 +403,7 @@ public:
// we do not care much about water, so it gets de-prioritized by a factor of 100
static constexpr Scalar waterPriority = 1e-2;
if (GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume)) {
if (getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>()) {
// Roughly convert the surface volume of the fluids from m^3 to kg. (in this
// context, it does not really matter if the actual densities are off by a
// factor of two or three.)

View File

@ -40,15 +40,20 @@ BEGIN_PROPERTIES
template <class TypeTag, class MyTypeTag>
struct DiscNewtonMethod;
NEW_PROP_TAG(DpMaxRel);
NEW_PROP_TAG(DsMax);
NEW_PROP_TAG(PriVarOscilationThreshold);
NEW_PROP_TAG(ProjectSaturations);
template<class TypeTag, class MyTypeTag>
struct DpMaxRel { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct DsMax { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct PriVarOscilationThreshold { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct ProjectSaturations { using type = UndefinedProperty; };
SET_SCALAR_PROP(NewtonMethod, DpMaxRel, 0.3);
SET_SCALAR_PROP(NewtonMethod, DsMax, 0.2);
SET_SCALAR_PROP(NewtonMethod, PriVarOscilationThreshold, 1e-5);
SET_BOOL_PROP(NewtonMethod, ProjectSaturations, false);
template<class TypeTag>
struct ProjectSaturations<TypeTag, TTag::NewtonMethod> { static constexpr bool value = false; };
END_PROPERTIES
@ -60,19 +65,19 @@ namespace Opm {
* \brief A newton solver which is specific to the black oil model.
*/
template <class TypeTag>
class BlackOilNewtonMethod : public GET_PROP_TYPE(TypeTag, DiscNewtonMethod)
class BlackOilNewtonMethod : public GetPropType<TypeTag, Properties::DiscNewtonMethod>
{
typedef typename GET_PROP_TYPE(TypeTag, DiscNewtonMethod) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, GlobalEqVector) GlobalEqVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Linearizer) Linearizer;
typedef GetPropType<TypeTag, Properties::DiscNewtonMethod> ParentType;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::SolutionVector> SolutionVector;
typedef GetPropType<TypeTag, Properties::GlobalEqVector> GlobalEqVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Linearizer> Linearizer;
static const unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static const unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
public:
BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator)

View File

@ -58,21 +58,21 @@ namespace Opm {
* \brief Contains the high level supplements required to extend the black oil
* model by polymer.
*/
template <class TypeTag, bool enablePolymerV = GET_PROP_VALUE(TypeTag, EnablePolymer)>
template <class TypeTag, bool enablePolymerV = getPropValue<TypeTag, Properties::EnablePolymer>()>
class BlackOilPolymerModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -87,9 +87,9 @@ class BlackOilPolymerModule
static constexpr unsigned enablePolymer = enablePolymerV;
static constexpr bool enablePolymerMolarWeight = GET_PROP_VALUE(TypeTag, EnablePolymerMW);
static constexpr bool enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>();
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
static constexpr unsigned numPhases = FluidSystem::numPhases;
struct SkprpolyTable {
@ -1011,25 +1011,25 @@ BlackOilPolymerModule<TypeTag, enablePolymerV>::skprpolyTables_;
* \brief Provides the volumetric quantities required for the equations needed by the
* polymers extension of the black-oil model.
*/
template <class TypeTag, bool enablePolymerV = GET_PROP_VALUE(TypeTag, EnablePolymer)>
template <class TypeTag, bool enablePolymerV = getPropValue<TypeTag, Properties::EnablePolymer>()>
class BlackOilPolymerIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
static constexpr int polymerConcentrationIdx = Indices::polymerConcentrationIdx;
static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr bool enablePolymerMolarWeight = GET_PROP_VALUE(TypeTag, EnablePolymerMW);
static constexpr bool enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>();
static constexpr int polymerMoleWeightIdx = Indices::polymerMoleWeightIdx;
@ -1154,9 +1154,9 @@ protected:
template <class TypeTag>
class BlackOilPolymerIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
void polymerPropertiesUpdate_(const ElementContext& elemCtx OPM_UNUSED,
@ -1194,18 +1194,18 @@ public:
* \brief Provides the polymer specific extensive quantities to the generic black-oil
* module's extensive quantities.
*/
template <class TypeTag, bool enablePolymerV = GET_PROP_VALUE(TypeTag, EnablePolymer)>
template <class TypeTag, bool enablePolymerV = getPropValue<TypeTag, Properties::EnablePolymer>()>
class BlackOilPolymerExtensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
static constexpr unsigned gasPhaseIdx = FluidSystem::gasPhaseIdx;
static constexpr int dimWorld = GridView::dimensionworld;
@ -1320,8 +1320,8 @@ private:
template <class TypeTag>
class BlackOilPolymerExtensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
public:
void updateShearMultipliers(const ElementContext& elemCtx OPM_UNUSED,

View File

@ -64,18 +64,18 @@ template <class TypeTag>
class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
{
typedef FvBasePrimaryVariables<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) Implementation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::Problem> Problem;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
// number of equations
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
// primary variable indices
enum { waterSaturationIdx = Indices::waterSaturationIdx };
@ -86,18 +86,18 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
static const bool waterEnabled = Indices::waterEnabled;
// phase indices from the fluid system
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
// component indices from the fluid system
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
enum { gasCompIdx = FluidSystem::gasCompIdx };
enum { waterCompIdx = FluidSystem::waterCompIdx };
enum { oilCompIdx = FluidSystem::oilCompIdx };

View File

@ -45,10 +45,10 @@ class BlackOilProblem : public MultiPhaseBaseProblem<TypeTag>
{
private:
typedef MultiPhaseBaseProblem<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef GetPropType<TypeTag, Properties::Problem> Implementation;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
public:
/*!

View File

@ -35,24 +35,32 @@ BEGIN_PROPERTIES
//! Specifies if the simulation should write output files that are
//! compatible with those produced by the commercial Eclipse simulator
NEW_PROP_TAG(EnableEclipseOutput);
template<class TypeTag, class MyTypeTag>
struct EnableEclipseOutput { using type = UndefinedProperty; };
//! Enable the ECL-blackoil extension for solvents. ("Second gas")
NEW_PROP_TAG(EnableSolvent);
template<class TypeTag, class MyTypeTag>
struct EnableSolvent { using type = UndefinedProperty; };
//! Enable the ECL-blackoil extension for polymer.
NEW_PROP_TAG(EnablePolymer);
template<class TypeTag, class MyTypeTag>
struct EnablePolymer { using type = UndefinedProperty; };
//! Enable the tracking polymer molecular weight tracking and related functionalities
NEW_PROP_TAG(EnablePolymerMW);
template<class TypeTag, class MyTypeTag>
struct EnablePolymerMW { using type = UndefinedProperty; };
//! Enable surface volume scaling
NEW_PROP_TAG(BlackoilConserveSurfaceVolume);
template<class TypeTag, class MyTypeTag>
struct BlackoilConserveSurfaceVolume { using type = UndefinedProperty; };
//! Enable the ECL-blackoil extension for foam
NEW_PROP_TAG(EnableFoam);
template<class TypeTag, class MyTypeTag>
struct EnableFoam { using type = UndefinedProperty; };
//! Enable the ECL-blackoil extension for salt
NEW_PROP_TAG(EnableBrine);
template<class TypeTag, class MyTypeTag>
struct EnableBrine { using type = UndefinedProperty; };
//! Allow the spatial and temporal domains to exhibit non-constant temperature
//! in the black-oil model
NEW_PROP_TAG(EnableTemperature);
template<class TypeTag, class MyTypeTag>
struct EnableTemperature { using type = UndefinedProperty; };
//! The relative weight of the residual of the energy equation compared to the mass
//! residuals
@ -61,7 +69,8 @@ NEW_PROP_TAG(EnableTemperature);
//! of unmodified dune-istl linear solvers cannot weight the individual equations. if the
//! energy equation is not scaled, its absolute value is normally several orders of
//! magnitude larger than that of the mass balance equations
NEW_PROP_TAG(BlackOilEnergyScalingFactor);
template<class TypeTag, class MyTypeTag>
struct BlackOilEnergyScalingFactor { using type = UndefinedProperty; };
END_PROPERTIES

View File

@ -48,29 +48,29 @@ namespace Opm {
*/
template <class TypeTag>
class BlackOilRateVector
: public Dune::FieldVector<typename GET_PROP_TYPE(TypeTag, Evaluation),
GET_PROP_VALUE(TypeTag, NumEq)>
: public Dune::FieldVector<GetPropType<TypeTag, Properties::Evaluation>,
getPropValue<TypeTag, Properties::NumEq>()>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef BlackOilSolventModule<TypeTag> SolventModule;
typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef BlackOilFoamModule<TypeTag> FoamModule;
typedef BlackOilBrineModule<TypeTag> BrineModule;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
enum { conti0EqIdx = Indices::conti0EqIdx };
enum { contiEnergyEqIdx = Indices::contiEnergyEqIdx };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { enableSolvent = GET_PROP_VALUE(TypeTag, EnableSolvent) };
enum { enablePolymer = GET_PROP_VALUE(TypeTag, EnablePolymer) };
enum { enablePolymerMolarWeight = GET_PROP_VALUE(TypeTag, EnablePolymerMW) };
enum { enableFoam = GET_PROP_VALUE(TypeTag, EnableFoam) };
enum { enableBrine = GET_PROP_VALUE(TypeTag, EnableBrine) };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
enum { enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>() };
enum { enablePolymer = getPropValue<TypeTag, Properties::EnablePolymer>() };
enum { enablePolymerMolarWeight = getPropValue<TypeTag, Properties::EnablePolymerMW>() };
enum { enableFoam = getPropValue<TypeTag, Properties::EnableFoam>() };
enum { enableBrine = getPropValue<TypeTag, Properties::EnableBrine>() };
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef Dune::FieldVector<Evaluation, numEq> ParentType;
@ -93,7 +93,7 @@ public:
ParentType::operator=(value);
// convert to "surface volume" if requested
if (GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume)) {
if (getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>()) {
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
(*this)[FluidSystem::gasCompIdx] /=
FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, pvtRegionIdx);
@ -146,7 +146,7 @@ public:
}
// convert to "surface volume" if requested
if (GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume)) {
if (getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>()) {
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
(*this)[FluidSystem::gasCompIdx] /=
FluidSystem::referenceDensity(FluidSystem::gasPhaseIdx, pvtRegionIdx);

View File

@ -62,21 +62,21 @@ namespace Opm {
* \brief Contains the high level supplements required to extend the black oil
* model by solvents.
*/
template <class TypeTag, bool enableSolventV = GET_PROP_VALUE(TypeTag, EnableSolvent)>
template <class TypeTag, bool enableSolventV = getPropValue<TypeTag, Properties::EnableSolvent>()>
class BlackOilSolventModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef Opm::SolventPvt<Scalar> SolventPvt;
@ -86,9 +86,9 @@ class BlackOilSolventModule
static constexpr unsigned solventSaturationIdx = Indices::solventSaturationIdx;
static constexpr unsigned contiSolventEqIdx = Indices::contiSolventEqIdx;
static constexpr unsigned enableSolvent = enableSolventV;
static constexpr unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static constexpr unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
static constexpr unsigned numPhases = FluidSystem::numPhases;
static constexpr bool blackoilConserveSurfaceVolume = GET_PROP_VALUE(TypeTag, BlackoilConserveSurfaceVolume);
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
public:
@ -866,22 +866,22 @@ BlackOilSolventModule<TypeTag, enableSolventV>::isMiscible_;
* \brief Provides the volumetric quantities required for the equations needed by the
* solvents extension of the black-oil model.
*/
template <class TypeTag, bool enableSolventV = GET_PROP_VALUE(TypeTag, EnableSolvent)>
template <class TypeTag, bool enableSolventV = getPropValue<TypeTag, Properties::EnableSolvent>()>
class BlackOilSolventIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef BlackOilSolventModule<TypeTag> SolventModule;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
static constexpr int solventSaturationIdx = Indices::solventSaturationIdx;
static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx;
static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx;
@ -1265,9 +1265,9 @@ protected:
template <class TypeTag>
class BlackOilSolventIntensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
@ -1312,18 +1312,18 @@ public:
* \brief Provides the solvent specific extensive quantities to the generic black-oil
* module's extensive quantities.
*/
template <class TypeTag, bool enableSolventV = GET_PROP_VALUE(TypeTag, EnableSolvent)>
template <class TypeTag, bool enableSolventV = getPropValue<TypeTag, Properties::EnableSolvent>()>
class BlackOilSolventExtensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -1541,8 +1541,8 @@ private:
template <class TypeTag>
class BlackOilSolventExtensiveQuantities<TypeTag, false>
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
public:
void updateVolumeFluxPerm(const ElementContext& elemCtx OPM_UNUSED,

View File

@ -87,7 +87,7 @@ class DarcyBaseProblem
template <class TypeTag>
class DarcyIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
protected:
void update_(const ElementContext& elemCtx OPM_UNUSED,
unsigned dofIdx OPM_UNUSED,
@ -114,16 +114,16 @@ protected:
template <class TypeTag>
class DarcyExtensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
enum { dimWorld = GridView::dimensionworld };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
typedef typename Opm::MathToolbox<Evaluation> Toolbox;
typedef typename FluidSystem::template ParameterCache<Evaluation> ParameterCache;

View File

@ -54,9 +54,9 @@ class DiffusionModule;
template <class TypeTag>
class DiffusionModule<TypeTag, /*enableDiffusion=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
public:
/*!
@ -83,11 +83,11 @@ public:
template <class TypeTag>
class DiffusionModule<TypeTag, /*enableDiffusion=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum { numPhases = FluidSystem::numPhases };
enum { numComponents = FluidSystem::numComponents };
@ -147,9 +147,9 @@ class DiffusionIntensiveQuantities;
template <class TypeTag>
class DiffusionIntensiveQuantities<TypeTag, /*enableDiffusion=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
public:
/*!
@ -202,10 +202,10 @@ protected:
template <class TypeTag>
class DiffusionIntensiveQuantities<TypeTag, /*enableDiffusion=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { numPhases = FluidSystem::numPhases };
enum { numComponents = FluidSystem::numComponents };
@ -292,9 +292,9 @@ class DiffusionExtensiveQuantities;
template <class TypeTag>
class DiffusionExtensiveQuantities<TypeTag, /*enableDiffusion=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
protected:
/*!
@ -348,14 +348,14 @@ public:
template <class TypeTag>
class DiffusionExtensiveQuantities<TypeTag, /*enableDiffusion=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
enum { dimWorld = GridView::dimensionworld };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numComponents = GET_PROP_VALUE(TypeTag, NumComponents) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
typedef Dune::FieldVector<Scalar, dimWorld> DimVector;
typedef Dune::FieldVector<Evaluation, dimWorld> DimEvalVector;

View File

@ -55,16 +55,16 @@ class EnergyModule;
template <class TypeTag>
class EnergyModule<TypeTag, /*enableEnergy=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
typedef Dune::FieldVector<Evaluation, numEq> EvalEqVector;
@ -222,18 +222,18 @@ public:
template <class TypeTag>
class EnergyModule<TypeTag, /*enableEnergy=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::Model> Model;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
enum { numPhases = FluidSystem::numPhases };
enum { energyEqIdx = Indices::energyEqIdx };
enum { temperatureIdx = Indices::temperatureIdx };
@ -537,10 +537,10 @@ class EnergyIntensiveQuantities;
template <class TypeTag>
class EnergyIntensiveQuantities<TypeTag, /*enableEnergy=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::MathToolbox<Evaluation> Toolbox;
@ -596,13 +596,13 @@ protected:
template <class TypeTag>
class EnergyIntensiveQuantities<TypeTag, /*enableEnergy=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLaw) ThermalConductionLaw;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLaw) SolidEnergyLaw;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::ThermalConductionLaw> ThermalConductionLaw;
typedef GetPropType<TypeTag, Properties::SolidEnergyLaw> SolidEnergyLaw;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
enum { numPhases = FluidSystem::numPhases };
enum { energyEqIdx = Indices::energyEqIdx };
@ -701,8 +701,8 @@ class EnergyExtensiveQuantities;
template <class TypeTag>
class EnergyExtensiveQuantities<TypeTag, /*enableEnergy=*/false>
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
protected:
/*!
@ -747,10 +747,10 @@ public:
template <class TypeTag>
class EnergyExtensiveQuantities<TypeTag, /*enableEnergy=*/true>
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
enum { dimWorld = GridView::dimensionworld };
typedef Dune::FieldVector<Evaluation, dimWorld> EvalDimVector;

View File

@ -79,8 +79,8 @@ struct ForchheimerFluxModule
template <class TypeTag>
class ForchheimerBaseProblem
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
public:
/*!
@ -128,11 +128,11 @@ public:
template <class TypeTag>
class ForchheimerIntensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
public:
/*!
@ -214,16 +214,16 @@ class ForchheimerExtensiveQuantities
: public DarcyExtensiveQuantities<TypeTag>
{
typedef DarcyExtensiveQuantities<TypeTag> DarcyExtQuants;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) Implementation;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> Implementation;
enum { dimWorld = GridView::dimensionworld };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
typedef Opm::MathToolbox<Evaluation> Toolbox;

View File

@ -48,17 +48,17 @@ namespace Opm {
*/
template <class TypeTag>
class MultiPhaseBaseExtensiveQuantities
: public GET_PROP_TYPE(TypeTag, DiscExtensiveQuantities)
, public GET_PROP_TYPE(TypeTag, FluxModule)::FluxExtensiveQuantities
: public GetPropType<TypeTag, Properties::DiscExtensiveQuantities>
, public GetPropType<TypeTag, Properties::FluxModule>::FluxExtensiveQuantities
{
typedef typename GET_PROP_TYPE(TypeTag, DiscExtensiveQuantities) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::DiscExtensiveQuantities> ParentType;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
typedef typename GET_PROP_TYPE(TypeTag, FluxModule) FluxModule;
typedef GetPropType<TypeTag, Properties::FluxModule> FluxModule;
typedef typename FluxModule::FluxExtensiveQuantities FluxExtensiveQuantities;
public:

View File

@ -53,7 +53,10 @@ class MultiPhaseBaseModel;
BEGIN_PROPERTIES
//! The generic type tag for problems using the immiscible multi-phase model
NEW_TYPE_TAG(MultiPhaseBaseModel, INHERITS_FROM(VtkMultiPhase, VtkTemperature));
// Create new type tags
namespace TTag {
struct MultiPhaseBaseModel { using InheritsFrom = std::tuple<VtkTemperature, VtkMultiPhase>; };
} // end namespace TTag
//! Specify the splices of the MultiPhaseBaseModel type tag
SET_SPLICES(MultiPhaseBaseModel, SpatialDiscretizationSplice);
@ -64,26 +67,32 @@ SET_SPLICES(MultiPhaseBaseModel, SpatialDiscretizationSplice);
SET_TAG_PROP(MultiPhaseBaseModel, SpatialDiscretizationSplice, VcfvDiscretization);
//! set the number of equations to the number of phases
SET_INT_PROP(MultiPhaseBaseModel, NumEq, GET_PROP_TYPE(TypeTag, Indices)::numEq);
template<class TypeTag>
struct NumEq<TypeTag, TTag::MultiPhaseBaseModel> { static constexpr int value = GetPropType<TypeTag, Properties::Indices>::numEq; };
//! The number of phases is determined by the fluid system
SET_INT_PROP(MultiPhaseBaseModel, NumPhases, GET_PROP_TYPE(TypeTag, FluidSystem)::numPhases);
template<class TypeTag>
struct NumPhases<TypeTag, TTag::MultiPhaseBaseModel> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numPhases; };
//! Number of chemical species in the system
SET_INT_PROP(MultiPhaseBaseModel, NumComponents, GET_PROP_TYPE(TypeTag, FluidSystem)::numComponents);
template<class TypeTag>
struct NumComponents<TypeTag, TTag::MultiPhaseBaseModel> { static constexpr int value = GetPropType<TypeTag, Properties::FluidSystem>::numComponents; };
//! The type of the base base class for actual problems
SET_TYPE_PROP(MultiPhaseBaseModel, BaseProblem, Opm::MultiPhaseBaseProblem<TypeTag>);
template<class TypeTag>
struct BaseProblem<TypeTag, TTag::MultiPhaseBaseModel> { using type = Opm::MultiPhaseBaseProblem<TypeTag>; };
//! By default, use the Darcy relation to determine the phase velocity
SET_TYPE_PROP(MultiPhaseBaseModel, FluxModule, Opm::DarcyFluxModule<TypeTag>);
template<class TypeTag>
struct FluxModule<TypeTag, TTag::MultiPhaseBaseModel> { using type = Opm::DarcyFluxModule<TypeTag>; };
/*!
* \brief Set the material law to the null law by default.
*/
SET_PROP(MultiPhaseBaseModel, MaterialLaw)
template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::MultiPhaseBaseModel>
{
private:
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef Opm::NullMaterialTraits<Scalar, FluidSystem::numPhases> Traits;
public:
@ -96,33 +105,34 @@ public:
*/
SET_TYPE_PROP(MultiPhaseBaseModel,
MaterialLawParams,
typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params);
typename GetPropType<TypeTag, Properties::MaterialLaw>::Params);
//! set the energy storage law for the solid to the one which assumes zero heat capacity
//! by default
SET_TYPE_PROP(MultiPhaseBaseModel,
SolidEnergyLaw,
Opm::NullSolidEnergyLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::NullSolidEnergyLaw<GetPropType<TypeTag, Properties::Scalar>>);
//! extract the type of the parameter objects for the solid energy storage law from the
//! law itself
SET_TYPE_PROP(MultiPhaseBaseModel,
SolidEnergyLawParams,
typename GET_PROP_TYPE(TypeTag, SolidEnergyLaw)::Params);
typename GetPropType<TypeTag, Properties::SolidEnergyLaw>::Params);
//! set the thermal conduction law to a dummy one by default
SET_TYPE_PROP(MultiPhaseBaseModel,
ThermalConductionLaw,
Opm::NullThermalConductionLaw<typename GET_PROP_TYPE(TypeTag, Scalar)>);
Opm::NullThermalConductionLaw<GetPropType<TypeTag, Properties::Scalar>>);
//! extract the type of the parameter objects for the thermal conduction law from the law
//! itself
SET_TYPE_PROP(MultiPhaseBaseModel,
ThermalConductionLawParams,
typename GET_PROP_TYPE(TypeTag, ThermalConductionLaw)::Params);
typename GetPropType<TypeTag, Properties::ThermalConductionLaw>::Params);
//! disable gravity by default
SET_BOOL_PROP(MultiPhaseBaseModel, EnableGravity, false);
template<class TypeTag>
struct EnableGravity<TypeTag, TTag::MultiPhaseBaseModel> { static constexpr bool value = false; };
END_PROPERTIES
@ -135,23 +145,23 @@ namespace Opm {
* which assume multiple fluid phases.
*/
template <class TypeTag>
class MultiPhaseBaseModel : public GET_PROP_TYPE(TypeTag, Discretization)
class MultiPhaseBaseModel : public GetPropType<TypeTag, Properties::Discretization>
{
typedef typename GET_PROP_TYPE(TypeTag, Discretization) ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, ThreadManager) ThreadManager;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Discretization> ParentType;
typedef GetPropType<TypeTag, Properties::Model> Implementation;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::ThreadManager> ThreadManager;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
typedef typename GridView::template Codim<0>::Entity Element;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { numComponents = FluidSystem::numComponents };
public:

View File

@ -52,23 +52,23 @@ namespace Opm {
template<class TypeTag>
class MultiPhaseBaseProblem
: public FvBaseProblem<TypeTag>
, public GET_PROP_TYPE(TypeTag, FluxModule)::FluxBaseProblem
, public GetPropType<TypeTag, Properties::FluxModule>::FluxBaseProblem
{
//! \cond SKIP_THIS
typedef Opm::FvBaseProblem<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Evaluation) Evaluation;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, SolidEnergyLawParams) SolidEnergyLawParams;
typedef typename GET_PROP_TYPE(TypeTag, ThermalConductionLawParams) ThermalConductionLawParams;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw)::Params MaterialLawParams;
typedef GetPropType<TypeTag, Properties::Problem> Implementation;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Evaluation> Evaluation;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::SolidEnergyLawParams> SolidEnergyLawParams;
typedef GetPropType<TypeTag, Properties::ThermalConductionLawParams> ThermalConductionLawParams;
typedef typename GetPropType<TypeTag, Properties::MaterialLaw>::Params MaterialLawParams;
enum { dimWorld = GridView::dimensionworld };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
typedef Dune::FieldVector<Scalar, dimWorld> DimVector;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
//! \endcond

View File

@ -35,36 +35,51 @@
BEGIN_PROPERTIES
//! The splice to be used for the spatial discretization
NEW_PROP_TAG(SpatialDiscretizationSplice);
template<class TypeTag, class MyTypeTag>
struct SpatialDiscretizationSplice { using type = UndefinedProperty; };
//! Number of fluid phases in the system
NEW_PROP_TAG(NumPhases);
template<class TypeTag, class MyTypeTag>
struct NumPhases { using type = UndefinedProperty; };
//! Number of chemical species in the system
NEW_PROP_TAG(NumComponents);
template<class TypeTag, class MyTypeTag>
struct NumComponents { using type = UndefinedProperty; };
//! Enumerations used by the model
NEW_PROP_TAG(Indices);
template<class TypeTag, class MyTypeTag>
struct Indices { using type = UndefinedProperty; };
//! The material law which ought to be used (extracted from the spatial parameters)
NEW_PROP_TAG(MaterialLaw);
template<class TypeTag, class MyTypeTag>
struct MaterialLaw { using type = UndefinedProperty; };
//! The context material law (extracted from the spatial parameters)
NEW_PROP_TAG(MaterialLawParams);
template<class TypeTag, class MyTypeTag>
struct MaterialLawParams { using type = UndefinedProperty; };
//! The material law for the energy stored in the solid matrix
NEW_PROP_TAG(SolidEnergyLaw);
template<class TypeTag, class MyTypeTag>
struct SolidEnergyLaw { using type = UndefinedProperty; };
//! The parameters of the material law for energy storage of the solid
NEW_PROP_TAG(SolidEnergyLawParams);
template<class TypeTag, class MyTypeTag>
struct SolidEnergyLawParams { using type = UndefinedProperty; };
//! The material law for thermal conduction
NEW_PROP_TAG(ThermalConductionLaw);
template<class TypeTag, class MyTypeTag>
struct ThermalConductionLaw { using type = UndefinedProperty; };
//! The parameters of the material law for thermal conduction
NEW_PROP_TAG(ThermalConductionLawParams);
template<class TypeTag, class MyTypeTag>
struct ThermalConductionLawParams { using type = UndefinedProperty; };
//!The fluid systems including the information about the phases
NEW_PROP_TAG(FluidSystem);
template<class TypeTag, class MyTypeTag>
struct FluidSystem { using type = UndefinedProperty; };
//! Specifies the relation used for velocity
NEW_PROP_TAG(FluxModule);
template<class TypeTag, class MyTypeTag>
struct FluxModule { using type = UndefinedProperty; };
//! Specify whether energy should be considered as a conservation quantity or not
NEW_PROP_TAG(EnableEnergy);
template<class TypeTag, class MyTypeTag>
struct EnableEnergy { using type = UndefinedProperty; };
//! Returns whether gravity is considered in the problem
NEW_PROP_TAG(EnableGravity);
template<class TypeTag, class MyTypeTag>
struct EnableGravity { using type = UndefinedProperty; };
//! Enable diffusive fluxes?
NEW_PROP_TAG(EnableDiffusion);
template<class TypeTag, class MyTypeTag>
struct EnableDiffusion { using type = UndefinedProperty; };
END_PROPERTIES

View File

@ -46,8 +46,8 @@ namespace Opm {
template <class TypeTag>
class TemperatureCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
typedef decltype(std::declval<IQFluidState>().temperature(0)) ResultRawType;
@ -82,8 +82,8 @@ private:
template <class TypeTag>
class PressureCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
typedef decltype(std::declval<IQFluidState>().pressure(0)) ResultRawType;
@ -131,9 +131,9 @@ private:
template <class TypeTag, class FluidState>
class BoundaryPressureCallback
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQRawFluidState;
typedef typename std::remove_const<typename std::remove_reference<IQRawFluidState>::type>::type IQFluidState;
@ -193,8 +193,8 @@ private:
template <class TypeTag>
class DensityCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
typedef decltype(std::declval<IQFluidState>().density(0)) ResultRawType;
@ -242,8 +242,8 @@ private:
template <class TypeTag>
class MolarDensityCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
@ -290,8 +290,8 @@ private:
template <class TypeTag>
class ViscosityCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
typedef decltype(std::declval<IQFluidState>().viscosity(0)) ResultRawType;
@ -339,9 +339,9 @@ private:
template <class TypeTag>
class VelocityCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef decltype(IntensiveQuantities().velocityCenter()) ResultRawType;
@ -375,8 +375,8 @@ private:
template <class TypeTag>
class VelocityComponentCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(IntensiveQuantities().velocityCenter()[0]) ResultRawType;
@ -423,8 +423,8 @@ private:
template <class TypeTag>
class MoleFractionCallback
{
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef decltype(std::declval<IntensiveQuantities>().fluidState()) IQFluidState;
typedef decltype(std::declval<IQFluidState>().moleFraction(0, 0)) ResultRawType;

View File

@ -46,10 +46,10 @@ class DiscreteFractureExtensiveQuantities : public ImmiscibleExtensiveQuantities
{
typedef ImmiscibleExtensiveQuantities<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
enum { dimWorld = GridView::dimensionworld };
enum { numPhases = FluidSystem::numPhases };

View File

@ -48,11 +48,11 @@ template <class TypeTag>
class DiscreteFractureIntensiveQuantities : public ImmiscibleIntensiveQuantities<TypeTag>
{
typedef ImmiscibleIntensiveQuantities<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::FluidSystem> FluidSystem;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
enum { numPhases = FluidSystem::numPhases };
enum { dimWorld = GridView::dimensionworld };
@ -62,7 +62,7 @@ class DiscreteFractureIntensiveQuantities : public ImmiscibleIntensiveQuantities
static_assert(numPhases == 2, "The fracture module currently is only "
"implemented for two fluid phases!");
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
enum { wettingPhaseIdx = MaterialLaw::wettingPhaseIdx };
enum { nonWettingPhaseIdx = MaterialLaw::nonWettingPhaseIdx };
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;

View File

@ -43,15 +43,15 @@ class DiscreteFractureLocalResidual : public ImmiscibleLocalResidual<TypeTag>
{
typedef ImmiscibleLocalResidual<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
typedef typename GET_PROP_TYPE(TypeTag, EqVector) EqVector;
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Indices> Indices;
typedef GetPropType<TypeTag, Properties::EqVector> EqVector;
typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
enum { conti0EqIdx = Indices::conti0EqIdx };
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { enableEnergy = GET_PROP_VALUE(TypeTag, EnableEnergy) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
typedef Opm::EnergyModule<TypeTag, enableEnergy> EnergyModule;

View File

@ -52,16 +52,22 @@ class DiscreteFractureModel;
BEGIN_PROPERTIES
//! The generic type tag for problems using the immiscible multi-phase model
NEW_TYPE_TAG(DiscreteFractureModel, INHERITS_FROM(ImmiscibleTwoPhaseModel, VtkDiscreteFracture));
// Create new type tags
namespace TTag {
struct DiscreteFractureModel { using InheritsFrom = std::tuple<VtkDiscreteFracture, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag
//! The class for the model
SET_TYPE_PROP(DiscreteFractureModel, Model, Opm::DiscreteFractureModel<TypeTag>);
template<class TypeTag>
struct Model<TypeTag, TTag::DiscreteFractureModel> { using type = Opm::DiscreteFractureModel<TypeTag>; };
//! The class for the model
SET_TYPE_PROP(DiscreteFractureModel, BaseProblem, Opm::DiscreteFractureProblem<TypeTag>);
template<class TypeTag>
struct BaseProblem<TypeTag, TTag::DiscreteFractureModel> { using type = Opm::DiscreteFractureProblem<TypeTag>; };
//! Use the immiscible multi-phase local jacobian operator for the immiscible multi-phase model
SET_TYPE_PROP(DiscreteFractureModel, LocalResidual, Opm::DiscreteFractureLocalResidual<TypeTag>);
template<class TypeTag>
struct LocalResidual<TypeTag, TTag::DiscreteFractureModel> { using type = Opm::DiscreteFractureLocalResidual<TypeTag>; };
// The type of the base base class for actual problems.
// TODO!?
@ -81,14 +87,16 @@ SET_TYPE_PROP(DiscreteFractureModel, ExtensiveQuantities,
//! For the discrete fracture model, we need to use two-point flux approximation or it
//! will converge very poorly
SET_BOOL_PROP(DiscreteFractureModel, UseTwoPointGradients, true);
template<class TypeTag>
struct UseTwoPointGradients<TypeTag, TTag::DiscreteFractureModel> { static constexpr bool value = true; };
// 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...
SET_BOOL_PROP(DiscreteFractureModel, EnableIntensiveQuantityCache, false);
template<class TypeTag>
struct EnableIntensiveQuantityCache<TypeTag, TTag::DiscreteFractureModel> { static constexpr bool value = false; };
END_PROPERTIES
@ -115,7 +123,7 @@ template <class TypeTag>
class DiscreteFractureModel : public ImmiscibleModel<TypeTag>
{
typedef ImmiscibleModel<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
public:
DiscreteFractureModel(Simulator& simulator)

View File

@ -45,11 +45,11 @@ class DiscreteFracturePrimaryVariables
{
typedef ImmisciblePrimaryVariables<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw;
typedef typename GET_PROP_TYPE(TypeTag, MaterialLawParams) MaterialLawParams;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;
enum { numPhases = GET_PROP_VALUE(TypeTag, NumPhases) };
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
public:
/*!

View File

@ -52,10 +52,10 @@ class DiscreteFractureProblem
{
typedef Opm::MultiPhaseBaseProblem<TypeTag> ParentType;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef GetPropType<TypeTag, Properties::Problem> Implementation;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
enum { dimWorld = GridView::dimensionworld };
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;

View File

@ -36,7 +36,8 @@
BEGIN_PROPERTIES
NEW_PROP_TAG(UseTwoPointGradients);
template<class TypeTag, class MyTypeTag>
struct UseTwoPointGradients { using type = UndefinedProperty; };
END_PROPERTIES

View File

@ -53,10 +53,10 @@ namespace Opm {
template <class TypeTag>
class BaseAuxiliaryModule
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, GlobalEqVector) GlobalEqVector;
typedef typename GET_PROP_TYPE(TypeTag, SparseMatrixAdapter) SparseMatrixAdapter;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef GetPropType<TypeTag, Properties::GlobalEqVector> GlobalEqVector;
typedef GetPropType<TypeTag, Properties::SparseMatrixAdapter> SparseMatrixAdapter;
protected:
typedef std::set<unsigned> NeighborSet;

View File

@ -57,12 +57,13 @@ SET_TYPE_PROP(AutoDiffLocalLinearizer, LocalLinearizer,
Opm::FvBaseAdLocalLinearizer<TypeTag>);
//! Set the function evaluation w.r.t. the primary variables
SET_PROP(AutoDiffLocalLinearizer, Evaluation)
template<class TypeTag>
struct Evaluation<TypeTag, TTag::AutoDiffLocalLinearizer>
{
private:
static const unsigned numEq = GET_PROP_VALUE(TypeTag, NumEq);
static const unsigned numEq = getPropValue<TypeTag, Properties::NumEq>();
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
public:
typedef Opm::DenseAd::Evaluation<Scalar, numEq> type;
@ -84,22 +85,22 @@ template<class TypeTag>
class FvBaseAdLocalLinearizer
{
private:
typedef typename GET_PROP_TYPE(TypeTag, LocalLinearizer) Implementation;
typedef typename GET_PROP_TYPE(TypeTag, LocalResidual) LocalResidual;
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::LocalLinearizer> Implementation;
typedef GetPropType<TypeTag, Properties::LocalResidual> LocalResidual;
typedef GetPropType<TypeTag, Properties::Simulator> Simulator;
typedef GetPropType<TypeTag, Properties::Problem> Problem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> PrimaryVariables;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef typename GridView::template Codim<0>::Entity Element;
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numEq = getPropValue<TypeTag, Properties::NumEq>() };
typedef Dune::FieldVector<Scalar, numEq> ScalarVectorBlock;
// extract local matrices from jacobian matrix for consistency
typedef typename GET_PROP_TYPE(TypeTag, SparseMatrixAdapter)::MatrixBlock ScalarMatrixBlock;
typedef typename GetPropType<TypeTag, Properties::SparseMatrixAdapter>::MatrixBlock ScalarMatrixBlock;
typedef Dune::BlockVector<ScalarVectorBlock> ScalarLocalBlockVector;
typedef Dune::Matrix<ScalarMatrixBlock> ScalarLocalBlockMatrix;

View File

@ -44,16 +44,16 @@ namespace Opm {
template<class TypeTag>
class FvBaseBoundaryContext
{
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, Stencil) Stencil;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, IntensiveQuantities) IntensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, ExtensiveQuantities) ExtensiveQuantities;
typedef typename GET_PROP_TYPE(TypeTag, GradientCalculator) GradientCalculator;
typedef GetPropType<TypeTag, Properties::Scalar> Scalar;
typedef GetPropType<TypeTag, Properties::Problem> Problem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::Stencil> Stencil;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::IntensiveQuantities> IntensiveQuantities;
typedef GetPropType<TypeTag, Properties::ExtensiveQuantities> ExtensiveQuantities;
typedef GetPropType<TypeTag, Properties::GradientCalculator> GradientCalculator;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef typename GridView::template Codim<0>::Entity Element;
typedef typename GridView::IntersectionIterator IntersectionIterator;
typedef typename GridView::Intersection Intersection;

View File

@ -42,9 +42,9 @@ namespace Opm {
* must be constraint or none.)
*/
template <class TypeTag>
class FvBaseConstraints : public GET_PROP_TYPE(TypeTag, PrimaryVariables)
class FvBaseConstraints : public GetPropType<TypeTag, Properties::PrimaryVariables>
{
typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) ParentType;
typedef GetPropType<TypeTag, Properties::PrimaryVariables> ParentType;
public:
FvBaseConstraints()

View File

@ -42,10 +42,10 @@ namespace Opm {
template<class TypeTag>
class FvBaseConstraintsContext
{
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef GetPropType<TypeTag, Properties::Problem> Problem;
typedef GetPropType<TypeTag, Properties::Model> Model;
typedef GetPropType<TypeTag, Properties::ElementContext> ElementContext;
typedef GetPropType<TypeTag, Properties::GridView> GridView;
typedef typename GridView::template Codim<0>::Entity Element;
enum { dimWorld = GridView::dimensionworld };

Some files were not shown because too many files have changed in this diff Show More