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:58 +02:00
parent 8319a67862
commit cd725aeb8a
2 changed files with 26 additions and 13 deletions
+24
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.