diff --git a/lib/eclipse/EclipseState/Schedule/Schedule.cpp b/lib/eclipse/EclipseState/Schedule/Schedule.cpp index e776b8ff0..6c5e25282 100644 --- a/lib/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/lib/eclipse/EclipseState/Schedule/Schedule.cpp @@ -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); @@ -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); diff --git a/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp b/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp index e069979e5..2fa18a883 100644 --- a/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp +++ b/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp @@ -16,6 +16,8 @@ You should have received a copy of the GNU General Public License along with OPM. If not, see . */ +#include +#include #include #include @@ -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; @@ -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) && @@ -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 << ", " diff --git a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index 770defa03..1ee94a7e9 100644 --- a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -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); diff --git a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp index a263befbd..1b2bbc892 100644 --- a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp +++ b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp @@ -29,6 +29,7 @@ namespace Opm { struct WellInjectionProperties { double surfaceInjectionRate; double reservoirInjectionRate; + double temperature; double BHPLimit; double THPLimit; int VFPTableNumber;