add WPOLYMER to schedule section.

This commit is contained in:
Liu Ming 2014-11-20 16:20:54 +08:00
parent 51de1faa85
commit 94974f0454
7 changed files with 98 additions and 0 deletions

View File

@ -70,6 +70,7 @@ EclipseState/Schedule/Schedule.cpp
EclipseState/Schedule/Well.cpp EclipseState/Schedule/Well.cpp
EclipseState/Schedule/WellProductionProperties.cpp EclipseState/Schedule/WellProductionProperties.cpp
EclipseState/Schedule/WellInjectionProperties.cpp EclipseState/Schedule/WellInjectionProperties.cpp
EclipseState/Schedule/WellPolymerProperties.cpp
EclipseState/Schedule/WellSet.cpp EclipseState/Schedule/WellSet.cpp
EclipseState/Schedule/Group.cpp EclipseState/Schedule/Group.cpp
EclipseState/Schedule/Completion.cpp EclipseState/Schedule/Completion.cpp
@ -134,6 +135,7 @@ EclipseState/Schedule/Schedule.hpp
EclipseState/Schedule/Well.hpp EclipseState/Schedule/Well.hpp
EclipseState/Schedule/WellProductionProperties.hpp EclipseState/Schedule/WellProductionProperties.hpp
EclipseState/Schedule/WellInjectionProperties.hpp EclipseState/Schedule/WellInjectionProperties.hpp
EclipseState/Schedule/WellPolymerProperties.hpp
EclipseState/Schedule/WellSet.hpp EclipseState/Schedule/WellSet.hpp
EclipseState/Schedule/Group.hpp EclipseState/Schedule/Group.hpp
EclipseState/Schedule/DynamicState.hpp EclipseState/Schedule/DynamicState.hpp

View File

@ -21,6 +21,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp>
#include <opm/parser/eclipse/Deck/Section.hpp> #include <opm/parser/eclipse/Deck/Section.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
@ -83,6 +84,9 @@ namespace Opm {
if (keyword->name() == "WCONINJE") if (keyword->name() == "WCONINJE")
handleWCONINJE(deck, keyword, parserLog, currentStep); handleWCONINJE(deck, keyword, parserLog, currentStep);
if (keyword->name() == "WPOLYMER")
handleWPOLYMER(deck, keyword, parserLog, currentStep);
if (keyword->name() == "WCONINJH") if (keyword->name() == "WCONINJH")
handleWCONINJH(deck, keyword, parserLog, currentStep); handleWCONINJH(deck, keyword, parserLog, currentStep);
@ -321,6 +325,29 @@ namespace Opm {
} }
void Schedule::handleWPOLYMER(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr /*parserLog*/, size_t currentStep) {
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {
DeckRecordConstPtr record = keyword->getRecord(recordNr);
const std::string& wellNamePattern = record->getItem("WELL")->getTrimmedString(0);
std::vector<WellPtr> wells = getWells(wellNamePattern);
for (auto wellIter=wells.begin(); wellIter != wells.end(); ++wellIter) {
WellPtr well = *wellIter;
WellPolymerProperties properties(well->getPolymerPropertiesCopy(currentStep));
if (!record->getItem("POLYMER_CONCENTRATION")->defaultApplied(0)) {
properties.m_polymerConcentration = record->getItem("POLYMER_CONCENTRATION")->getSIDouble(0);
}
if (!record->getItem("SALT_CONCENTRATION")->defaultApplied(0)) {
properties.m_saltConcentration = record->getItem("SALT_CONCENTRATION")->getSIDouble(0);
}
well->setPolymerProperties(currentStep, properties);
}
}
}
void Schedule::handleWCONINJH(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr /*parserLog*/, size_t currentStep) { void Schedule::handleWCONINJH(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr /*parserLog*/, size_t currentStep) {
for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) { for (size_t recordNr = 0; recordNr < keyword->size(); recordNr++) {
DeckRecordConstPtr record = keyword->getRecord(recordNr); DeckRecordConstPtr record = keyword->getRecord(recordNr);
@ -617,6 +644,7 @@ namespace Opm {
} }
} }
bool Schedule::convertEclipseStringToBool(const std::string& eclipseString) { bool Schedule::convertEclipseStringToBool(const std::string& eclipseString) {
std::string lowerTrimmed = boost::algorithm::to_lower_copy(eclipseString); std::string lowerTrimmed = boost::algorithm::to_lower_copy(eclipseString);
boost::algorithm::trim(lowerTrimmed); boost::algorithm::trim(lowerTrimmed);

View File

@ -79,6 +79,7 @@ namespace Opm
void handleWGRUPCON(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleWGRUPCON(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleCOMPDAT(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleCOMPDAT(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleWCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleWCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleWPOLYMER(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleWCONINJH(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleWCONINJH(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleWELOPEN(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleWELOPEN(DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);
void handleGCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep); void handleGCONINJE(DeckConstPtr deck, DeckKeywordConstPtr keyword, ParserLogPtr parserLog, size_t currentStep);

View File

@ -38,6 +38,7 @@ namespace Opm {
m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )), m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )),
m_productionProperties( new DynamicState<WellProductionProperties>(timeMap, WellProductionProperties() )), m_productionProperties( new DynamicState<WellProductionProperties>(timeMap, WellProductionProperties() )),
m_injectionProperties( new DynamicState<WellInjectionProperties>(timeMap, WellInjectionProperties() )), m_injectionProperties( new DynamicState<WellInjectionProperties>(timeMap, WellInjectionProperties() )),
m_polymerProperties( new DynamicState<WellPolymerProperties>(timeMap, WellPolymerProperties() )),
m_groupName( new DynamicState<std::string>( timeMap , "" )), m_groupName( new DynamicState<std::string>( timeMap , "" )),
m_headI(headI), m_headI(headI),
m_headJ(headJ), m_headJ(headJ),
@ -60,6 +61,7 @@ namespace Opm {
m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )), m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )),
m_productionProperties( new DynamicState<WellProductionProperties>(timeMap, WellProductionProperties() )), m_productionProperties( new DynamicState<WellProductionProperties>(timeMap, WellProductionProperties() )),
m_injectionProperties( new DynamicState<WellInjectionProperties>(timeMap, WellInjectionProperties() )), m_injectionProperties( new DynamicState<WellInjectionProperties>(timeMap, WellInjectionProperties() )),
m_polymerProperties( new DynamicState<WellPolymerProperties>(timeMap, WellPolymerProperties() )),
m_groupName( new DynamicState<std::string>( timeMap , "" )), m_groupName( new DynamicState<std::string>( timeMap , "" )),
m_headI(headI), m_headI(headI),
m_headJ(headJ), m_headJ(headJ),
@ -102,6 +104,19 @@ namespace Opm {
return m_injectionProperties->at(timeStep); return m_injectionProperties->at(timeStep);
} }
void Well::setPolymerProperties(size_t timeStep , const WellPolymerProperties newProperties) {
m_isProducer->add(timeStep , false);
m_polymerProperties->add(timeStep, newProperties);
}
WellPolymerProperties Well::getPolymerPropertiesCopy(size_t timeStep) const {
return m_polymerProperties->get(timeStep);
}
const WellPolymerProperties& Well::getPolymerProperties(size_t timeStep) const {
return m_polymerProperties->at(timeStep);
}
bool Well::hasBeenDefined(size_t timeStep) const { bool Well::hasBeenDefined(size_t timeStep) const {
if (timeStep < m_creationTimeStep) if (timeStep < m_creationTimeStep)
return false; return false;

View File

@ -27,6 +27,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp>
#include <boost/optional.hpp> #include <boost/optional.hpp>
@ -83,6 +84,10 @@ namespace Opm {
WellInjectionProperties getInjectionPropertiesCopy(size_t timeStep) const; WellInjectionProperties getInjectionPropertiesCopy(size_t timeStep) const;
const WellInjectionProperties& getInjectionProperties(size_t timeStep) const; const WellInjectionProperties& getInjectionProperties(size_t timeStep) const;
void setPolymerProperties(size_t timeStep , const WellPolymerProperties properties);
WellPolymerProperties getPolymerPropertiesCopy(size_t timeStep) const;
const WellPolymerProperties& getPolymerProperties(size_t timeStep) const;
private: private:
size_t m_creationTimeStep; size_t m_creationTimeStep;
std::string m_name; std::string m_name;
@ -98,6 +103,7 @@ namespace Opm {
std::shared_ptr<DynamicState<CompletionSetConstPtr> > m_completions; std::shared_ptr<DynamicState<CompletionSetConstPtr> > m_completions;
std::shared_ptr<DynamicState<WellProductionProperties> > m_productionProperties; std::shared_ptr<DynamicState<WellProductionProperties> > m_productionProperties;
std::shared_ptr<DynamicState<WellInjectionProperties> > m_injectionProperties; std::shared_ptr<DynamicState<WellInjectionProperties> > m_injectionProperties;
std::shared_ptr<DynamicState<WellPolymerProperties> > m_polymerProperties;
std::shared_ptr<DynamicState<std::string> > m_groupName; std::shared_ptr<DynamicState<std::string> > m_groupName;
// WELSPECS data - assumes this is not dynamic // WELSPECS data - assumes this is not dynamic

View File

@ -0,0 +1,12 @@
#include <opm/parser/eclipse/EclipseState/Schedule/WellPolymerProperties.hpp>
#include <string>
#include <vector>
namespace Opm {
WellPolymerProperties::WellPolymerProperties() {
m_polymerConcentration = 0.0;
m_saltConcentration = 0.0;
}
}

View File

@ -0,0 +1,34 @@
/*
Copyright 2014 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WELLPOLYMERPROPERTIES_HPP_HEADER_INCLUDED
#define WELLPOLYMERPROPERTIES_HPP_HEADER_INCLUDED
namespace Opm {
struct WellPolymerProperties {
double m_polymerConcentration;
double m_saltConcentration;
WellPolymerProperties();
};
}
#endif