Merge pull request #3218 from totto82/wtemp_all_wells
store temperature for all wells not just injectors
This commit is contained in:
commit
845b00c27a
@ -228,7 +228,6 @@ public:
|
|||||||
InjectorCMode cmode = InjectorCMode::CMODE_UNDEFINED;
|
InjectorCMode cmode = InjectorCMode::CMODE_UNDEFINED;
|
||||||
double surface_rate;
|
double surface_rate;
|
||||||
double reservoir_rate;
|
double reservoir_rate;
|
||||||
double temperature;
|
|
||||||
int vfp_table_number;
|
int vfp_table_number;
|
||||||
bool prediction_mode;
|
bool prediction_mode;
|
||||||
double rs_rv_inj;
|
double rs_rv_inj;
|
||||||
@ -253,7 +252,6 @@ public:
|
|||||||
double bhp_hist_limit = 0.0;
|
double bhp_hist_limit = 0.0;
|
||||||
double thp_hist_limit = 0.0;
|
double thp_hist_limit = 0.0;
|
||||||
|
|
||||||
double temperature;
|
|
||||||
double BHPH;
|
double BHPH;
|
||||||
double THPH;
|
double THPH;
|
||||||
int VFPTableNumber;
|
int VFPTableNumber;
|
||||||
@ -315,7 +313,6 @@ public:
|
|||||||
serializer(THPTarget);
|
serializer(THPTarget);
|
||||||
serializer(bhp_hist_limit);
|
serializer(bhp_hist_limit);
|
||||||
serializer(thp_hist_limit);
|
serializer(thp_hist_limit);
|
||||||
serializer(temperature);
|
|
||||||
serializer(BHPH);
|
serializer(BHPH);
|
||||||
serializer(THPH);
|
serializer(THPH);
|
||||||
serializer(VFPTableNumber);
|
serializer(VFPTableNumber);
|
||||||
@ -638,6 +635,7 @@ public:
|
|||||||
bool segmented_density_calculation() const { return true; }
|
bool segmented_density_calculation() const { return true; }
|
||||||
double alq_value() const;
|
double alq_value() const;
|
||||||
double temperature() const;
|
double temperature() const;
|
||||||
|
void setWellTemperature(const double temp);
|
||||||
bool hasInjected( ) const;
|
bool hasInjected( ) const;
|
||||||
bool hasProduced( ) const;
|
bool hasProduced( ) const;
|
||||||
bool updateHasInjected( );
|
bool updateHasInjected( );
|
||||||
@ -690,6 +688,7 @@ public:
|
|||||||
serializer(segments);
|
serializer(segments);
|
||||||
serializer(wvfpexp);
|
serializer(wvfpexp);
|
||||||
serializer(m_pavg);
|
serializer(m_pavg);
|
||||||
|
serializer(well_temperature);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -734,6 +733,7 @@ private:
|
|||||||
std::shared_ptr<WVFPEXP> wvfpexp;
|
std::shared_ptr<WVFPEXP> wvfpexp;
|
||||||
Status status;
|
Status status;
|
||||||
PAvg m_pavg;
|
PAvg m_pavg;
|
||||||
|
double well_temperature;
|
||||||
};
|
};
|
||||||
|
|
||||||
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
||||||
|
@ -1653,19 +1653,11 @@ Well{0} entered with disallowed 'FIELD' parent group:
|
|||||||
const double temp = record.getItem("TEMPERATURE").getSIDouble(0);
|
const double temp = record.getItem("TEMPERATURE").getSIDouble(0);
|
||||||
|
|
||||||
for (const auto& well_name : well_names) {
|
for (const auto& well_name : well_names) {
|
||||||
// TODO: Is this the right approach? Setting the well temperature only
|
|
||||||
// has an effect on injectors, but specifying it 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.
|
|
||||||
const auto& well = this->getWell(well_name, handlerContext.currentStep);
|
const auto& well = this->getWell(well_name, handlerContext.currentStep);
|
||||||
const double current_temp = well.getInjectionProperties().temperature;
|
const double current_temp = !well.isProducer()? well.temperature(): 0.0;
|
||||||
if (current_temp != temp && !well.isProducer()) {
|
if (current_temp != temp) {
|
||||||
auto well2 = this->snapshots.back().wells( well_name );
|
auto well2 = this->snapshots.back().wells( well_name );
|
||||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well2.getInjectionProperties());
|
well2.setWellTemperature(temp);
|
||||||
inj->temperature = temp;
|
|
||||||
well2.updateInjection(inj);
|
|
||||||
this->snapshots.back().wells.update( std::move(well2) );
|
this->snapshots.back().wells.update( std::move(well2) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1983,20 +1975,11 @@ Well{0} entered with disallowed 'FIELD' parent group:
|
|||||||
double temp = record.getItem("TEMP").getSIDouble(0);
|
double temp = record.getItem("TEMP").getSIDouble(0);
|
||||||
|
|
||||||
for (const auto& well_name : well_names) {
|
for (const auto& well_name : well_names) {
|
||||||
// TODO: Is this the right approach? Setting the well temperature only
|
|
||||||
// has an effect on injectors, but specifying it 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.
|
|
||||||
|
|
||||||
const auto& well = this->getWell(well_name, handlerContext.currentStep);
|
const auto& well = this->getWell(well_name, handlerContext.currentStep);
|
||||||
const double current_temp = well.getInjectionProperties().temperature;
|
const double current_temp = !well.isProducer()? well.temperature(): 0.0;
|
||||||
if (current_temp != temp && !well.isProducer()) {
|
if (current_temp != temp) {
|
||||||
auto well2 = this->snapshots.back().wells( well_name );
|
auto well2 = this->snapshots.back().wells( well_name );
|
||||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well.getInjectionProperties());
|
well2.setWellTemperature(temp);
|
||||||
inj->temperature = temp;
|
|
||||||
well2.updateInjection(inj);
|
|
||||||
this->snapshots.back().wells.update( std::move(well2) );
|
this->snapshots.back().wells.update( std::move(well2) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <opm/common/utility/shmatch.hpp>
|
#include <opm/common/utility/shmatch.hpp>
|
||||||
|
|
||||||
|
#include <opm/input/eclipse/Parser/ParserKeywords/S.hpp>
|
||||||
#include <opm/input/eclipse/Parser/ParserKeywords/W.hpp>
|
#include <opm/input/eclipse/Parser/ParserKeywords/W.hpp>
|
||||||
|
|
||||||
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
|
#include <opm/input/eclipse/Deck/DeckRecord.hpp>
|
||||||
@ -294,7 +295,8 @@ Well::Well(const RestartIO::RstWell& rst_well,
|
|||||||
production(std::make_shared<WellProductionProperties>(unit_system_arg, wname)),
|
production(std::make_shared<WellProductionProperties>(unit_system_arg, wname)),
|
||||||
injection(std::make_shared<WellInjectionProperties>(unit_system_arg, wname)),
|
injection(std::make_shared<WellInjectionProperties>(unit_system_arg, wname)),
|
||||||
wvfpexp(explicitTHPOptions(rst_well)),
|
wvfpexp(explicitTHPOptions(rst_well)),
|
||||||
status(status_from_int(rst_well.well_status))
|
status(status_from_int(rst_well.well_status)),
|
||||||
|
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue)
|
||||||
{
|
{
|
||||||
if (this->wtype.producer()) {
|
if (this->wtype.producer()) {
|
||||||
auto p = std::make_shared<WellProductionProperties>(this->unit_system, wname);
|
auto p = std::make_shared<WellProductionProperties>(this->unit_system, wname);
|
||||||
@ -471,7 +473,9 @@ Well::Well(const std::string& wname_arg,
|
|||||||
production(std::make_shared<WellProductionProperties>(unit_system, wname)),
|
production(std::make_shared<WellProductionProperties>(unit_system, wname)),
|
||||||
injection(std::make_shared<WellInjectionProperties>(unit_system, wname)),
|
injection(std::make_shared<WellInjectionProperties>(unit_system, wname)),
|
||||||
wvfpexp(std::make_shared<WVFPEXP>()),
|
wvfpexp(std::make_shared<WVFPEXP>()),
|
||||||
status(Status::SHUT)
|
status(Status::SHUT),
|
||||||
|
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue)
|
||||||
|
|
||||||
{
|
{
|
||||||
auto p = std::make_shared<WellProductionProperties>(this->unit_system, this->wname);
|
auto p = std::make_shared<WellProductionProperties>(this->unit_system, this->wname);
|
||||||
p->whistctl_cmode = whistctl_cmode;
|
p->whistctl_cmode = whistctl_cmode;
|
||||||
@ -513,6 +517,7 @@ Well Well::serializationTestObject()
|
|||||||
result.segments = std::make_shared<WellSegments>(WellSegments::serializationTestObject());
|
result.segments = std::make_shared<WellSegments>(WellSegments::serializationTestObject());
|
||||||
result.wvfpexp = std::make_shared<WVFPEXP>(WVFPEXP::serializationTestObject());
|
result.wvfpexp = std::make_shared<WVFPEXP>(WVFPEXP::serializationTestObject());
|
||||||
result.m_pavg = PAvg();
|
result.m_pavg = PAvg();
|
||||||
|
result.well_temperature = 10.0;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1529,9 +1534,12 @@ double Well::alq_value() const {
|
|||||||
|
|
||||||
double Well::temperature() const {
|
double Well::temperature() const {
|
||||||
if (!this->wtype.producer())
|
if (!this->wtype.producer())
|
||||||
return this->injection->temperature;
|
return this->well_temperature;
|
||||||
|
|
||||||
throw std::runtime_error("Can not ask for temperature in a producer");
|
throw std::runtime_error("Can only ask for temperature in an injector");
|
||||||
|
}
|
||||||
|
void Well::setWellTemperature(const double temp) {
|
||||||
|
this->well_temperature = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, const Well::Status& st) {
|
std::ostream& operator<<(std::ostream& os, const Well::Status& st) {
|
||||||
@ -1807,6 +1815,7 @@ bool Well::operator==(const Well& data) const {
|
|||||||
&& (this->getProductionProperties() == data.getProductionProperties())
|
&& (this->getProductionProperties() == data.getProductionProperties())
|
||||||
&& (this->m_pavg == data.m_pavg)
|
&& (this->m_pavg == data.m_pavg)
|
||||||
&& (this->getInjectionProperties() == data.getInjectionProperties())
|
&& (this->getInjectionProperties() == data.getInjectionProperties())
|
||||||
|
&& (this->well_temperature == data.well_temperature)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@ namespace Opm {
|
|||||||
reservoirInjectionRate(units.getDimension(UnitSystem::measure::rate)),
|
reservoirInjectionRate(units.getDimension(UnitSystem::measure::rate)),
|
||||||
BHPTarget(units.getDimension(UnitSystem::measure::pressure)),
|
BHPTarget(units.getDimension(UnitSystem::measure::pressure)),
|
||||||
THPTarget(units.getDimension(UnitSystem::measure::pressure)),
|
THPTarget(units.getDimension(UnitSystem::measure::pressure)),
|
||||||
temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue),
|
|
||||||
BHPH(0),
|
BHPH(0),
|
||||||
THPH(0),
|
THPH(0),
|
||||||
VFPTableNumber(0),
|
VFPTableNumber(0),
|
||||||
@ -69,7 +68,6 @@ namespace Opm {
|
|||||||
result.THPTarget = UDAValue(3.0);
|
result.THPTarget = UDAValue(3.0);
|
||||||
result.bhp_hist_limit = 4.0;
|
result.bhp_hist_limit = 4.0;
|
||||||
result.thp_hist_limit = 5.0;
|
result.thp_hist_limit = 5.0;
|
||||||
result.temperature = 6.0;
|
|
||||||
result.BHPH = 7.0;
|
result.BHPH = 7.0;
|
||||||
result.THPH = 8.0;
|
result.THPH = 8.0;
|
||||||
result.VFPTableNumber = 9;
|
result.VFPTableNumber = 9;
|
||||||
@ -238,7 +236,6 @@ namespace Opm {
|
|||||||
bool Well::WellInjectionProperties::operator==(const Well::WellInjectionProperties& other) const {
|
bool Well::WellInjectionProperties::operator==(const Well::WellInjectionProperties& other) const {
|
||||||
if ((surfaceInjectionRate == other.surfaceInjectionRate) &&
|
if ((surfaceInjectionRate == other.surfaceInjectionRate) &&
|
||||||
(reservoirInjectionRate == other.reservoirInjectionRate) &&
|
(reservoirInjectionRate == other.reservoirInjectionRate) &&
|
||||||
(temperature == other.temperature) &&
|
|
||||||
(BHPTarget == other.BHPTarget) &&
|
(BHPTarget == other.BHPTarget) &&
|
||||||
(THPTarget == other.THPTarget) &&
|
(THPTarget == other.THPTarget) &&
|
||||||
(BHPH == other.BHPH) &&
|
(BHPH == other.BHPH) &&
|
||||||
@ -280,7 +277,6 @@ namespace Opm {
|
|||||||
<< "Well::WellInjectionProperties { "
|
<< "Well::WellInjectionProperties { "
|
||||||
<< "surfacerate: " << wp.surfaceInjectionRate << ", "
|
<< "surfacerate: " << wp.surfaceInjectionRate << ", "
|
||||||
<< "reservoir rate " << wp.reservoirInjectionRate << ", "
|
<< "reservoir rate " << wp.reservoirInjectionRate << ", "
|
||||||
<< "temperature: " << wp.temperature << ", "
|
|
||||||
<< "BHP target: " << wp.BHPTarget << ", "
|
<< "BHP target: " << wp.BHPTarget << ", "
|
||||||
<< "THP target: " << wp.THPTarget << ", "
|
<< "THP target: " << wp.THPTarget << ", "
|
||||||
<< "BHPH: " << wp.BHPH << ", "
|
<< "BHPH: " << wp.BHPH << ", "
|
||||||
@ -306,7 +302,6 @@ namespace Opm {
|
|||||||
controls.bhp_limit = this->bhp_hist_limit;
|
controls.bhp_limit = this->bhp_hist_limit;
|
||||||
controls.thp_limit = this->thp_hist_limit;
|
controls.thp_limit = this->thp_hist_limit;
|
||||||
}
|
}
|
||||||
controls.temperature = this->temperature;
|
|
||||||
controls.injector_type = this->injectorType;
|
controls.injector_type = this->injectorType;
|
||||||
controls.cmode = this->controlMode;
|
controls.cmode = this->controlMode;
|
||||||
controls.vfp_table_number = this->VFPTableNumber;
|
controls.vfp_table_number = this->VFPTableNumber;
|
||||||
|
@ -2225,18 +2225,19 @@ BOOST_AUTO_TEST_CASE(WTEMP_well_template) {
|
|||||||
'W3' 'G2' 6 6 1 'WATER' 0.00 'STD' 'SHUT' 'NO' 0 'SEG' /
|
'W3' 'G2' 6 6 1 'WATER' 0.00 'STD' 'SHUT' 'NO' 0 'SEG' /
|
||||||
/
|
/
|
||||||
|
|
||||||
WCONINJE
|
WTEMP
|
||||||
'W2' 'WATER' 'OPEN' 'RATE' 20000 4* /
|
'W*' 40.0 /
|
||||||
'W3' 'WATER' 'OPEN' 'RATE' 20000 4* /
|
|
||||||
/
|
/
|
||||||
|
|
||||||
DATES -- 2
|
DATES -- 2
|
||||||
15 OKT 2008 /
|
15 OKT 2008 /
|
||||||
/
|
/
|
||||||
|
|
||||||
WTEMP
|
WCONINJE
|
||||||
'W*' 40.0 /
|
'W2' 'WATER' 'OPEN' 'RATE' 20000 4* /
|
||||||
|
'W3' 'WATER' 'OPEN' 'RATE' 20000 4* /
|
||||||
/
|
/
|
||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
auto deck = Parser().parseString(input);
|
auto deck = Parser().parseString(input);
|
||||||
@ -2247,14 +2248,14 @@ BOOST_AUTO_TEST_CASE(WTEMP_well_template) {
|
|||||||
Runspec runspec (deck);
|
Runspec runspec (deck);
|
||||||
Schedule schedule( deck, grid, fp, runspec, python);
|
Schedule schedule( deck, grid, fp, runspec, python);
|
||||||
|
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_THROW(schedule.getWell("W1", 1).temperature(), std::runtime_error);
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 2).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_THROW(schedule.getWell("W1", 2).temperature(), std::runtime_error);
|
||||||
|
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W2", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_THROW(schedule.getWell("W2", 1).temperature(), std::runtime_error);
|
||||||
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W2", 2).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W2", 2).temperature(), 1e-5);
|
||||||
|
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W3", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_THROW(schedule.getWell("W3", 1).temperature(), std::runtime_error);
|
||||||
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W3", 2).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W3", 2).temperature(), 1e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2294,15 +2295,14 @@ BOOST_AUTO_TEST_CASE(WTEMPINJ_well_template) {
|
|||||||
Runspec runspec (deck);
|
Runspec runspec (deck);
|
||||||
Schedule schedule( deck, grid, fp, runspec, python);
|
Schedule schedule( deck, grid, fp, runspec, python);
|
||||||
|
|
||||||
// Producerwell - currently setting temperature only acts on injectors.
|
BOOST_CHECK_THROW(schedule.getWell("W1", 1).temperature(), std::runtime_error);
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_THROW(schedule.getWell("W1", 2).temperature(), std::runtime_error);
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W1", 2).getInjectionProperties().temperature, 1e-5);
|
|
||||||
|
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W2", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W2", 1).temperature(), 1e-5);
|
||||||
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W2", 2).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W2", 2).temperature(), 1e-5);
|
||||||
|
|
||||||
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W3", 1).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(288.71, schedule.getWell("W2", 1).temperature(), 1e-5);
|
||||||
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W3", 2).getInjectionProperties().temperature, 1e-5);
|
BOOST_CHECK_CLOSE(313.15, schedule.getWell("W3", 2).temperature(), 1e-5);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE( COMPDAT_sets_automatic_complnum ) {
|
BOOST_AUTO_TEST_CASE( COMPDAT_sets_automatic_complnum ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user