Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 0 degC instead of STDCOND for default WTEMP in TEMP option #4042

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions opm/input/eclipse/EclipseState/Runspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ Runspec::Runspec(const Deck& deck)
, m_h2storage (false)
, m_micp (false)
, m_mech (false)
, m_temp (false)
{
if (DeckSection::hasRUNSPEC(deck)) {
const RUNSPECSection runspecSection{deck};
Expand Down Expand Up @@ -762,6 +763,15 @@ Runspec::Runspec(const Deck& deck)

OpmLog::note(msg);
}

if (runspecSection.hasKeyword<ParserKeywords::TEMP>()) {
m_temp = true;

const std::string msg = "Simulation will include energy, but not enthalpy (no work terms).";

OpmLog::note(msg);

}
}
}

Expand All @@ -787,6 +797,7 @@ Runspec Runspec::serializationTestObject()
result.m_h2storage = true;
result.m_micp = true;
result.m_mech = true;
result.m_temp = true;

return result;
}
Expand Down Expand Up @@ -886,6 +897,11 @@ bool Runspec::mech() const noexcept
return this->m_mech;
}

bool Runspec::temp() const noexcept
{
return this->m_temp;
}

std::time_t Runspec::start_time() const noexcept
{
return this->m_start_time;
Expand Down Expand Up @@ -928,6 +944,7 @@ bool Runspec::rst_cmp(const Runspec& full_spec, const Runspec& rst_spec)
full_spec.m_h2storage == rst_spec.m_h2storage &&
full_spec.m_micp == rst_spec.m_micp &&
full_spec.m_mech == rst_spec.m_mech &&
full_spec.m_temp == rst_spec.m_temp &&
Welldims::rst_cmp(full_spec.wellDimensions(), rst_spec.wellDimensions());
}

Expand All @@ -951,6 +968,7 @@ bool Runspec::operator==(const Runspec& data) const
&& (this->m_h2storage == data.m_h2storage)
&& (this->m_micp == data.m_micp)
&& (this->m_mech == data.m_mech)
&& (this->m_temp == data.m_temp)
;
}

Expand Down
3 changes: 3 additions & 0 deletions opm/input/eclipse/EclipseState/Runspec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ class Runspec {
bool h2Storage() const noexcept;
bool micp() const noexcept;
bool mech() const noexcept;
bool temp() const noexcept;

bool operator==(const Runspec& data) const;
static bool rst_cmp(const Runspec& full_state, const Runspec& rst_state);
Expand Down Expand Up @@ -537,6 +538,7 @@ class Runspec {
serializer(m_h2storage);
serializer(m_micp);
serializer(m_mech);
serializer(m_temp);
}

private:
Expand All @@ -562,6 +564,7 @@ class Runspec {
bool m_h2storage;
bool m_micp;
bool m_mech;
bool m_temp;
};

std::size_t declaredMaxRegionID(const Runspec& rspec);
Expand Down
3 changes: 2 additions & 1 deletion opm/input/eclipse/Schedule/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,8 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e
allowCrossFlow,
automaticShutIn,
pvt_table,
gas_inflow);
gas_inflow,
this->m_static.m_runspec.temp());

this->addWell( std::move(well) );

Expand Down
15 changes: 6 additions & 9 deletions opm/input/eclipse/Schedule/Well/Well.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ Well::Well(const std::string& wname_arg,
bool allow_xflow,
bool auto_shutin,
int pvt_table_,
GasInflowEquation inflow_eq):
GasInflowEquation inflow_eq,
bool temp_option):
wname(wname_arg),
group_name(gname),
init_step(init_step_arg),
Expand Down Expand Up @@ -504,6 +505,10 @@ Well::Well(const std::string& wname_arg,
well_temperature(Metric::TemperatureOffset + ParserKeywords::STCOND::TEMPERATURE::defaultValue),
well_inj_mult(std::nullopt)
{
if (temp_option) {
well_temperature = Metric::TemperatureOffset + 0.0;
}

auto p = std::make_shared<WellProductionProperties>(this->unit_system, this->wname);
p->whistctl_cmode = whistctl_cmode;
this->updateProduction(p);
Expand Down Expand Up @@ -918,14 +923,6 @@ bool Well::handleCOMPSEGS(const DeckKeyword& keyword,
const ScheduleGrid& grid,
const ParseContext& parseContext,
ErrorGuard& errors) {
if (!this->segments) {
throw OpmInputError{
fmt::format("WELSEGS must be specified for well {} "
"before COMPSEGS being input.",
this->name()),
keyword.location()
};
}
auto [new_connections, new_segments] = Compsegs::processCOMPSEGS(
keyword,
*this->connections,
Expand Down
3 changes: 2 additions & 1 deletion opm/input/eclipse/Schedule/Well/Well.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ class Well {
bool allow_xflow,
bool auto_shutin,
int pvt_table,
GasInflowEquation inflow_eq);
GasInflowEquation inflow_eq,
bool temp_option = false);

Well(const RestartIO::RstWell& rst_well,
int report_step,
Expand Down