Skip to content

Commit

Permalink
add temperature to the well injection properties
Browse files Browse the repository at this point in the history
so far, this uses the WTEMP keyword. the WINJTEMP keyword is still to
do!
  • Loading branch information
andlaus committed Nov 27, 2017
1 parent 89a4141 commit 36f477c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/eclipse/EclipseState/Schedule/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ namespace Opm {
else if (keyword.name() == "WSOLVENT")
handleWSOLVENT(keyword, currentStep);

else if (keyword.name() == "WTEMP")
handleWTEMP(keyword, currentStep);

else if (keyword.name() == "WCONINJH")
handleWCONINJH(section, keyword, currentStep);

Expand Down Expand Up @@ -714,6 +717,26 @@ namespace Opm {
}
}

void Schedule::handleWTEMP( const DeckKeyword& keyword, size_t currentStep) {
for( const auto& record : keyword ) {
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);

for (auto* well : getWells(wellNamePattern)) {
// TODO: Can this be done like this? Setting the temperature only has an
// effect on injectors, but specifying this for producers won't hurt and
// wells can also switch their injector/producer status. Note that
// modifying the injector properties for producer wells currently leads
// to a very weird segmentation fault downstream. For now, let's take the
// water route.
if (well->isInjector(currentStep)) {
WellInjectionProperties injectionProperties = well->getInjectionProperties(currentStep);
injectionProperties.temperature = record.getItem("TEMP").getSIDouble(0);
well->setInjectionProperties(currentStep, injectionProperties);
}
}
}
}

void Schedule::handleWCONINJH( const SCHEDULESection& section, const DeckKeyword& keyword, size_t currentStep) {
for( const auto& record : keyword ) {
const std::string& wellName = record.getItem("WELL").getTrimmedString(0);
Expand Down
7 changes: 7 additions & 0 deletions lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/parser/eclipse/Units/Units.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp>

#include <iostream>
Expand All @@ -27,6 +29,9 @@ namespace Opm {
WellInjectionProperties::WellInjectionProperties() {
surfaceInjectionRate=0.0;
reservoirInjectionRate=0.0;
temperature=
Metric::TemperatureOffset
+ ParserKeywords::STCOND::TEMPERATURE::defaultValue;
BHPLimit=0.0;
THPLimit=0.0;
VFPTableNumber=0;
Expand All @@ -40,6 +45,7 @@ namespace Opm {
bool WellInjectionProperties::operator==(const WellInjectionProperties& other) const {
if ((surfaceInjectionRate == other.surfaceInjectionRate) &&
(reservoirInjectionRate == other.reservoirInjectionRate) &&
(temperature == other.temperature) &&
(BHPLimit == other.BHPLimit) &&
(THPLimit == other.THPLimit) &&
(VFPTableNumber == other.VFPTableNumber) &&
Expand All @@ -62,6 +68,7 @@ namespace Opm {
<< "WellInjectionProperties { "
<< "surfacerate: " << wp.surfaceInjectionRate << ", "
<< "reservoir rate " << wp.reservoirInjectionRate << ", "
<< "temperature: " << wp.temperature << ", "
<< "BHP limit: " << wp.BHPLimit << ", "
<< "THP limit: " << wp.THPLimit << ", "
<< "VFP table: " << wp.VFPTableNumber << ", "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ namespace Opm
void handleWCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep);
void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep);
void handleWTEMP( const DeckKeyword& keyword, size_t currentStep);
void handleWCONINJH( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
void handleWELOPEN( const DeckKeyword& keyword, size_t currentStep );
void handleWELTARG( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Opm {
struct WellInjectionProperties {
double surfaceInjectionRate;
double reservoirInjectionRate;
double temperature;
double BHPLimit;
double THPLimit;
int VFPTableNumber;
Expand Down

0 comments on commit 36f477c

Please sign in to comment.