Merge pull request #5305 from hnil/shut_inj_temp

fixing some of output
This commit is contained in:
Atgeirr Flø Rasmussen 2024-09-17 14:33:29 +02:00 committed by GitHub
commit 9c74c4d638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,8 +96,8 @@ namespace Opm {
this->alternative_well_rate_init_ =
Parameters::Get<Parameters::AlternativeWellRateInit>();
using SourceDataSpan = typename
PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;
using SourceDataSpan =
typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<Scalar>;
this->wbpCalculationService_
.localCellIndex([this](const std::size_t globalIndex)
@ -1270,7 +1270,7 @@ namespace Opm {
}
// This function is to be used for well groups in an extended network that act as a subsea manifold
// The wells of such group should have a common THP and total phase rate(s) obeying (if possible)
// The wells of such group should have a common THP and total phase rate(s) obeying (if possible)
// the well group constraint set by GCONPROD
template <typename TypeTag>
void
@ -1299,7 +1299,7 @@ namespace Opm {
const auto pu = this->phase_usage_;
//TODO: Auto choke combined with RESV control is not supported
std::vector<Scalar> resv_coeff(pu.num_phases, 1.0);
Scalar gratTargetFromSales = 0.0;
Scalar gratTargetFromSales = 0.0;
if (group_state.has_grat_sales_target(group.name()))
gratTargetFromSales = group_state.grat_sales_target(group.name());
@ -2356,7 +2356,7 @@ namespace Opm {
this->groupState(),
this->wellState(),
deferred_logger);
if (changed_individual) {
changed = true;
updateAndCommunicate(reportStepIdx, iterationIdx, deferred_logger);
@ -2734,14 +2734,18 @@ namespace Opm {
const int nw = this->numLocalWells();
for (auto wellID = 0*nw; wellID < nw; ++wellID) {
const Well& well = this->wells_ecl_[wellID];
if (well.isInjector())
continue;
auto& ws = this->wellState().well(wellID);
if (well.isInjector()){
if( !(ws.status == WellStatus::STOP)){
this->wellState().well(wellID).temperature = well.inj_temperature();
continue;
}
}
std::array<Scalar,2> weighted{0.0,0.0};
auto& [weighted_temperature, total_weight] = weighted;
auto& well_info = this->local_parallel_well_info_[wellID].get();
auto& ws = this->wellState().well(wellID);
auto& perf_data = ws.perf_data;
auto& perf_phase_rate = perf_data.phase_rates;
@ -2766,6 +2770,7 @@ namespace Opm {
perfPhaseRate = perf_phase_rate[ perf*np + phaseIdx ];
weight_factor += cellDensity * perfPhaseRate/cellBinv * cellInternalEnergy/cellTemperatures;
}
weight_factor = std::abs(weight_factor)+1e-13;
total_weight += weight_factor;
weighted_temperature += weight_factor * cellTemperatures;
}