adding simple summary output

only outputting the bhp for the moment.
This commit is contained in:
Kai Bao committed 2025-03-31 11:47:54 +02:00
1 parent 414506f141
commit 4106fba360
6 files changed
+49 -3

No files matched your search

@@ -27,6 +27,8 @@
#include <opm/simulators/wells/WellContainer.hpp>
#include <opm/output/data/Wells.hpp>
#include "SingleCompWellState.hpp"
@@ -51,6 +53,8 @@ public:
const SingleCompWellState<Scalar>& operator[](const std::string& well_name) const;
SingleCompWellState<Scalar>& operator[](const std::string& well_name);
data::Wells report() const;
private:
WellContainer<SingleCompWellState<Scalar>> wells_;
@@ -131,5 +131,27 @@ operator[](const std::string& well_name)
return this->wells_[well_name];
}
template <typename Scalar>
data::Wells
CompWellState<Scalar>::
report() const
{
if (this->wells_.empty()) {
return {};
}
data::Wells res;
for (std::size_t w = 0; w < this->wells_.size(); ++w) {
const auto& ws = this->wells_[w];
if (ws.status == Well::Status::SHUT) {
continue;
}
auto& well = res[ws.name];
well.bhp = ws.bhp;
well.temperature = ws.temperature;
}
return res;
}
} // end of namespace Opm
@@ -577,6 +577,8 @@ updateWellState(SingleCompWellState<Scalar>& well_state) const
// only gas injection yet
surface_phase_rates[FluidSystem::gasPhaseIdx] = total_rate;
}
well_state.output();
// std::cout << std::endl;
}
template <typename TypeTag>
@@ -103,9 +103,8 @@ public:
void computeTotalRatesForDof(RateVector& /*rate*/, unsigned /*globalIdx*/) const;
//
[[nodiscard]] data::Wells wellData() const {
return data::Wells{};
}
[[nodiscard]] data::Wells wellData() const;
[[nodiscard]] data::WellBlockAveragePressures wellBlockAveragePressures() const {
return data::WellBlockAveragePressures{};
}
@@ -255,6 +255,14 @@ getWellConvergence() const
return converged;
}
template <typename TypeTag>
data::Wells
CompositionalWellModel<TypeTag>::
wellData() const
{
return this->comp_well_states_.report();
}
//template <typename TypeTag>
//void
//CompositionalWellModel<TypeTag>::
@@ -91,6 +91,17 @@ public:
void update_injector_targets(const Well& well, const SummaryState& st);
Scalar get_total_surface_rate() const;
void output() const
{
std::cout << " well name " << name << std::endl;
std::cout << " phase rates ";
for (const auto& val : surface_phase_rates) {
std::cout << val * 86400. << " ";
}
std::cout << std::endl;
std::cout << " bhp " << bhp/1.e5 << std::endl;
}
};
} // namespace Opm