mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
[properties] replace macro calls by native C++
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user