mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5915 from akva2/serialize_glift_last_opt
BlackoilWellModelGasLift: serialize last_glift_opt_time
This commit is contained in:
commit
6bfb60ded0
@ -198,9 +198,10 @@ void SimulatorSerializer::checkSerializedCmdLine(const std::string& current,
|
|||||||
[](const std::string& line)
|
[](const std::string& line)
|
||||||
{
|
{
|
||||||
return line.compare(0, 11, "EclDeckFile") != 0 &&
|
return line.compare(0, 11, "EclDeckFile") != 0 &&
|
||||||
line.compare(0, 8, "LoadStep") != 0 &&
|
|
||||||
line.compare(0, 9, "OutputDir") != 0 &&
|
line.compare(0, 9, "OutputDir") != 0 &&
|
||||||
|
line.compare(0, 8, "LoadFile") != 0 &&
|
||||||
line.compare(0, 8, "SaveFile") != 0 &&
|
line.compare(0, 8, "SaveFile") != 0 &&
|
||||||
|
line.compare(0, 8, "LoadStep") != 0 &&
|
||||||
line.compare(0, 8, "SaveStep") != 0;
|
line.compare(0, 8, "SaveStep") != 0;
|
||||||
});
|
});
|
||||||
return output;
|
return output;
|
||||||
|
@ -57,6 +57,15 @@ public:
|
|||||||
|
|
||||||
bool terminalOutput() const { return terminal_output_; }
|
bool terminalOutput() const { return terminal_output_; }
|
||||||
|
|
||||||
|
template<class Serializer>
|
||||||
|
void serializeOp(Serializer& serializer)
|
||||||
|
{
|
||||||
|
serializer(last_glift_opt_time_);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool operator==(const BlackoilWellModelGasLiftGeneric& that) const
|
||||||
|
{ return this->last_glift_opt_time_ == that.last_glift_opt_time_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void gliftDebugShowALQ(const std::vector<WellInterfaceGeneric<Scalar>*>& well_container,
|
void gliftDebugShowALQ(const std::vector<WellInterfaceGeneric<Scalar>*>& well_container,
|
||||||
const WellState<Scalar>& wellState,
|
const WellState<Scalar>& wellState,
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
|
|
||||||
#include <opm/simulators/utils/DeferredLogger.hpp>
|
#include <opm/simulators/utils/DeferredLogger.hpp>
|
||||||
#include <opm/simulators/wells/BlackoilWellModelConstraints.hpp>
|
#include <opm/simulators/wells/BlackoilWellModelConstraints.hpp>
|
||||||
|
#include <opm/simulators/wells/BlackoilWellModelGasLift.hpp>
|
||||||
#include <opm/simulators/wells/BlackoilWellModelGuideRates.hpp>
|
#include <opm/simulators/wells/BlackoilWellModelGuideRates.hpp>
|
||||||
#include <opm/simulators/wells/BlackoilWellModelRestart.hpp>
|
#include <opm/simulators/wells/BlackoilWellModelRestart.hpp>
|
||||||
#include <opm/simulators/wells/GasLiftStage2.hpp>
|
#include <opm/simulators/wells/GasLiftStage2.hpp>
|
||||||
@ -87,6 +88,7 @@ namespace Opm {
|
|||||||
template<class Scalar>
|
template<class Scalar>
|
||||||
BlackoilWellModelGeneric<Scalar>::
|
BlackoilWellModelGeneric<Scalar>::
|
||||||
BlackoilWellModelGeneric(Schedule& schedule,
|
BlackoilWellModelGeneric(Schedule& schedule,
|
||||||
|
BlackoilWellModelGasLiftGeneric<Scalar>& gaslift,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const EclipseState& eclState,
|
const EclipseState& eclState,
|
||||||
const PhaseUsage& phase_usage,
|
const PhaseUsage& phase_usage,
|
||||||
@ -95,6 +97,7 @@ BlackoilWellModelGeneric(Schedule& schedule,
|
|||||||
, summaryState_(summaryState)
|
, summaryState_(summaryState)
|
||||||
, eclState_(eclState)
|
, eclState_(eclState)
|
||||||
, comm_(comm)
|
, comm_(comm)
|
||||||
|
, gen_gaslift_(gaslift)
|
||||||
, wbp_(*this)
|
, wbp_(*this)
|
||||||
, phase_usage_(phase_usage)
|
, phase_usage_(phase_usage)
|
||||||
, terminal_output_(comm_.rank() == 0 &&
|
, terminal_output_(comm_.rank() == 0 &&
|
||||||
@ -2090,6 +2093,26 @@ reportGroupSwitching(DeferredLogger& local_deferredLogger) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
|
bool BlackoilWellModelGeneric<Scalar>::
|
||||||
|
operator==(const BlackoilWellModelGeneric& rhs) const
|
||||||
|
{
|
||||||
|
return this->initial_step_ == rhs.initial_step_
|
||||||
|
&& this->report_step_starts_ == rhs.report_step_starts_
|
||||||
|
&& this->last_run_wellpi_ == rhs.last_run_wellpi_
|
||||||
|
&& this->local_shut_wells_ == rhs.local_shut_wells_
|
||||||
|
&& this->closed_this_step_ == rhs.closed_this_step_
|
||||||
|
&& this->node_pressures_ == rhs.node_pressures_
|
||||||
|
&& this->prev_inj_multipliers_ == rhs.prev_inj_multipliers_
|
||||||
|
&& this->active_wgstate_ == rhs.active_wgstate_
|
||||||
|
&& this->last_valid_wgstate_ == rhs.last_valid_wgstate_
|
||||||
|
&& this->nupcol_wgstate_ == rhs.nupcol_wgstate_
|
||||||
|
&& this->switched_prod_groups_ == rhs.switched_prod_groups_
|
||||||
|
&& this->switched_inj_groups_ == rhs.switched_inj_groups_
|
||||||
|
&& this->closed_offending_wells_ == rhs.closed_offending_wells_
|
||||||
|
&& this->gen_gaslift_ == rhs.gen_gaslift_;
|
||||||
|
}
|
||||||
|
|
||||||
template class BlackoilWellModelGeneric<double>;
|
template class BlackoilWellModelGeneric<double>;
|
||||||
|
|
||||||
#if FLOW_INSTANTIATE_FLOAT
|
#if FLOW_INSTANTIATE_FLOAT
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
namespace Opm {
|
namespace Opm {
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class EclipseState;
|
class EclipseState;
|
||||||
|
template<class Scalar> class BlackoilWellModelGasLiftGeneric;
|
||||||
template<class Scalar> class GasLiftGroupInfo;
|
template<class Scalar> class GasLiftGroupInfo;
|
||||||
template<class Scalar> class GasLiftSingleWellGeneric;
|
template<class Scalar> class GasLiftSingleWellGeneric;
|
||||||
template<class Scalar> class GasLiftWellState;
|
template<class Scalar> class GasLiftWellState;
|
||||||
@ -91,6 +92,7 @@ class BlackoilWellModelGeneric
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlackoilWellModelGeneric(Schedule& schedule,
|
BlackoilWellModelGeneric(Schedule& schedule,
|
||||||
|
BlackoilWellModelGasLiftGeneric<Scalar>& gaslift,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const EclipseState& eclState,
|
const EclipseState& eclState,
|
||||||
const PhaseUsage& phase_usage,
|
const PhaseUsage& phase_usage,
|
||||||
@ -256,24 +258,10 @@ public:
|
|||||||
serializer(switched_prod_groups_);
|
serializer(switched_prod_groups_);
|
||||||
serializer(switched_inj_groups_);
|
serializer(switched_inj_groups_);
|
||||||
serializer(closed_offending_wells_);
|
serializer(closed_offending_wells_);
|
||||||
|
serializer(gen_gaslift_);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const BlackoilWellModelGeneric& rhs) const
|
bool operator==(const BlackoilWellModelGeneric& rhs) const;
|
||||||
{
|
|
||||||
return this->initial_step_ == rhs.initial_step_ &&
|
|
||||||
this->report_step_starts_ == rhs.report_step_starts_ &&
|
|
||||||
this->last_run_wellpi_ == rhs.last_run_wellpi_ &&
|
|
||||||
this->local_shut_wells_ == rhs.local_shut_wells_ &&
|
|
||||||
this->closed_this_step_ == rhs.closed_this_step_ &&
|
|
||||||
this->node_pressures_ == rhs.node_pressures_ &&
|
|
||||||
this->prev_inj_multipliers_ == rhs.prev_inj_multipliers_ &&
|
|
||||||
this->active_wgstate_ == rhs.active_wgstate_ &&
|
|
||||||
this->last_valid_wgstate_ == rhs.last_valid_wgstate_ &&
|
|
||||||
this->nupcol_wgstate_ == rhs.nupcol_wgstate_ &&
|
|
||||||
this->switched_prod_groups_ == rhs.switched_prod_groups_ &&
|
|
||||||
this->switched_inj_groups_ == rhs.switched_inj_groups_ &&
|
|
||||||
this->closed_offending_wells_ == rhs.closed_offending_wells_;
|
|
||||||
}
|
|
||||||
|
|
||||||
const ParallelWellInfo<Scalar>&
|
const ParallelWellInfo<Scalar>&
|
||||||
parallelWellInfo(const std::size_t idx) const
|
parallelWellInfo(const std::size_t idx) const
|
||||||
@ -472,6 +460,7 @@ protected:
|
|||||||
const SummaryState& summaryState_;
|
const SummaryState& summaryState_;
|
||||||
const EclipseState& eclState_;
|
const EclipseState& eclState_;
|
||||||
const Parallel::Communication& comm_;
|
const Parallel::Communication& comm_;
|
||||||
|
BlackoilWellModelGasLiftGeneric<Scalar>& gen_gaslift_;
|
||||||
BlackoilWellModelWBP<Scalar> wbp_;
|
BlackoilWellModelWBP<Scalar> wbp_;
|
||||||
|
|
||||||
PhaseUsage phase_usage_;
|
PhaseUsage phase_usage_;
|
||||||
|
@ -71,6 +71,7 @@ namespace Opm {
|
|||||||
BlackoilWellModel(Simulator& simulator, const PhaseUsage& phase_usage)
|
BlackoilWellModel(Simulator& simulator, const PhaseUsage& phase_usage)
|
||||||
: WellConnectionModule(*this, simulator.gridView().comm())
|
: WellConnectionModule(*this, simulator.gridView().comm())
|
||||||
, BlackoilWellModelGeneric<Scalar>(simulator.vanguard().schedule(),
|
, BlackoilWellModelGeneric<Scalar>(simulator.vanguard().schedule(),
|
||||||
|
gaslift_,
|
||||||
simulator.vanguard().summaryState(),
|
simulator.vanguard().summaryState(),
|
||||||
simulator.vanguard().eclState(),
|
simulator.vanguard().eclState(),
|
||||||
phase_usage,
|
phase_usage,
|
||||||
|
@ -297,12 +297,13 @@ class BlackoilWellModelGenericTest : public BlackoilWellModelGeneric<double>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BlackoilWellModelGenericTest(Schedule& schedule,
|
BlackoilWellModelGenericTest(Schedule& schedule,
|
||||||
|
BlackoilWellModelGasLiftGeneric<double>& gaslift,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const EclipseState& eclState,
|
const EclipseState& eclState,
|
||||||
const PhaseUsage& phase_usage,
|
const PhaseUsage& phase_usage,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool deserialize)
|
bool deserialize)
|
||||||
: BlackoilWellModelGeneric<double>(schedule, summaryState,
|
: BlackoilWellModelGeneric<double>(schedule, gaslift, summaryState,
|
||||||
eclState, phase_usage, comm)
|
eclState, phase_usage, comm)
|
||||||
{
|
{
|
||||||
if (deserialize) {
|
if (deserialize) {
|
||||||
@ -366,6 +367,16 @@ private:
|
|||||||
ParallelWellInfo<double> dummy;
|
ParallelWellInfo<double> dummy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class BlackoilWellModelGasLiftGenericTest : public BlackoilWellModelGasLiftGeneric<double>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BlackoilWellModelGasLiftGenericTest()
|
||||||
|
: BlackoilWellModelGasLiftGeneric<double>(false)
|
||||||
|
{
|
||||||
|
this->last_glift_opt_time_ = 1234.5;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(BlackoilWellModelGeneric)
|
BOOST_AUTO_TEST_CASE(BlackoilWellModelGeneric)
|
||||||
@ -375,14 +386,15 @@ BOOST_AUTO_TEST_CASE(BlackoilWellModelGeneric)
|
|||||||
Opm::EclipseState eclState{};
|
Opm::EclipseState eclState{};
|
||||||
Opm::PhaseUsage phase_usage{};
|
Opm::PhaseUsage phase_usage{};
|
||||||
Opm::Parallel::Communication comm{};
|
Opm::Parallel::Communication comm{};
|
||||||
Opm::BlackoilWellModelGenericTest data_out(schedule, summaryState,
|
Opm::BlackoilWellModelGasLiftGenericTest gaslift;
|
||||||
|
Opm::BlackoilWellModelGenericTest data_out(schedule, gaslift, summaryState,
|
||||||
eclState, phase_usage, comm, false);
|
eclState, phase_usage, comm, false);
|
||||||
data_out.setSerializationTestData();
|
data_out.setSerializationTestData();
|
||||||
Opm::Serialization::MemPacker packer;
|
Opm::Serialization::MemPacker packer;
|
||||||
Opm::Serializer ser(packer);
|
Opm::Serializer ser(packer);
|
||||||
ser.pack(data_out);
|
ser.pack(data_out);
|
||||||
const size_t pos1 = ser.position();
|
const size_t pos1 = ser.position();
|
||||||
Opm::BlackoilWellModelGenericTest data_in(schedule, summaryState,
|
Opm::BlackoilWellModelGenericTest data_in(schedule, gaslift, summaryState,
|
||||||
eclState, phase_usage, comm, true);
|
eclState, phase_usage, comm, true);
|
||||||
ser.unpack(data_in);
|
ser.unpack(data_in);
|
||||||
const size_t pos2 = ser.position();
|
const size_t pos2 = ser.position();
|
||||||
|
Loading…
Reference in New Issue
Block a user