ebos ECL output: move the parameter extraction code for the well data to the well model

this is supposed to be an implementation detail of the well model.
This commit is contained in:
Andreas Lauser 2018-07-09 12:13:57 +02:00
parent 8319a67862
commit cd725aeb8a
2 changed files with 26 additions and 13 deletions

View File

@ -801,20 +801,9 @@ public:
Scalar t = this->simulator().time() + this->simulator().timeStepSize();
Opm::data::Wells dw;
if (!GET_PROP_VALUE(TypeTag, DisableWells)) {
using rt = Opm::data::Rates::opt;
for (unsigned wellIdx = 0; wellIdx < wellModel_.numWells(); ++wellIdx) {
const auto& well = wellModel_.well(wellIdx);
auto& wellOut = dw[ well->name() ];
if (!GET_PROP_VALUE(TypeTag, DisableWells))
dw = wellModel_.wellData();
wellOut.bhp = well->bottomHolePressure();
wellOut.thp = well->tubingHeadPressure();
wellOut.temperature = 0;
wellOut.rates.set( rt::wat, well->surfaceRate(waterPhaseIdx) );
wellOut.rates.set( rt::oil, well->surfaceRate(oilPhaseIdx) );
wellOut.rates.set( rt::gas, well->surfaceRate(gasPhaseIdx) );
}
}
Scalar totalSolverTime = 0.0;
Scalar nextstep = this->simulator().timeStepSize();
writeOutput(dw, t, false, totalSolverTime, nextstep, verbose);

View File

@ -39,6 +39,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/output/data/Wells.hpp>
#include <opm/material/common/Exceptions.hpp>
#include <ewoms/common/propertysystem.hh>
@ -78,6 +79,9 @@ class EclWellManager
enum { numEq = GET_PROP_VALUE(TypeTag, NumEq) };
enum { numPhases = FluidSystem::numPhases };
enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
typedef typename GridView::template Codim<0>::Entity Element;
@ -537,6 +541,26 @@ public:
}
}
Opm::data::Wells wellData() const
{
Opm::data::Wells wellDat;
using rt = Opm::data::Rates::opt;
for (unsigned wellIdx = 0; wellIdx < numWells(); ++wellIdx) {
const auto& ebosWell = well(wellIdx);
auto& wellOut = wellDat[ebosWell->name()];
wellOut.bhp = ebosWell->bottomHolePressure();
wellOut.thp = ebosWell->tubingHeadPressure();
wellOut.temperature = 0;
wellOut.rates.set( rt::wat, ebosWell->surfaceRate(waterPhaseIdx) );
wellOut.rates.set( rt::oil, ebosWell->surfaceRate(oilPhaseIdx) );
wellOut.rates.set( rt::gas, ebosWell->surfaceRate(gasPhaseIdx) );
}
return wellDat;
}
/*!
* \brief This method writes the complete state of all wells
* to the hard disk.