Add name member to SingleWellState

This commit is contained in:
Joakim Hove 2021-10-30 16:48:42 +02:00
parent 03cf7b0327
commit 807ac101d8
4 changed files with 9 additions and 7 deletions

View File

@ -21,8 +21,9 @@
namespace Opm {
SingleWellState::SingleWellState(const ParallelWellInfo& pinfo, bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp)
: parallel_info(pinfo)
SingleWellState::SingleWellState(const std::string& name_, const ParallelWellInfo& pinfo, bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp)
: name(name_)
, parallel_info(pinfo)
, producer(is_producer)
, temperature(temp)
, well_potentials(num_phases)

View File

@ -33,8 +33,9 @@ namespace Opm {
class SingleWellState {
public:
SingleWellState(const ParallelWellInfo& pinfo, bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp);
SingleWellState(const std::string& name, const ParallelWellInfo& pinfo, bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp);
std::string name;
std::reference_wrapper<const ParallelWellInfo> parallel_info;
Well::Status status{Well::Status::OPEN};

View File

@ -71,7 +71,7 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
const int np = pu.num_phases;
double temp = well.isInjector() ? well.injectionControls(summary_state).temperature : 273.15 + 15.56;
auto& ws = this->wells_.add(well.name(), SingleWellState{well_info, well.isProducer(), well_perf_data.size(), static_cast<std::size_t>(np), temp});
auto& ws = this->wells_.add(well.name(), SingleWellState{well.name(), well_info, well.isProducer(), well_perf_data.size(), static_cast<std::size_t>(np), temp});
if ( ws.perf_data.empty())
return;

View File

@ -574,9 +574,9 @@ BOOST_AUTO_TEST_CASE(TESTPerfData) {
BOOST_AUTO_TEST_CASE(TestSingleWellState) {
Opm::ParallelWellInfo pinfo;
Opm::SingleWellState ws1(pinfo, true, 10, 3, 1);
Opm::SingleWellState ws2(pinfo, true, 10, 3, 2);
Opm::SingleWellState ws3(pinfo, false, 10, 3, 3);
Opm::SingleWellState ws1("W1", pinfo, true, 10, 3, 1);
Opm::SingleWellState ws2("W2", pinfo, true, 10, 3, 2);
Opm::SingleWellState ws3("W3", pinfo, false, 10, 3, 3);
ws1.bhp = 100;
ws1.thp = 200;