Compare commits
8 Commits
master
...
release/20
Author | SHA1 | Date | |
---|---|---|---|
|
0a1691fbba | ||
|
049394497b | ||
|
ca27588d5a | ||
|
678676484b | ||
|
1415d849de | ||
|
7f24108d09 | ||
|
bcc96eda2c | ||
|
75b81a16a5 |
2
debian/changelog
vendored
2
debian/changelog
vendored
@ -1,4 +1,4 @@
|
|||||||
opm-common (2019.04-pre~xenial) xenial; urgency=medium
|
opm-common (2021.04-rfinal-1~bionic) bionic; urgency=medium
|
||||||
|
|
||||||
* New release
|
* New release
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
Module: opm-common
|
Module: opm-common
|
||||||
Description: Open Porous Media Initiative shared infrastructure
|
Description: Open Porous Media Initiative shared infrastructure
|
||||||
Version: 2021.04-pre
|
Version: 2021.04
|
||||||
Label: 2021.04-pre
|
Label: 2021.04
|
||||||
Maintainer: opm@opm-project.org
|
Maintainer: opm@opm-project.org
|
||||||
MaintainerName: OPM community
|
MaintainerName: OPM community
|
||||||
Url: http://opm-project.org
|
Url: http://opm-project.org
|
||||||
|
@ -197,7 +197,7 @@ namespace Opm {
|
|||||||
private:
|
private:
|
||||||
constexpr static std::size_t numvals = 5;
|
constexpr static std::size_t numvals = 5;
|
||||||
|
|
||||||
std::array<double, numvals> values_;
|
std::array<double, numvals> values_ = {0};
|
||||||
|
|
||||||
std::size_t index(const Value ix) const
|
std::size_t index(const Value ix) const
|
||||||
{
|
{
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ namespace Opm
|
|||||||
pack_map<K,T>(value_list, index_list);
|
pack_map<K,T>(value_list, index_list);
|
||||||
|
|
||||||
serializer.vector(value_list);
|
serializer.vector(value_list);
|
||||||
serializer.template vector<std::size_t, false>(index_list);
|
serializer(index_list);
|
||||||
|
|
||||||
if (!serializer.isSerializing())
|
if (!serializer.isSerializing())
|
||||||
unpack_map<K,T>(value_list, index_list);
|
unpack_map<K,T>(value_list, index_list);
|
||||||
@ -419,7 +419,8 @@ namespace Opm
|
|||||||
for (const auto& key : key_list) {
|
for (const auto& key : key_list) {
|
||||||
auto& value = current_map.get_ptr(key);
|
auto& value = current_map.get_ptr(key);
|
||||||
if (value) {
|
if (value) {
|
||||||
if (!(*value == current_value[key])) {
|
auto it = current_value.find(key);
|
||||||
|
if (it == current_value.end() || !(*value == it->second)) {
|
||||||
value_list.push_back( *value );
|
value_list.push_back( *value );
|
||||||
index_list.push_back( index );
|
index_list.push_back( index );
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
%define tag final
|
%define tag final
|
||||||
|
|
||||||
Name: opm-common
|
Name: opm-common
|
||||||
Version: 2018.10
|
Version: 2021.04
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Open Porous Media - common helpers and buildsystem
|
Summary: Open Porous Media - common helpers and buildsystem
|
||||||
License: GPL-3.0
|
License: GPL-3.0
|
||||||
|
@ -926,6 +926,7 @@ quantity roew(const fn_args& args) {
|
|||||||
return { oil_prod / args.initial_inplace.get( region_name, Opm::Inplace::Phase::OIL, args.num ) , measure::identity };
|
return { oil_prod / args.initial_inplace.get( region_name, Opm::Inplace::Phase::OIL, args.num ) , measure::identity };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< bool injection = true>
|
||||||
inline quantity temperature( const fn_args& args ) {
|
inline quantity temperature( const fn_args& args ) {
|
||||||
const quantity zero = { 0, measure::temperature };
|
const quantity zero = { 0, measure::temperature };
|
||||||
if (args.schedule_wells.empty())
|
if (args.schedule_wells.empty())
|
||||||
@ -933,7 +934,8 @@ inline quantity temperature( const fn_args& args ) {
|
|||||||
|
|
||||||
const auto p = args.wells.find(args.schedule_wells.front().name());
|
const auto p = args.wells.find(args.schedule_wells.front().name());
|
||||||
if ((p == args.wells.end()) ||
|
if ((p == args.wells.end()) ||
|
||||||
(p->second.dynamicStatus == Opm::Well::Status::SHUT))
|
(p->second.dynamicStatus == Opm::Well::Status::SHUT) ||
|
||||||
|
(p->second.current_control.isProducer == injection))
|
||||||
{
|
{
|
||||||
return zero;
|
return zero;
|
||||||
}
|
}
|
||||||
@ -1510,8 +1512,8 @@ static const std::unordered_map< std::string, ofun > funs = {
|
|||||||
|
|
||||||
{ "WBHP", bhp },
|
{ "WBHP", bhp },
|
||||||
{ "WTHP", thp },
|
{ "WTHP", thp },
|
||||||
{ "WTPCHEA", temperature},
|
{ "WTPCHEA", temperature< producer >},
|
||||||
{ "WTICHEA", temperature},
|
{ "WTICHEA", temperature< injector >},
|
||||||
{ "WVPRT", res_vol_production_target },
|
{ "WVPRT", res_vol_production_target },
|
||||||
|
|
||||||
{ "WMCTL", well_control_mode },
|
{ "WMCTL", well_control_mode },
|
||||||
|
@ -210,6 +210,7 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const std::optional
|
|||||||
|
|
||||||
result.m_static = ScheduleStatic::serializeObject();
|
result.m_static = ScheduleStatic::serializeObject();
|
||||||
result.snapshots = { ScheduleState::serializeObject() };
|
result.snapshots = { ScheduleState::serializeObject() };
|
||||||
|
result.m_sched_deck = ScheduleDeck::serializeObject();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -142,9 +142,11 @@ const KeywordLocation& ScheduleBlock::location() const {
|
|||||||
|
|
||||||
ScheduleBlock ScheduleBlock::serializeObject() {
|
ScheduleBlock ScheduleBlock::serializeObject() {
|
||||||
ScheduleBlock block;
|
ScheduleBlock block;
|
||||||
|
block.m_time_type = ScheduleTimeType::TSTEP;
|
||||||
block.m_start_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 2003, 10, 10 )));
|
block.m_start_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 2003, 10, 10 )));
|
||||||
block.m_end_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 1993, 07, 06 )));
|
block.m_end_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 1993, 07, 06 )));
|
||||||
block.m_location = KeywordLocation{ "Dummy", "File", 123 };
|
block.m_location = KeywordLocation::serializeObject();
|
||||||
|
block.m_keywords = {DeckKeyword::serializeObject()};
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +326,7 @@ ScheduleDeck ScheduleDeck::serializeObject() {
|
|||||||
ScheduleDeck deck;
|
ScheduleDeck deck;
|
||||||
deck.m_restart_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 2013, 12, 12 )));
|
deck.m_restart_time = TimeService::from_time_t( asTimeT( TimeStampUTC( 2013, 12, 12 )));
|
||||||
deck.m_restart_offset = 123;
|
deck.m_restart_offset = 123;
|
||||||
deck.m_location = KeywordLocation{ "Deck", "DeckFile", 321 };
|
deck.m_location = KeywordLocation::serializeObject();
|
||||||
deck.m_blocks = { ScheduleBlock::serializeObject(), ScheduleBlock::serializeObject() };
|
deck.m_blocks = { ScheduleBlock::serializeObject(), ScheduleBlock::serializeObject() };
|
||||||
return deck;
|
return deck;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user