28#ifndef OPM_ECL_WRITER_HPP
29#define OPM_ECL_WRITER_HPP
31#include <dune/grid/common/partitionset.hh>
33#include <opm/common/TimingMacros.hpp>
34#include <opm/common/OpmLog/OpmLog.hpp>
35#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
37#include <opm/input/eclipse/Units/UnitSystem.hpp>
38#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
40#include <opm/output/eclipse/Inplace.hpp>
41#include <opm/output/eclipse/RestartValue.hpp>
57#ifdef RESERVOIR_COUPLING_ENABLED
61#include <boost/date_time/posix_time/posix_time.hpp>
114template <
class TypeTag,
class OutputModule>
116 GetPropType<TypeTag, Properties::EquilGrid>,
117 GetPropType<TypeTag, Properties::GridView>,
118 GetPropType<TypeTag, Properties::ElementMapper>,
119 GetPropType<TypeTag, Properties::Scalar>>
129 using Element =
typename GridView::template Codim<0>::Entity;
131 using ElementIterator =
typename GridView::template Codim<0>::Iterator;
134 typedef Dune::MultipleCodimMultipleGeomTypeMapper< GridView > VertexMapper;
136 static constexpr bool enableEnergy =
137 getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::FullyImplicitThermal ||
138 getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::SequentialImplicitThermal;
139 enum { enableMech = getPropValue<TypeTag, Properties::EnableMech>() };
140 static constexpr bool enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>();
141 enum { enableGeochemistry = getPropValue<TypeTag, Properties::EnableGeochemistry>() };
147 OutputModule::registerParameters();
149 Parameters::Register<Parameters::EnableAsyncEclOutput>
150 (
"Write the ECL-formated results in a non-blocking way "
151 "(i.e., using a separate thread).");
152 Parameters::Register<Parameters::EnableEsmry>
153 (
"Write ESMRY file for fast loading of summary data.");
160 :
BaseType(simulator.vanguard().schedule(),
161 simulator.vanguard().eclState(),
162 simulator.vanguard().summaryConfig(),
163 simulator.vanguard().grid(),
164 ((simulator.vanguard().grid().comm().rank() == 0)
165 ? &simulator.vanguard().equilGrid()
167 simulator.vanguard().gridView(),
168 simulator.vanguard().cartesianIndexMapper(),
169 ((simulator.vanguard().grid().comm().rank() == 0)
170 ? &simulator.vanguard().equilCartesianIndexMapper()
172 Parameters::
Get<Parameters::EnableAsyncEclOutput>(),
173 Parameters::
Get<Parameters::EnableEsmry>())
174 , simulator_(simulator)
177 if (this->simulator_.vanguard().grid().comm().size() > 1) {
178 auto smryCfg = (this->simulator_.vanguard().grid().comm().rank() == 0)
179 ? this->
eclIO_->finalSummaryConfig()
182 eclBroadcast(this->simulator_.vanguard().grid().comm(), smryCfg);
184 this->outputModule_ = std::make_unique<OutputModule>
190 this->outputModule_ = std::make_unique<OutputModule>
191 (simulator, this->
eclIO_->finalSummaryConfig(), this->collectOnIORank_);
194 this->rank_ = this->simulator_.vanguard().grid().comm().rank();
196 this->simulator_.vanguard().eclState().computeFipRegionStatistics();
204 return simulator_.vanguard().equilGrid();
213 const int reportStepNum = simulator_.episodeIndex() + 1;
233 if (reportStepNum == 0)
236 const Scalar curTime = simulator_.time() + simulator_.timeStepSize();
237 const Scalar totalCpuTime =
238 simulator_.executionTimer().realTimeElapsed() +
239 simulator_.setupTimer().realTimeElapsed() +
240 simulator_.vanguard().setupTime();
242 const auto localWellData = simulator_.problem().wellModel().wellData();
243 const auto localWBP = simulator_.problem().wellModel().wellBlockAveragePressures();
244 const auto localGroupAndNetworkData = simulator_.problem().wellModel()
245 .groupAndNetworkData(reportStepNum);
247 const auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
248 const auto localWellTestState = simulator_.problem().wellModel().wellTestState();
249 this->prepareLocalCellData(isSubStep, reportStepNum);
251 if (this->outputModule_->needInterfaceFluxes(isSubStep)) {
252 this->captureLocalFluxData();
258 std::map<std::pair<std::string,int>,
double> dummy;
260 outputModule_->getBlockData(),
264 localGroupAndNetworkData,
267 this->outputModule_->getInterRegFlows(),
274 if (! iregFlows.readIsConsistent()) {
275 throw std::runtime_error {
276 "Inconsistent inter-region flow "
277 "region set names in parallel"
285 this->simulator_.vanguard().grid().comm());
289 std::map<std::string, double> miscSummaryData;
290 std::map<std::string, std::vector<double>> regionData;
294 OPM_TIMEBLOCK(outputFipLogAndFipresvLog);
296 inplace = outputModule_->calc_inplace(miscSummaryData, regionData, simulator_.gridView().comm());
304 if (totalCpuTime != 0.0) {
305 miscSummaryData[
"TCPU"] = totalCpuTime;
331 const auto rcGroupRates = this->collectReservoirCouplingGroupRates_();
338 : this->outputModule_->getBlockData();
342 : this->outputModule_->getInterRegFlows();
348 localGroupAndNetworkData,
354 this->outputModule_->initialInplace(),
356 this->summaryState(),
358 rcGroupRates ? &(*rcGroupRates) :
nullptr);
365 const auto& gridView = simulator_.vanguard().gridView();
369 this->outputModule_->
370 allocBuffers(num_interior, 0,
false,
false,
false);
373#pragma omp parallel for
375 for (
int dofIdx = 0; dofIdx < num_interior; ++dofIdx) {
376 const auto& intQuants = *simulator_.model().cachedIntensiveQuantities(dofIdx, 0);
377 const auto totVolume = simulator_.model().dofTotalVolume(dofIdx);
379 this->outputModule_->updateFluidInPlace(dofIdx, intQuants, totVolume);
384 outputModule_->calc_initial_inplace(simulator_.gridView().comm());
387 const auto& fip = simulator_.vanguard().eclState().getEclipseConfig().fip();
388 if (fip.output(FIPConfig::OutputField::FIELD) ||
389 fip.output(FIPConfig::OutputField::RESV))
391 OPM_TIMEBLOCK(outputFipLogAndFipresvLog);
393 const auto start_time = boost::posix_time::
394 from_time_t(simulator_.vanguard().schedule().getStartTime());
397 this->inplace_ = *this->outputModule_->initialInplace();
399 this->outputModule_->
400 outputFipAndResvLog(this->inplace_, 0, 0.0, start_time,
401 false, simulator_.gridView().comm());
405 outputModule_->outputFipAndResvLogToCSV(0,
false, simulator_.gridView().comm());
422 const auto firstStep = this->initialStep();
426 const auto& rpt = this->
schedule_[simStep].rpt_config();
428 if (rpt.contains(
"WELSPECS") && (rpt.at(
"WELSPECS") > 0)) {
431 this->writeWellspecReport(timer);
439 if (rpt.contains(
"WELLS") && rpt.at(
"WELLS") > 0) {
440 this->writeWellflowReport(timer, simStep, rpt.at(
"WELLS"));
443 this->outputModule_->outputFipAndResvLog(this->inplace_,
448 simulator_.gridView().comm());
453 void writeOutput(data::Solution&& localCellData,
const bool isSubStep,
const bool isForcedFinalOutput)
457 const int reportStepNum = simulator_.episodeIndex() + 1;
458 this->prepareLocalCellData(isSubStep, reportStepNum);
459 this->outputModule_->outputErrorLog(simulator_.gridView().comm());
462 auto localWellData = simulator_.problem().wellModel().wellData();
463 auto localGroupAndNetworkData = simulator_.problem().wellModel()
464 .groupAndNetworkData(reportStepNum);
466 auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
467 auto localWellTestState = simulator_.problem().wellModel().wellTestState();
469 const bool isFlowsn = this->outputModule_->getFlows().hasFlowsn();
470 auto flowsn = this->outputModule_->getFlows().getFlowsn();
472 const bool isFloresn = this->outputModule_->getFlows().hasFloresn();
473 auto floresn = this->outputModule_->getFlows().getFloresn();
475 if (! isSubStep || Parameters::Get<Parameters::EnableWriteAllSolutions>()) {
477 if (localCellData.empty()) {
478 this->outputModule_->assignToSolution(localCellData);
482 this->outputModule_->addRftDataToWells(localWellData,
484 simulator_.gridView().comm());
488 this->collectOnIORank_.doesNeedReordering())
496 this->outputModule_->getBlockData(),
497 this->outputModule_->getExtraBlockData(),
500 localGroupAndNetworkData,
510 this->outputModule_->assignGlobalFieldsToSolution(localCellData);
514 const Scalar curTime = simulator_.time() + simulator_.timeStepSize();
515 const Scalar nextStepSize = simulator_.problem().nextTimeStepSize();
516 std::optional<int> timeStepIdx;
517 if (Parameters::Get<Parameters::EnableWriteAllSolutions>()) {
518 timeStepIdx = simulator_.timeStepIndex();
522 std::move(localCellData),
523 std::move(localWellData),
524 std::move(localGroupAndNetworkData),
525 std::move(localAquiferData),
526 std::move(localWellTestState),
529 this->summaryState(),
530 this->simulator_.problem().thresholdPressure().getRestartVector(),
531 curTime, nextStepSize,
532 Parameters::Get<Parameters::EclOutputDoublePrecision>(),
533 isFlowsn, std::move(flowsn),
534 isFloresn, std::move(floresn));
540 const auto enablePCHysteresis = simulator_.problem().materialLawManager()->enablePCHysteresis();
541 const auto enableNonWettingHysteresis = simulator_.problem().materialLawManager()->enableNonWettingHysteresis();
542 const auto enableWettingHysteresis = simulator_.problem().materialLawManager()->enableWettingHysteresis();
543 const auto oilActive = FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx);
544 const auto gasActive = FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx);
545 const auto waterActive = FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx);
546 const auto enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double(
"SWATINIT");
548 std::vector<RestartKey> solutionKeys {
549 {
"PRESSURE", UnitSystem::measure::pressure},
550 {
"SWAT", UnitSystem::measure::identity, waterActive},
551 {
"SGAS", UnitSystem::measure::identity, gasActive},
552 {
"TEMP", UnitSystem::measure::temperature, enableEnergy},
553 {
"SSOLVENT", UnitSystem::measure::identity, enableSolvent},
555 {
"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
556 {
"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
557 {
"RVW", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedWater()},
558 {
"RSW", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGasInWater()},
560 {
"SGMAX", UnitSystem::measure::identity, enableNonWettingHysteresis && oilActive && gasActive},
561 {
"SHMAX", UnitSystem::measure::identity, enableWettingHysteresis && oilActive && gasActive},
563 {
"SOMAX", UnitSystem::measure::identity,
564 (enableNonWettingHysteresis && oilActive && waterActive)
565 || simulator_.problem().vapparsActive(simulator_.episodeIndex())},
567 {
"SOMIN", UnitSystem::measure::identity, enablePCHysteresis && oilActive && gasActive},
568 {
"SWHY1", UnitSystem::measure::identity, enablePCHysteresis && oilActive && waterActive},
569 {
"SWMAX", UnitSystem::measure::identity, enableWettingHysteresis && oilActive && waterActive},
571 {
"PPCW", UnitSystem::measure::pressure, enableSwatinit},
575 const auto& tracers = simulator_.vanguard().eclState().tracer();
577 for (
const auto& tracer : tracers) {
578 const auto enableSolTracer =
579 ((tracer.phase == Phase::GAS) && FluidSystem::enableDissolvedGas()) ||
580 ((tracer.phase == Phase::OIL) && FluidSystem::enableVaporizedOil());
582 solutionKeys.emplace_back(tracer.fname(), UnitSystem::measure::identity,
true);
583 solutionKeys.emplace_back(tracer.sname(), UnitSystem::measure::identity, enableSolTracer);
587 const auto& inputThpres = eclState().getSimulationConfig().getThresholdPressure();
588 const std::vector<RestartKey> extraKeys {
589 {
"OPMEXTRA", UnitSystem::measure::identity,
false},
590 {
"THRESHPR", UnitSystem::measure::pressure, inputThpres.active()},
593 const auto& gridView = this->simulator_.vanguard().gridView();
594 const auto numElements = gridView.size(0);
598 this->outputModule_->allocBuffers(numElements,
604 const auto restartSolution =
606 solutionKeys, gridView.comm(), 0);
608 if (!restartSolution.empty()) {
609 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
611 this->outputModule_->setRestart(restartSolution, elemIdx, globalIdx);
614 this->simulator_.problem().readSolutionFromOutputModule(0,
true);
615 this->simulator_.problem().temperatureModel().init();
616 ElementContext elemCtx(this->simulator_);
617 for (
const auto& elem : elements(gridView, Dune::Partitions::interior)) {
618 elemCtx.updatePrimaryStencil(elem);
619 elemCtx.updatePrimaryIntensiveQuantities(0);
621 this->outputModule_->updateFluidInPlace(elemCtx);
624 this->outputModule_->calc_initial_inplace(this->simulator_.gridView().comm());
632 const auto restartStepIdx = this->simulator_.vanguard()
633 .eclState().getInitConfig().getRestartStep();
635 this->outputModule_->allocBuffers(numElements,
643 const auto restartValues =
646 this->summaryState(),
647 solutionKeys, extraKeys, gridView.comm());
649 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
651 this->outputModule_->setRestart(restartValues.solution, elemIdx, globalIdx);
654 auto& tracer_model = simulator_.problem().tracerModel();
655 for (
int tracer_index = 0; tracer_index < tracer_model.numTracers(); ++tracer_index) {
658 const auto& free_tracer_name = tracer_model.fname(tracer_index);
659 const auto& free_tracer_solution = restartValues.solution
660 .template data<double>(free_tracer_name);
662 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
664 tracer_model.setFreeTracerConcentration
665 (tracer_index, elemIdx, free_tracer_solution[globalIdx]);
670 if ((tracer_model.phase(tracer_index) == Phase::GAS && FluidSystem::enableDissolvedGas()) ||
671 (tracer_model.phase(tracer_index) == Phase::OIL && FluidSystem::enableVaporizedOil()))
673 tracer_model.setEnableSolTracers(tracer_index,
true);
675 const auto& sol_tracer_name = tracer_model.sname(tracer_index);
676 const auto& sol_tracer_solution = restartValues.solution
677 .template data<double>(sol_tracer_name);
679 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
681 tracer_model.setSolTracerConcentration
682 (tracer_index, elemIdx, sol_tracer_solution[globalIdx]);
686 tracer_model.setEnableSolTracers(tracer_index,
false);
688 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
689 tracer_model.setSolTracerConcentration(tracer_index, elemIdx, 0.0);
694 if (inputThpres.active()) {
695 const_cast<Simulator&
>(this->simulator_)
696 .problem().thresholdPressure()
697 .setFromRestart(restartValues.getExtra(
"THRESHPR"));
700 restartTimeStepSize_ = restartValues.getExtra(
"OPMEXTRA")[0];
701 if (restartTimeStepSize_ <= 0) {
702 restartTimeStepSize_ = std::numeric_limits<double>::max();
706 this->simulator_.problem().wellModel()
707 .initFromRestartFile(restartValues);
709 if (!restartValues.aquifer.empty()) {
710 this->simulator_.problem().mutableAquiferModel()
711 .initFromRestart(restartValues.aquifer);
721 this->outputModule_->calc_initial_inplace(this->simulator_.gridView().comm());
724 if (
const auto* iip = this->outputModule_->initialInplace(); iip !=
nullptr) {
725 this->inplace_ = *iip;
731 {
return *outputModule_; }
734 {
return *outputModule_; }
737 {
return restartTimeStepSize_; }
739 template <
class Serializer>
742 serializer(*outputModule_);
746 static bool enableEclOutput_()
748 static bool enable = Parameters::Get<Parameters::EnableEclOutput>();
752 const EclipseState& eclState()
const
753 {
return simulator_.vanguard().eclState(); }
755 SummaryState& summaryState()
756 {
return simulator_.vanguard().summaryState(); }
758 Action::State& actionState()
759 {
return simulator_.vanguard().actionState(); }
762 {
return simulator_.vanguard().udqState(); }
764 const Schedule& schedule()
const
765 {
return simulator_.vanguard().schedule(); }
769 std::optional<data::ReservoirCouplingGroupRates> collectReservoirCouplingGroupRates_()
771#ifdef RESERVOIR_COUPLING_ENABLED
776 using WellModelType = std::remove_cvref_t<
777 decltype(simulator_.problem().wellModel())>;
778 if constexpr (
requires(WellModelType& wm) { wm.isReservoirCouplingMaster(); }) {
779 auto& wellModel = simulator_.problem().wellModel();
780 if (!wellModel.isReservoirCouplingMaster()) {
783 return wellModel.reservoirCouplingMaster()
784 .collectGroupRatesForSummary();
790 void prepareLocalCellData(
const bool isSubStep,
791 const int reportStepNum)
793 OPM_TIMEBLOCK(prepareLocalCellData);
795 if (this->outputModule_->localDataValid()) {
799 const auto& gridView = simulator_.vanguard().gridView();
804 this->outputModule_->
805 allocBuffers(num_interior, reportStepNum,
806 isSubStep && !Parameters::Get<Parameters::EnableWriteAllSolutions>(),
809 ElementContext elemCtx(simulator_);
814 OPM_TIMEBLOCK(prepareCellBasedData);
816 this->outputModule_->prepareDensityAccumulation();
817 this->outputModule_->setupExtractors(isSubStep, reportStepNum);
818 for (
const auto& elem : elements(gridView, Dune::Partitions::interior)) {
819 elemCtx.updatePrimaryStencil(elem);
820 elemCtx.updatePrimaryIntensiveQuantities(0);
822 this->outputModule_->processElement(elemCtx);
823 this->outputModule_->processElementBlockData(elemCtx);
825 this->outputModule_->clearExtractors();
827 this->outputModule_->accumulateDensityParallel();
831 OPM_TIMEBLOCK(prepareFluidInPlace);
834#pragma omp parallel for
836 for (
int dofIdx = 0; dofIdx < num_interior; ++dofIdx) {
837 const auto& intQuants = *simulator_.model().cachedIntensiveQuantities(dofIdx, 0);
838 const auto totVolume = simulator_.model().dofTotalVolume(dofIdx);
840 this->outputModule_->updateFluidInPlace(dofIdx, intQuants, totVolume);
844 this->outputModule_->validateLocalData();
847 this->simulator_.vanguard().grid().comm());
850 void captureLocalFluxData()
852 OPM_TIMEBLOCK(captureLocalData);
854 const auto& gridView = this->simulator_.vanguard().gridView();
855 const auto timeIdx = 0u;
857 auto elemCtx = ElementContext { this->simulator_ };
859 const auto elemMapper = ElementMapper { gridView, Dune::mcmgElementLayout() };
860 const auto activeIndex = [&elemMapper](
const Element& e)
862 return elemMapper.index(e);
865 const auto cartesianIndex = [
this](
const int elemIndex)
867 return this->
cartMapper_.cartesianIndex(elemIndex);
870 this->outputModule_->initializeFluxData();
874 for (
const auto& elem : elements(gridView, Dune::Partitions::interiorBorder)) {
875 elemCtx.updateStencil(elem);
876 elemCtx.updateIntensiveQuantities(timeIdx);
877 elemCtx.updateExtensiveQuantities(timeIdx);
879 this->outputModule_->processFluxes(elemCtx, activeIndex, cartesianIndex);
883 this->simulator_.vanguard().grid().comm())
885 this->outputModule_->finalizeFluxData();
888 void writeWellspecReport(const SimulatorTimer& timer)
const
890 const auto changedWells = this->
schedule_
891 .changed_wells(timer.reportStepNum(), this->initialStep());
893 const auto changedWellLists = this->
schedule_
894 .changedWellLists(timer.reportStepNum(), this->initialStep());
896 if (changedWells.empty() && !changedWellLists) {
900 this->outputModule_->outputWellspecReport(changedWells,
902 timer.reportStepNum(),
903 timer.simulationTimeElapsed(),
904 timer.currentDateTime());
907 void writeWellflowReport(
const SimulatorTimer& timer,
909 const int wellsRequest)
const
911 this->outputModule_->outputTimeStamp(
"WELLS",
912 timer.simulationTimeElapsed(),
913 timer.reportStepNum(),
914 timer.currentDateTime());
916 const auto wantConnData = wellsRequest > 1;
918 this->outputModule_->outputProdLog(simStep, wantConnData);
919 this->outputModule_->outputInjLog(simStep, wantConnData);
920 this->outputModule_->outputCumLog(simStep, wantConnData);
921 this->outputModule_->outputMSWLog(simStep);
924 int initialStep()
const
926 const auto& initConfig = this->eclState().cfg().init();
928 return initConfig.restartRequested()
929 ? initConfig.getRestartStep()
933 Simulator& simulator_;
934 std::unique_ptr<OutputModule> outputModule_;
935 Scalar restartTimeStepSize_;
#define OPM_END_PARALLEL_TRY_CATCH(prefix, comm)
Catch exception and throw in a parallel try-catch clause.
Definition: DeferredLoggingErrorHelpers.hpp:192
#define OPM_BEGIN_PARALLEL_TRY_CATCH()
Macro to setup the try of a parallel try-catch.
Definition: DeferredLoggingErrorHelpers.hpp:158
Contains the classes required to extend the black-oil model by energy.
Declares the properties required by the black oil model.
int localIdxToGlobalIdx(unsigned localIdx) const
Definition: CollectDataOnIORank_impl.hpp:1097
InterRegFlowMap & globalInterRegFlows()
Definition: CollectDataOnIORank.hpp:114
bool isParallel() const
Definition: CollectDataOnIORank.hpp:129
bool isIORank() const
Definition: CollectDataOnIORank.hpp:126
const std::map< std::pair< std::string, int >, double > & globalBlockData() const
Definition: CollectDataOnIORank.hpp:90
void collect(const data::Solution &localCellData, const std::map< std::pair< std::string, int >, double > &localBlockData, std::map< std::pair< std::string, int >, double > &localExtraBlockData, const data::Wells &localWellData, const data::WellBlockAveragePressures &localWBPData, const data::GroupAndNetworkValues &localGroupAndNetworkData, const data::Aquifers &localAquiferData, const WellTestState &localWellTestState, const InterRegFlowMap &interRegFlows, const std::array< FlowsData< double >, 3 > &localFlowsn, const std::array< FlowsData< double >, 3 > &localFloresn)
Definition: CollectDataOnIORank_impl.hpp:964
const data::Solution & globalCellData() const
Definition: CollectDataOnIORank.hpp:93
Definition: EclGenericWriter.hpp:69
CollectDataOnIORankType collectOnIORank_
Definition: EclGenericWriter.hpp:158
const Schedule & schedule_
Definition: EclGenericWriter.hpp:161
SimulatorReport simulation_report_
Definition: EclGenericWriter.hpp:171
SimulatorReportSingle sub_step_report_
Definition: EclGenericWriter.hpp:170
void evalSummary(int reportStepNum, GetPropType< TypeTag, Properties::Scalar > curTime, const data::Wells &localWellData, const data::WellBlockAveragePressures &localWBPData, const data::GroupAndNetworkValues &localGroupAndNetworkData, const std::map< int, data::AquiferData > &localAquiferData, const std::map< std::pair< std::string, int >, double > &blockData, const std::map< std::string, double > &miscSummaryData, const std::map< std::string, std::vector< double > > ®ionData, const Inplace &inplace, const Inplace *initialInPlace, const InterRegFlowMap &interRegFlows, SummaryState &summaryState, UDQState &udqState, const data::ReservoirCouplingGroupRates *rcGroupRates=nullptr)
Definition: EclGenericWriter_impl.hpp:1021
const Dune::CartesianIndexMapper< GetPropType< TypeTag, Properties::Grid > > & cartMapper_
Definition: EclGenericWriter.hpp:167
std::unique_ptr< EclipseIO > eclIO_
Definition: EclGenericWriter.hpp:163
void doWriteOutput(const int reportStepNum, const std::optional< int > timeStepNum, const bool isSubStep, const bool forcedSimulationFinished, data::Solution &&localCellData, data::Wells &&localWellData, data::GroupAndNetworkValues &&localGroupAndNetworkData, data::Aquifers &&localAquiferData, WellTestState &&localWTestState, const Action::State &actionState, const UDQState &udqState, const SummaryState &summaryState, const std::vector< GetPropType< TypeTag, Properties::Scalar > > &thresholdPressure, GetPropType< TypeTag, Properties::Scalar > curTime, GetPropType< TypeTag, Properties::Scalar > nextStepSize, bool doublePrecision, bool isFlowsn, std::array< FlowsData< double >, 3 > &&flowsn, bool isFloresn, std::array< FlowsData< double >, 3 > &&floresn)
Definition: EclGenericWriter_impl.hpp:911
Collects necessary output values and pass it to opm-common's ECL output.
Definition: EclWriter.hpp:120
OutputModule & mutableOutputModule() const
Definition: EclWriter.hpp:733
const OutputModule & outputModule() const
Definition: EclWriter.hpp:730
void writeOutput(data::Solution &&localCellData, const bool isSubStep, const bool isForcedFinalOutput)
Definition: EclWriter.hpp:453
void evalSummaryState(bool isSubStep)
collect and pass data and pass it to eclIO writer
Definition: EclWriter.hpp:210
static void registerParameters()
Definition: EclWriter.hpp:145
void serializeOp(Serializer &serializer)
Definition: EclWriter.hpp:740
void writeInitialFIPReport()
Writes the initial FIP report as configured in RPTSOL.
Definition: EclWriter.hpp:363
void beginRestart()
Definition: EclWriter.hpp:538
EclWriter(Simulator &simulator)
Definition: EclWriter.hpp:159
void writeReports(const SimulatorTimer &timer)
Definition: EclWriter.hpp:408
void endRestart()
Definition: EclWriter.hpp:716
Scalar restartTimeStepSize() const
Definition: EclWriter.hpp:736
~EclWriter()
Definition: EclWriter.hpp:199
const EquilGrid & globalGrid() const
Definition: EclWriter.hpp:202
virtual int reportStepNum() const
Current report step number. This might differ from currentStepNum in case of sub stepping.
Definition: SimulatorTimerInterface.hpp:109
Definition: SimulatorTimer.hpp:39
virtual boost::posix_time::ptime currentDateTime() const
Return the current time as a posix time object.
double simulationTimeElapsed() const override
Defines the common properties required by the porous medium multi-phase models.
Definition: ActionHandler.hpp:34
Definition: blackoilnewtonmethodparams.hpp:31
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition: parametersystem.hpp:187
std::size_t countLocalInteriorCellsGridView(const GridView &gridView)
Get the number of local interior cells in a grid view.
Definition: countGlobalCells.hpp:45
Definition: blackoilbioeffectsmodules.hh:45
data::Solution loadParallelRestartSolution(const EclipseIO *eclIO, const std::vector< RestartKey > &solutionKeys, Parallel::Communication comm, const int step)
void eclBroadcast(Parallel::Communication, T &)
RestartValue loadParallelRestart(const EclipseIO *eclIO, Action::State &actionState, SummaryState &summaryState, const std::vector< RestartKey > &solutionKeys, const std::vector< RestartKey > &extraKeys, Parallel::Communication comm)
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:233
Definition: EclWriter.hpp:78
static constexpr bool value
Definition: EclWriter.hpp:78
Definition: EclWriter.hpp:75
static constexpr bool value
Definition: EclWriter.hpp:75
Definition: EclWriter.hpp:85
static constexpr bool value
Definition: EclWriter.hpp:85
Definition: EclWriter.hpp:82
static constexpr bool value
Definition: EclWriter.hpp:82
SimulatorReportSingle success
Definition: SimulatorReport.hpp:123
unsigned int min_linear_iterations
Definition: SimulatorReport.hpp:52
unsigned int total_newton_iterations
Definition: SimulatorReport.hpp:50
unsigned int max_linear_iterations
Definition: SimulatorReport.hpp:53
unsigned int total_linear_iterations
Definition: SimulatorReport.hpp:51