ebos: allow to completely disable the well treatment

this is useful if wells shall be handled externally (e.g. most
prominently the upcoming flow wrapper which uses ebos to linearize the
mass balance equations).

disabling the well treatment can be done by setting the DisableWells
property to "true".
This commit is contained in:
Andreas Lauser 2016-06-07 17:43:45 +02:00
parent f0161dc1c9
commit 98cfa30f92

View File

@ -103,6 +103,9 @@ NEW_PROP_TAG(EnableWriteAllSolutions);
// The number of time steps skipped between writing two consequtive restart files
NEW_PROP_TAG(RestartWritingInterval);
// Disable well treatment (for users which do this externally)
NEW_PROP_TAG(DisableWells);
// Set the problem property
SET_TYPE_PROP(EclBaseProblem, Problem, Ewoms::EclProblem<TypeTag>);
@ -197,6 +200,9 @@ SET_STRING_PROP(EclBaseProblem, GridFile, "data/ecl.DATA");
// between writing restart files
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);
} // namespace Properties
/*!
@ -389,6 +395,7 @@ public:
simulator.setTimeStepSize(dt);
}
if (!GET_PROP_VALUE(TypeTag, DisableWells))
// set up the wells
wellManager_.beginEpisode(this->simulator().gridManager().eclState(), isOnRestart);
}
@ -398,6 +405,7 @@ public:
*/
void beginTimeStep()
{
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
wellManager_.beginTimeStep();
// this is a little hack to write the initial condition, which we need to do
@ -408,18 +416,25 @@ public:
initialWritten = true;
}
}
}
/*!
* \brief Called by the simulator before each Newton-Raphson iteration.
*/
void beginIteration()
{ wellManager_.beginIteration(); }
{
if (!GET_PROP_VALUE(TypeTag, DisableWells))
wellManager_.beginIteration();
}
/*!
* \brief Called by the simulator after each Newton-Raphson iteration.
*/
void endIteration()
{ wellManager_.endIteration(); }
{
if (!GET_PROP_VALUE(TypeTag, DisableWells))
wellManager_.endIteration();
}
/*!
* \brief Called by the simulator after each time integration.
@ -434,10 +449,12 @@ public:
this->model().checkConservativeness(/*tolerance=*/-1, /*verbose=*/true);
#endif // NDEBUG
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
wellManager_.endTimeStep();
// write the summary information after each time step
summaryWriter_.write(wellManager_);
}
bool cachesInvalid = false;
@ -696,10 +713,12 @@ public:
*/
void initialSolutionApplied()
{
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
// initialize the wells. Note that this needs to be done after initializing the
// intrinsic permeabilities and the after applying the initial solution because
// the well model uses these...
wellManager_.init(this->simulator().gridManager().eclState());
}
// update the data required for capillary pressure hysteresis
updateHysteresis_();
@ -723,6 +742,7 @@ public:
{
rate = 0.0;
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
wellManager_.computeTotalRatesForDof(rate, context, spaceIdx, timeIdx);
// convert the source term from the total mass rate of the
@ -731,6 +751,7 @@ public:
for (unsigned eqIdx = 0; eqIdx < numEq; ++ eqIdx)
rate[eqIdx] /= this->model().dofTotalVolume(globalDofIdx);
}
}
/*!
* \brief Returns a reference to the ECL well manager used by the problem.