WIP in handling the summary output for AQUFLUX

AAQR, AAQP, AAQT works fine while FAQR and FAQT are not handled yet.
This commit is contained in:
Kai Bao
2023-02-09 22:11:39 +01:00
parent 83457f679e
commit d412158cf7
5 changed files with 23 additions and 6 deletions

View File

@@ -263,6 +263,7 @@ namespace Opm
const Well& getWellatEnd(const std::string& well_name) const;
// get the list of the constant flux aquifer through the whole schedule
std::vector<int> getAquiferFluxListEnd() const;
bool hasAquiferFlux(int id) const;
std::vector<Well> getWells(std::size_t timeStep) const;
std::vector<Well> getWellsatEnd() const;
void shut_well(const std::string& well_name, std::size_t report_step);
@@ -367,6 +368,7 @@ namespace Opm
this->template pack_unpack_map<int, VFPInjTable>(serializer);
this->template pack_unpack_map<std::string, Group>(serializer);
this->template pack_unpack_map<std::string, Well>(serializer);
// TODO: anything related to aquflux aquifers?
}
template <typename T, class Serializer>

View File

@@ -636,8 +636,9 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e
// if there is no RESTART, we just give it to the Report Step zero.
this->create_next(block);
// TODO: we should make the processing of SOLUTIONSection here instead of passing in aqufiers directly
if (report_step == 0) {
// the aqufluxes are from SOLUTION section, should only apply to snapshorts.begin();
// the aqufluxes are from SOLUTION section, should only apply to snapshots.begin();
for (auto& elem: aqufluxs) {
this->snapshots.back().aqufluxs.update(elem.second);
}
@@ -1142,7 +1143,7 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e
return this->getWell(well_name, this->snapshots.size() - 1);
}
std::vector<int> Schedule::getAquiferFluxListEnd() const{
std::vector<int> Schedule::getAquiferFluxListEnd() const {
// TODO: currently, we assume that after an aquifer is created, we will not be able to remove it anymore
// we can only update/modify it
const auto& aquifers = this->snapshots.back().aqufluxs;
@@ -1153,6 +1154,13 @@ void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_e
return ids;
}
bool Schedule::hasAquiferFlux(const int id) const {
// TODO: currently, we assume that after an aquifer is created, we will not be able to remove it anymore
// we can only update/modify it
const auto& aquifers = this->snapshots.back().aqufluxs;
return aquifers.has(id);
}
const Well& Schedule::getWell(const std::string& wellName, std::size_t timeStep) const {
return this->snapshots[timeStep].wells.get(wellName);
}

View File

@@ -633,6 +633,8 @@ captureDynamicdAquiferData(const AquiferConfig& aqConfig,
}
});
// TODO: we should make the AQUFLUX aquifer here
numericAquiferLoop(aqConfig, [this, &summaryState, &aquData, &usys]
(const int aquiferID, const std::size_t cellIndex, const NumericalAquiferCell& aqCell)
{

View File

@@ -528,7 +528,7 @@ namespace {
// TODO: Currently, we put the AQUFLUX aquifers in the Schedule. As a result, we will not be able to
// TODO: to write anything related to AQUFLUX with the current way.
// Schedule needs to be checked for the Aquifer output purpose.
if ((es.aquifer().hasAnalyticalAquifer() || es.aquifer().hasNumericalAquifer()) &&
if ((es.aquifer().hasAnalyticalAquifer() || es.aquifer().hasNumericalAquifer() || !schedule.getAquiferFluxListEnd().empty()) &&
aquiferData.has_value())
{
updateAndWriteAquiferData(es.aquifer(), aquDynData, sumState,

View File

@@ -3369,7 +3369,8 @@ namespace Evaluator {
if (pos == aquifer_units.end()) return false;
// if the aquifer does not exist, should we warn?
if ( !this->es_.aquifer().hasAquifer(this->node_->number) ) return false;
if ( !this->es_.aquifer().hasAquifer(this->node_->number) &&
!this->sched_.hasAquiferFlux(this->node_->number)) return false;
this->paramUnit_ = pos->second;
return true;
@@ -4275,8 +4276,12 @@ configureRequiredRestartParameters(const SummaryConfig& sumcfg,
for (const auto& node : requiredSegmentVectors(sched))
makeEvaluator(node);
if (aqConfig.hasAnalyticalAquifer()) {
const auto aquiferIDs = analyticAquiferIDs(aqConfig);
const auto& aquflux_ids = sched.getAquiferFluxListEnd();
if (aqConfig.hasAnalyticalAquifer() || !aquflux_ids.empty()) {
auto aquiferIDs = analyticAquiferIDs(aqConfig);
if ( !aquflux_ids.empty() ) {
aquiferIDs.insert(aquiferIDs.end(), aquflux_ids.begin(), aquflux_ids.end());
}
for (const auto& node : requiredAquiferVectors(aquiferIDs))
makeEvaluator(node);