From b74d39f2e106641733632bf46bfd4ec928c34380 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 30 Jan 2018 11:53:30 +0100 Subject: [PATCH 1/2] 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 { From 3924bb1e6e952652295cba9b4027aa80f372be53 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 30 Jan 2018 11:53:30 +0100 Subject: [PATCH 2/2] explicitly disable all extensions supported by black oil model for the base simulator this should not really be necessary because they are supposed to be disabled by default, but it makes things a bit more explicit --- opm/autodiff/BlackoilModelEbos.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index f6811621c..fc3730334 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -76,6 +76,12 @@ SET_BOOL_PROP(EclFlowProblem, ExportGlobalTransmissibility, true); // default in flow is to formulate the equations in surface volumes SET_BOOL_PROP(EclFlowProblem, BlackoilConserveSurfaceVolume, true); SET_BOOL_PROP(EclFlowProblem, UseVolumetricResidual, false); + +// disable all extensions supported by black oil model. this should not really be +// necessary but it makes things a bit more explicit +SET_BOOL_PROP(EclFlowProblem, EnablePolymer, false); +SET_BOOL_PROP(EclFlowProblem, EnableSolvent, false); +SET_BOOL_PROP(EclFlowProblem, EnableEnergy, false); }} namespace Opm {