From b74d39f2e106641733632bf46bfd4ec928c34380 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 30 Jan 2018 11:53:30 +0100 Subject: [PATCH] make flow compile in face of the energy conservation changes of the eWoms black oil model with this, flow does *not* yet support thermal simulations, this patch merely makes it compile while nothing user-facing is supposed to change. --- opm/simulators/flow_ebos_gasoil.cpp | 21 +++++++++++++++---- opm/simulators/flow_ebos_oilwater.cpp | 21 +++++++++++++++---- opm/simulators/flow_ebos_oilwater_polymer.cpp | 21 +++++++++++++++---- 3 files changed, 51 insertions(+), 12 deletions(-) diff --git a/opm/simulators/flow_ebos_gasoil.cpp b/opm/simulators/flow_ebos_gasoil.cpp index cf80c599d..3b0defb32 100644 --- a/opm/simulators/flow_ebos_gasoil.cpp +++ b/opm/simulators/flow_ebos_gasoil.cpp @@ -37,11 +37,24 @@ namespace Ewoms { namespace Properties { NEW_TYPE_TAG(EclFlowGasOilProblem, INHERITS_FROM(EclFlowProblem)); + //! The indices required by the model -SET_TYPE_PROP(EclFlowGasOilProblem, Indices, - Ewoms::BlackOilTwoPhaseIndices); +SET_PROP(EclFlowGasOilProblem, Indices) +{ +private: + // it is unfortunately not possible to simply use 'TypeTag' here because this leads + // to cyclic definitions of some properties. if this happens the compiler error + // messages unfortunately are *really* confusing and not really helpful. + typedef TTAG(EclFlowProblem) BaseTypeTag; + typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem; + +public: + typedef Ewoms::BlackOilTwoPhaseIndices type; +}; }} namespace Opm { diff --git a/opm/simulators/flow_ebos_oilwater.cpp b/opm/simulators/flow_ebos_oilwater.cpp index 3fcbbc078..e12d3ebfe 100644 --- a/opm/simulators/flow_ebos_oilwater.cpp +++ b/opm/simulators/flow_ebos_oilwater.cpp @@ -37,11 +37,24 @@ namespace Ewoms { namespace Properties { NEW_TYPE_TAG(EclFlowOilWaterProblem, INHERITS_FROM(EclFlowProblem)); + //! The indices required by the model -SET_TYPE_PROP(EclFlowOilWaterProblem, Indices, - Ewoms::BlackOilTwoPhaseIndices); +SET_PROP(EclFlowOilWaterProblem, Indices) +{ +private: + // it is unfortunately not possible to simply use 'TypeTag' here because this leads + // to cyclic definitions of some properties. if this happens the compiler error + // messages unfortunately are *really* confusing and not really helpful. + typedef TTAG(EclFlowProblem) BaseTypeTag; + typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem; + +public: + typedef Ewoms::BlackOilTwoPhaseIndices type; +}; }} namespace Opm { diff --git a/opm/simulators/flow_ebos_oilwater_polymer.cpp b/opm/simulators/flow_ebos_oilwater_polymer.cpp index 0c8fc1669..71f0d77f7 100644 --- a/opm/simulators/flow_ebos_oilwater_polymer.cpp +++ b/opm/simulators/flow_ebos_oilwater_polymer.cpp @@ -39,10 +39,23 @@ namespace Properties { NEW_TYPE_TAG(EclFlowOilWaterPolymerProblem, INHERITS_FROM(EclFlowProblem)); SET_BOOL_PROP(EclFlowOilWaterPolymerProblem, EnablePolymer, true); //! The indices required by the model -SET_TYPE_PROP(EclFlowOilWaterPolymerProblem, Indices, - Ewoms::BlackOilTwoPhaseIndices); +//! The indices required by the model +SET_PROP(EclFlowOilWaterPolymerProblem, Indices) +{ +private: + // it is unfortunately not possible to simply use 'TypeTag' here because this leads + // to cyclic definitions of some properties. if this happens the compiler error + // messages unfortunately are *really* confusing and not really helpful. + typedef TTAG(EclFlowProblem) BaseTypeTag; + typedef typename GET_PROP_TYPE(BaseTypeTag, FluidSystem) FluidSystem; + +public: + typedef Ewoms::BlackOilTwoPhaseIndices type; +}; }} namespace Opm {