From a3ddd2066b2d8bb23f2b3255634a047db5e7ba81 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Wed, 30 Nov 2016 14:12:02 +0100 Subject: [PATCH] ebos: make it possible to easily disable SWATINIT in flow_ebos, this code collides with the flow part. --- ebos/eclequilinitializer.hh | 29 ++++++++++++++++------------- ebos/eclproblem.hh | 10 ++++++++-- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ebos/eclequilinitializer.hh b/ebos/eclequilinitializer.hh index f1a6078a1..5acb6324e 100644 --- a/ebos/eclequilinitializer.hh +++ b/ebos/eclequilinitializer.hh @@ -48,6 +48,7 @@ NEW_PROP_TAG(FluidSystem); NEW_PROP_TAG(GridView); NEW_PROP_TAG(Scalar); NEW_PROP_TAG(MaterialLaw); +NEW_PROP_TAG(EnableSwatinit); } /*! @@ -243,21 +244,23 @@ public: cartesianToCompressedElemIdx[cartElemIdx] = elemIdx; } - for (unsigned equilElemIdx = 0; equilElemIdx < numEquilElems; ++equilElemIdx) { - int cartElemIdx = gridManager.equilCartesianIndex(equilElemIdx); - assert(cartElemIdx >= 0); - int elemIdx = cartesianToCompressedElemIdx[cartElemIdx]; - if (elemIdx < 0) - // the element is present in the grid for used for equilibration but - // it isn't present in the one used for the simulation. the most - // probable reason for this is that the simulation grid was load - // balanced. - continue; + if (GET_PROP_VALUE(TypeTag, EnableSwatinit)) { + for (unsigned equilElemIdx = 0; equilElemIdx < numEquilElems; ++equilElemIdx) { + int cartElemIdx = gridManager.equilCartesianIndex(equilElemIdx); + assert(cartElemIdx >= 0); + int elemIdx = cartesianToCompressedElemIdx[cartElemIdx]; + if (elemIdx < 0) + // the element is present in the grid for used for equilibration but + // it isn't present in the one used for the simulation. the most + // probable reason for this is that the simulation grid was load + // balanced. + continue; - auto& scalingPoints = materialLawManager->oilWaterScaledEpsPointsDrainage(equilElemIdx); - const auto& equilScalingPoints = equilMaterialLawManager->oilWaterScaledEpsPointsDrainage(equilElemIdx); + auto& scalingPoints = materialLawManager->oilWaterScaledEpsPointsDrainage(equilElemIdx); + const auto& equilScalingPoints = equilMaterialLawManager->oilWaterScaledEpsPointsDrainage(equilElemIdx); - scalingPoints.setMaxPcnw(equilScalingPoints.maxPcnw()); + scalingPoints.setMaxPcnw(equilScalingPoints.maxPcnw()); + } } } diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 13598c832..1621b179b 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -115,6 +115,9 @@ NEW_PROP_TAG(DisableWells); // print statements in debug mode. NEW_PROP_TAG(EnableDebuggingChecks); +// If this property is set to false, the SWATINIT keyword will not be handled by ebos. +NEW_PROP_TAG(EnableSwatinit); + // Set the problem property SET_TYPE_PROP(EclBaseProblem, Problem, Ewoms::EclProblem); @@ -211,10 +214,13 @@ SET_INT_PROP(EclBaseProblem, RestartWritingInterval, 0xffffff); // disable // By default, ebos should handle the wells internally, so we don't disable the well // treatment -SET_INT_PROP(EclBaseProblem, DisableWells, false); +SET_BOOL_PROP(EclBaseProblem, DisableWells, false); // By default, we enable the debugging checks if we're compiled in debug mode -SET_INT_PROP(EclBaseProblem, EnableDebuggingChecks, true); +SET_BOOL_PROP(EclBaseProblem, EnableDebuggingChecks, true); + +// ebos handles the SWATINIT keyword by default +SET_BOOL_PROP(EclBaseProblem, EnableSwatinit, true); } // namespace Properties /*!