mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
added: write out RPTSOL configured FIPs to PRT file on simulation start
add a method in EclWriter to enable this. this is called the first time a call is made to WriteOutput, as that happens after initial conditions have been applied which is required to get the proper output. this also fixes a long-standing issue where the initial FIP state was taken after the first time step.
This commit is contained in:
parent
1e41df3bca
commit
db85303a3e
@ -1335,10 +1335,7 @@ accumulateRegionSums(const Parallel::Communication& comm)
|
||||
}
|
||||
|
||||
// The first time the outputFipLog function is run we store the inplace values in
|
||||
// the initialInplace_ member. This has at least two problems:
|
||||
//
|
||||
// o We really want the *initial* value - now we get the value after
|
||||
// the first timestep.
|
||||
// the initialInplace_ member. This has a problem:
|
||||
//
|
||||
// o For restarted runs this is obviously wrong.
|
||||
//
|
||||
|
@ -754,8 +754,6 @@ public:
|
||||
if (enableEclOutput_){
|
||||
eclWriter_->writeOutput(std::move(localCellData), isSubStep);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void finalizeOutput() {
|
||||
@ -1346,6 +1344,10 @@ public:
|
||||
|
||||
if (enableAquifers_)
|
||||
aquiferModel_.initialSolutionApplied();
|
||||
|
||||
if (this->simulator().episodeIndex() == 0) {
|
||||
eclWriter_->writeInitialFIPReport();
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -319,6 +319,43 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
//! \brief Writes the initial FIP report as configured in RPTSOL.
|
||||
void writeInitialFIPReport()
|
||||
{
|
||||
const auto& fip = simulator_.vanguard().eclState().getEclipseConfig().fip();
|
||||
if (!fip.output(FIPConfig::OutputField::FIELD) &&
|
||||
!fip.output(FIPConfig::OutputField::RESV)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
const int numElements = gridView.size(/*codim=*/0);
|
||||
|
||||
this->eclOutputModule_->
|
||||
allocBuffers(numElements, 0, false, false, /*isRestart*/ false);
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
for (int dofIdx = 0; dofIdx < numElements; ++dofIdx) {
|
||||
const auto& intQuants = *simulator_.model().cachedIntensiveQuantities(dofIdx, /*timeIdx=*/0);
|
||||
const auto totVolume = simulator_.model().dofTotalVolume(dofIdx);
|
||||
|
||||
this->eclOutputModule_->updateFluidInPlace(dofIdx, intQuants, totVolume);
|
||||
}
|
||||
|
||||
std::map<std::string, double> miscSummaryData;
|
||||
std::map<std::string, std::vector<double>> regionData;
|
||||
Inplace inplace;
|
||||
{
|
||||
OPM_TIMEBLOCK(outputFipLogAndFipresvLog);
|
||||
inplace = eclOutputModule_->outputFipLog(miscSummaryData, regionData, 0,
|
||||
false, simulator_.gridView().comm());
|
||||
eclOutputModule_->outputFipresvLog(miscSummaryData, regionData, 0,
|
||||
false, simulator_.gridView().comm());
|
||||
}
|
||||
}
|
||||
|
||||
void writeOutput(data::Solution&& localCellData, bool isSubStep)
|
||||
{
|
||||
OPM_TIMEBLOCK(writeOutput);
|
||||
|
Loading…
Reference in New Issue
Block a user