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/RegionVariableCollection.hpp>
42#include <opm/output/eclipse/RestartValue.hpp>
57#ifdef RESERVOIR_COUPLING_ENABLED
61#include <boost/date_time/posix_time/posix_time.hpp>
117template <
class TypeTag,
class OutputModule>
119 GetPropType<TypeTag, Properties::EquilGrid>,
120 GetPropType<TypeTag, Properties::GridView>,
121 GetPropType<TypeTag, Properties::ElementMapper>,
122 GetPropType<TypeTag, Properties::Scalar>>
132 using Element =
typename GridView::template Codim<0>::Entity;
134 using ElementIterator =
typename GridView::template Codim<0>::Iterator;
137 typedef Dune::MultipleCodimMultipleGeomTypeMapper< GridView > VertexMapper;
139 static constexpr bool enableEnergy =
140 getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::FullyImplicitThermal ||
141 getPropValue<TypeTag, Properties::EnergyModuleType>() == EnergyModules::SequentialImplicitThermal;
142 enum { enableMech = getPropValue<TypeTag, Properties::EnableMech>() };
143 static constexpr bool enableSolvent = getPropValue<TypeTag, Properties::EnableSolvent>();
144 enum { enableGeochemistry = getPropValue<TypeTag, Properties::EnableGeochemistry>() };
149 std::vector<std::pair<std::string, std::vector<std::size_t>>>;
153 OutputModule::registerParameters();
155 Parameters::Register<Parameters::EnableAsyncEclOutput>
156 (
"Write the ECL-formated results in a non-blocking way "
157 "(i.e., using a separate thread).");
158 Parameters::Register<Parameters::EnableEsmry>
159 (
"Write ESMRY file for fast loading of summary data.");
166 :
BaseType(simulator.vanguard().schedule(),
167 simulator.vanguard().eclState(),
168 simulator.vanguard().summaryConfig(),
169 simulator.vanguard().grid(),
170 ((simulator.vanguard().grid().comm().rank() == 0)
171 ? &simulator.vanguard().equilGrid()
173 simulator.vanguard().gridView(),
174 simulator.vanguard().cartesianIndexMapper(),
175 ((simulator.vanguard().grid().comm().rank() == 0)
176 ? &simulator.vanguard().equilCartesianIndexMapper()
178 Parameters::
Get<Parameters::EnableAsyncEclOutput>(),
179 Parameters::
Get<Parameters::EnableEsmry>())
180 , simulator_(simulator)
183 if (this->simulator_.vanguard().grid().comm().size() > 1) {
184 auto smryCfg = (this->simulator_.vanguard().grid().comm().rank() == 0)
185 ? this->
eclIO_->finalSummaryConfig()
188 eclBroadcast(this->simulator_.vanguard().grid().comm(), smryCfg);
190 this->outputModule_ = std::make_unique<OutputModule>
196 this->outputModule_ = std::make_unique<OutputModule>
197 (simulator, this->
eclIO_->finalSummaryConfig(), this->collectOnIORank_);
200 this->rank_ = this->simulator_.vanguard().grid().comm().rank();
202 this->simulator_.vanguard().eclState().computeFipRegionStatistics();
210 return simulator_.vanguard().equilGrid();
216 this->
eclIO_->recordNewDynamicWellConns(newConns);
226 const int reportStepNum = simulator_.episodeIndex() + 1;
246 if (reportStepNum == 0)
249 const Scalar curTime = simulator_.time() + simulator_.timeStepSize();
250 const Scalar totalCpuTime =
251 simulator_.executionTimer().realTimeElapsed() +
252 simulator_.setupTimer().realTimeElapsed() +
253 simulator_.vanguard().setupTime();
255 auto& regVars = this->outputModule_->regionVariables();
257 regVars.prepareValueAccumulation();
259 if (
const auto conn_opt_ix = regVars
260 .variableIndex(this->outputModule_->regVarMapping(),
"ConnOPT");
261 conn_opt_ix.has_value())
263 this->simulator_.problem()
264 .wellModel().reportIntervalConnectionOilProduction
265 (this->simulator_.timeStepSize(), *conn_opt_ix, regVars);
268 const auto localWellData = simulator_.problem().wellModel().wellData();
269 const auto localWBP = simulator_.problem().wellModel().wellBlockAveragePressures();
270 const auto localGroupAndNetworkData = simulator_.problem().wellModel()
271 .groupAndNetworkData(reportStepNum);
273 const auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
274 const auto localWellTestState = simulator_.problem().wellModel().wellTestState();
275 this->prepareLocalCellData(isSubStep, reportStepNum);
277 if (this->outputModule_->needInterfaceFluxes(isSubStep)) {
278 this->captureLocalFluxData();
284 std::map<std::pair<std::string,int>,
double> dummy;
286 outputModule_->getBlockData(),
290 localGroupAndNetworkData,
293 this->outputModule_->getInterRegFlows(),
296 this->outputModule_->getLgrBlockData());
301 if (! iregFlows.readIsConsistent()) {
302 throw std::runtime_error {
303 "Inconsistent inter-region flow "
304 "region set names in parallel"
312 this->simulator_.vanguard().grid().comm());
316 std::map<std::string, double> miscSummaryData;
317 std::map<std::string, std::vector<double>> regionData;
321 OPM_TIMEBLOCK(outputFipLogAndFipresvLog);
323 inplace = outputModule_->calc_inplace(miscSummaryData, regionData, simulator_.gridView().comm());
331 if (totalCpuTime != 0.0) {
332 miscSummaryData[
"TCPU"] = totalCpuTime;
358 const auto rcGroupRates = this->collectReservoirCouplingGroupRates_();
366 regVars.commitValues();
370 : this->outputModule_->getBlockData();
374 : this->outputModule_->getLgrBlockData();
378 : this->outputModule_->getInterRegFlows();
384 localGroupAndNetworkData,
390 this->outputModule_->regVarMapping(),
393 this->outputModule_->initialInplace(),
395 this->summaryState(),
397 rcGroupRates ? &(*rcGroupRates) :
nullptr);
404 const auto& gridView = simulator_.vanguard().gridView();
408 this->outputModule_->
409 allocBuffers(num_interior, 0,
false,
false,
413#pragma omp parallel for
415 for (
int dofIdx = 0; dofIdx < num_interior; ++dofIdx) {
416 const auto& intQuants = *simulator_.model().cachedIntensiveQuantities(dofIdx, 0);
417 const auto totVolume = simulator_.model().dofTotalVolume(dofIdx);
419 this->outputModule_->updateFluidInPlace(dofIdx, intQuants, totVolume);
424 outputModule_->calc_initial_inplace(simulator_.gridView().comm());
427 const auto& fip = simulator_.vanguard().eclState().getEclipseConfig().fip();
428 if (fip.output(FIPConfig::OutputField::FIELD) ||
429 fip.output(FIPConfig::OutputField::RESV))
431 OPM_TIMEBLOCK(outputFipLogAndFipresvLog);
433 const auto start_time = boost::posix_time::
434 from_time_t(simulator_.vanguard().schedule().getStartTime());
437 this->inplace_ = *this->outputModule_->initialInplace();
439 this->outputModule_->
440 outputFipAndResvLog(this->inplace_, 0, 0.0, start_time,
441 false, simulator_.gridView().comm());
445 outputModule_->outputFipAndResvLogToCSV(0,
false, simulator_.gridView().comm());
462 const auto firstStep = this->initialStep();
466 const auto& rpt = this->
schedule_[simStep].rpt_config();
468 if (rpt.contains(
"WELSPECS") && (rpt.at(
"WELSPECS") > 0)) {
471 this->writeWellspecReport(timer);
479 if (rpt.contains(
"WELLS") && rpt.at(
"WELLS") > 0) {
480 this->writeWellflowReport(timer, simStep, rpt.at(
"WELLS"));
483 this->outputModule_->outputFipAndResvLog(this->inplace_,
488 simulator_.gridView().comm());
493 void writeOutput(data::Solution&& localCellData,
const bool isSubStep,
const bool isForcedFinalOutput)
497 const int reportStepNum = simulator_.episodeIndex() + 1;
498 this->prepareLocalCellData(isSubStep, reportStepNum);
499 this->outputModule_->outputErrorLog(simulator_.gridView().comm());
502 auto localWellData = simulator_.problem().wellModel().wellData();
503 auto localGroupAndNetworkData = simulator_.problem().wellModel()
504 .groupAndNetworkData(reportStepNum);
506 auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
507 auto localWellTestState = simulator_.problem().wellModel().wellTestState();
509 const bool isFlowsn = this->outputModule_->getFlows().hasFlowsn();
510 auto flowsn = this->outputModule_->getFlows().getFlowsn();
512 const bool isFloresn = this->outputModule_->getFlows().hasFloresn();
513 auto floresn = this->outputModule_->getFlows().getFloresn();
515 if (! isSubStep || Parameters::Get<Parameters::EnableWriteAllSolutions>()) {
517 if (localCellData.empty()) {
518 this->outputModule_->assignToSolution(localCellData);
522 this->outputModule_->addRftDataToWells(localWellData,
524 simulator_.gridView().comm());
528 this->collectOnIORank_.doesNeedReordering())
536 this->outputModule_->getBlockData(),
537 this->outputModule_->getExtraBlockData(),
540 localGroupAndNetworkData,
551 this->outputModule_->assignGlobalFieldsToSolution(localCellData);
555 const Scalar curTime = simulator_.time() + simulator_.timeStepSize();
556 const Scalar nextStepSize = simulator_.problem().nextTimeStepSize();
557 std::optional<int> timeStepIdx;
558 if (Parameters::Get<Parameters::EnableWriteAllSolutions>()) {
559 timeStepIdx = simulator_.timeStepIndex();
563 std::move(localCellData),
564 std::move(localWellData),
565 std::move(localGroupAndNetworkData),
566 std::move(localAquiferData),
567 std::move(localWellTestState),
570 this->summaryState(),
571 this->simulator_.problem().thresholdPressure().getRestartVector(),
572 curTime, nextStepSize,
573 Parameters::Get<Parameters::EclOutputDoublePrecision>(),
574 isFlowsn, std::move(flowsn),
575 isFloresn, std::move(floresn));
581 const auto enablePCHysteresis = simulator_.problem().materialLawManager()->enablePCHysteresis();
582 const auto enableNonWettingHysteresis = simulator_.problem().materialLawManager()->enableNonWettingHysteresis();
583 const auto enableWettingHysteresis = simulator_.problem().materialLawManager()->enableWettingHysteresis();
584 const auto oilActive = FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx);
585 const auto gasActive = FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx);
586 const auto waterActive = FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx);
587 const auto enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double(
"SWATINIT");
589 std::vector<RestartKey> solutionKeys {
590 {
"PRESSURE", UnitSystem::measure::pressure},
591 {
"SWAT", UnitSystem::measure::identity, waterActive},
592 {
"SGAS", UnitSystem::measure::identity, gasActive},
593 {
"TEMP", UnitSystem::measure::temperature, enableEnergy},
594 {
"SSOLVENT", UnitSystem::measure::identity, enableSolvent},
596 {
"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
597 {
"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
598 {
"RVW", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedWater()},
599 {
"RSW", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGasInWater()},
601 {
"SGMAX", UnitSystem::measure::identity, enableNonWettingHysteresis && oilActive && gasActive},
602 {
"SHMAX", UnitSystem::measure::identity, enableWettingHysteresis && oilActive && gasActive},
604 {
"SOMAX", UnitSystem::measure::identity,
605 (enableNonWettingHysteresis && oilActive && waterActive)
606 || simulator_.problem().vapparsActive(simulator_.episodeIndex())},
608 {
"SOMIN", UnitSystem::measure::identity, enablePCHysteresis && oilActive && gasActive},
609 {
"SWHY1", UnitSystem::measure::identity, enablePCHysteresis && oilActive && waterActive},
610 {
"SWMAX", UnitSystem::measure::identity, enableWettingHysteresis && oilActive && waterActive},
612 {
"PPCW", UnitSystem::measure::pressure, enableSwatinit},
616 const auto& tracers = simulator_.vanguard().eclState().tracer();
618 for (
const auto& tracer : tracers) {
619 const auto enableSolTracer =
620 ((tracer.phase == Phase::GAS) && FluidSystem::enableDissolvedGas()) ||
621 ((tracer.phase == Phase::OIL) && FluidSystem::enableVaporizedOil());
623 solutionKeys.emplace_back(tracer.fname(), UnitSystem::measure::identity,
true);
624 solutionKeys.emplace_back(tracer.sname(), UnitSystem::measure::identity, enableSolTracer);
628 const auto& inputThpres = eclState().getSimulationConfig().getThresholdPressure();
629 const std::vector<RestartKey> extraKeys {
630 {
"OPMEXTRA", UnitSystem::measure::identity,
false},
631 {
"THRESHPR", UnitSystem::measure::pressure, inputThpres.active()},
634 const auto& gridView = this->simulator_.vanguard().gridView();
635 const auto numElements = gridView.size(0);
639 this->outputModule_->allocBuffers(numElements,
645 const auto restartSolution =
647 solutionKeys, gridView.comm(), 0);
649 if (!restartSolution.empty()) {
650 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
652 this->outputModule_->setRestart(restartSolution, elemIdx, globalIdx);
655 this->simulator_.problem().readSolutionFromOutputModule(0,
true);
656 this->simulator_.problem().temperatureModel().init();
657 ElementContext elemCtx(this->simulator_);
658 for (
const auto& elem : elements(gridView, Dune::Partitions::interior)) {
659 elemCtx.updatePrimaryStencil(elem);
660 elemCtx.updatePrimaryIntensiveQuantities(0);
662 this->outputModule_->updateFluidInPlace(elemCtx);
665 this->outputModule_->calc_initial_inplace(this->simulator_.gridView().comm());
673 const auto restartStepIdx = this->simulator_.vanguard()
674 .eclState().getInitConfig().getRestartStep();
676 this->outputModule_->allocBuffers(numElements,
684 const auto restartValues =
687 this->summaryState(),
688 solutionKeys, extraKeys, gridView.comm());
690 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
692 this->outputModule_->setRestart(restartValues.solution, elemIdx, globalIdx);
695 auto& tracer_model = simulator_.problem().tracerModel();
696 for (
int tracer_index = 0; tracer_index < tracer_model.numTracers(); ++tracer_index) {
699 const auto& free_tracer_name = tracer_model.fname(tracer_index);
700 const auto& free_tracer_solution = restartValues.solution
701 .template data<double>(free_tracer_name);
703 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
705 tracer_model.setFreeTracerConcentration
706 (tracer_index, elemIdx, free_tracer_solution[globalIdx]);
711 if ((tracer_model.phase(tracer_index) == Phase::GAS && FluidSystem::enableDissolvedGas()) ||
712 (tracer_model.phase(tracer_index) == Phase::OIL && FluidSystem::enableVaporizedOil()))
714 tracer_model.setEnableSolTracers(tracer_index,
true);
716 const auto& sol_tracer_name = tracer_model.sname(tracer_index);
717 const auto& sol_tracer_solution = restartValues.solution
718 .template data<double>(sol_tracer_name);
720 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
722 tracer_model.setSolTracerConcentration
723 (tracer_index, elemIdx, sol_tracer_solution[globalIdx]);
727 tracer_model.setEnableSolTracers(tracer_index,
false);
729 for (
auto elemIdx = 0*numElements; elemIdx < numElements; ++elemIdx) {
730 tracer_model.setSolTracerConcentration(tracer_index, elemIdx, 0.0);
735 if (inputThpres.active()) {
736 const_cast<Simulator&
>(this->simulator_)
737 .problem().thresholdPressure()
738 .setFromRestart(restartValues.getExtra(
"THRESHPR"));
741 restartTimeStepSize_ = restartValues.getExtra(
"OPMEXTRA")[0];
742 if (restartTimeStepSize_ <= 0) {
743 restartTimeStepSize_ = std::numeric_limits<double>::max();
747 this->simulator_.problem().wellModel()
748 .initFromRestartFile(restartValues);
750 if (!restartValues.aquifer.empty()) {
751 this->simulator_.problem().mutableAquiferModel()
752 .initFromRestart(restartValues.aquifer);
762 this->outputModule_->calc_initial_inplace(this->simulator_.gridView().comm());
765 if (
const auto* iip = this->outputModule_->initialInplace(); iip !=
nullptr) {
766 this->inplace_ = *iip;
772 {
return *outputModule_; }
775 {
return *outputModule_; }
778 {
return restartTimeStepSize_; }
780 template <
class Serializer>
783 serializer(*outputModule_);
787 static bool enableEclOutput_()
789 static bool enable = Parameters::Get<Parameters::EnableEclOutput>();
793 const EclipseState& eclState()
const
794 {
return simulator_.vanguard().eclState(); }
796 SummaryState& summaryState()
797 {
return simulator_.vanguard().summaryState(); }
799 Action::State& actionState()
800 {
return simulator_.vanguard().actionState(); }
803 {
return simulator_.vanguard().udqState(); }
805 const Schedule& schedule()
const
806 {
return simulator_.vanguard().schedule(); }
812 std::optional<data::ReservoirCouplingGroupRates> collectReservoirCouplingGroupRates_()
814#ifdef RESERVOIR_COUPLING_ENABLED
819 using WellModelType = std::remove_cvref_t<
820 decltype(simulator_.problem().wellModel())>;
821 if constexpr (
requires(WellModelType& wm) { wm.isReservoirCouplingMaster(); }) {
822 auto& wellModel = simulator_.problem().wellModel();
823 if (wellModel.isReservoirCouplingMaster()) {
824 return wellModel.reservoirCouplingMaster()
825 .collectGroupRatesForSummary();
827 if (wellModel.isReservoirCouplingSlave()) {
828 auto rates = data::ReservoirCouplingGroupRates{};
829 for (
const auto& [group, targets] :
830 wellModel.reservoirCouplingSlave().effectiveInjectionTargets())
832 for (
const auto& [phase, target] : targets) {
833 rates.injection_targets[group][phase] =
static_cast<double>(target);
836 for (
const auto& [group, limits] :
837 wellModel.reservoirCouplingSlave().effectiveProductionTargets())
839 for (
const auto& [cmode, limit] : limits) {
840 rates.production_targets[group][cmode] =
static_cast<double>(limit);
850 void prepareLocalCellData(
const bool isSubStep,
851 const int reportStepNum)
853 OPM_TIMEBLOCK(prepareLocalCellData);
855 if (this->outputModule_->localDataValid()) {
859 const auto& gridView = simulator_.vanguard().gridView();
864 const bool writeAllSolutions =
865 Parameters::Get<Parameters::EnableWriteAllSolutions>();
869 const bool forceRestartFieldAllocation =
870 writeAllSolutions && (simulator_.timeStepIndex() > 0);
871 this->outputModule_->
872 allocBuffers(num_interior, reportStepNum,
873 isSubStep && !writeAllSolutions,
874 log, forceRestartFieldAllocation);
876 ElementContext elemCtx(simulator_);
881 OPM_TIMEBLOCK(prepareCellBasedData);
883 this->outputModule_->prepareDensityAccumulation();
884 this->outputModule_->setupExtractors(isSubStep, reportStepNum);
885 for (
const auto& elem : elements(gridView, Dune::Partitions::interior)) {
886 elemCtx.updatePrimaryStencil(elem);
887 elemCtx.updatePrimaryIntensiveQuantities(0);
889 this->outputModule_->processElement(elemCtx);
890 this->outputModule_->processElementBlockData(elemCtx);
892 this->outputModule_->clearExtractors();
896 OPM_TIMEBLOCK(prepareFluidInPlace);
899#pragma omp parallel for
901 for (
int dofIdx = 0; dofIdx < num_interior; ++dofIdx) {
902 const auto& intQuants = *simulator_.model().cachedIntensiveQuantities(dofIdx, 0);
903 const auto totVolume = simulator_.model().dofTotalVolume(dofIdx);
905 this->outputModule_->updateFluidInPlace(dofIdx, intQuants, totVolume);
910 this->simulator_.vanguard().grid().comm());
913 this->outputModule_->accumulateDensityParallel();
914 this->outputModule_->validateLocalData();
917 void captureLocalFluxData()
919 OPM_TIMEBLOCK(captureLocalData);
921 const auto& gridView = this->simulator_.vanguard().gridView();
922 const auto timeIdx = 0u;
924 auto elemCtx = ElementContext { this->simulator_ };
926 const auto elemMapper = ElementMapper { gridView, Dune::mcmgElementLayout() };
927 const auto activeIndex = [&elemMapper](
const Element& e)
929 return elemMapper.index(e);
932 const auto cartesianIndex = [
this](
const int elemIndex)
934 return this->
cartMapper_.cartesianIndex(elemIndex);
937 this->outputModule_->initializeFluxData();
941 for (
const auto& elem : elements(gridView, Dune::Partitions::interiorBorder)) {
942 elemCtx.updateStencil(elem);
943 elemCtx.updateIntensiveQuantities(timeIdx);
944 elemCtx.updateExtensiveQuantities(timeIdx);
946 this->outputModule_->processFluxes(elemCtx, activeIndex, cartesianIndex);
950 this->simulator_.vanguard().grid().comm())
952 this->outputModule_->finalizeFluxData();
955 void writeWellspecReport(const SimulatorTimer& timer)
const
957 const auto changedWells = this->
schedule_
958 .changed_wells(timer.reportStepNum(), this->initialStep());
960 const auto changedWellLists = this->
schedule_
961 .changedWellLists(timer.reportStepNum(), this->initialStep());
963 if (changedWells.empty() && !changedWellLists) {
967 this->outputModule_->outputWellspecReport(changedWells,
969 timer.reportStepNum(),
970 timer.simulationTimeElapsed(),
971 timer.currentDateTime());
974 void writeWellflowReport(
const SimulatorTimer& timer,
976 const int wellsRequest)
const
978 this->outputModule_->outputTimeStamp(
"WELLS",
979 timer.simulationTimeElapsed(),
980 timer.reportStepNum(),
981 timer.currentDateTime());
983 const auto wantConnData = wellsRequest > 1;
985 this->outputModule_->outputProdLog(simStep, wantConnData);
986 this->outputModule_->outputInjLog(simStep, wantConnData);
987 this->outputModule_->outputCumLog(simStep, wantConnData);
988 this->outputModule_->outputMSWLog(simStep);
991 int initialStep()
const
993 const auto& initConfig = this->eclState().cfg().init();
995 return initConfig.restartRequested()
996 ? initConfig.getRestartStep()
1000 Simulator& simulator_;
1001 std::unique_ptr<OutputModule> outputModule_;
1002 Scalar restartTimeStepSize_;
#define OPM_END_PARALLEL_TRY_CATCH(prefix, comm)
Catch exception and throw in a parallel try-catch clause.
Definition: DeferredLoggingErrorHelpers.hpp:197
#define OPM_BEGIN_PARALLEL_TRY_CATCH()
Macro to setup the try of a parallel try-catch.
Definition: DeferredLoggingErrorHelpers.hpp:160
Declares the properties required by the black oil model.
const std::map< std::tuple< std::string, int, int >, double > & globalLgrBlockData() const
Definition: CollectDataOnIORank.hpp:95
int localIdxToGlobalIdx(unsigned localIdx) const
Definition: CollectDataOnIORank_impl.hpp:1197
InterRegFlowMap & globalInterRegFlows()
Definition: CollectDataOnIORank.hpp:119
bool isParallel() const
Definition: CollectDataOnIORank.hpp:134
bool isIORank() const
Definition: CollectDataOnIORank.hpp:131
const std::map< std::pair< std::string, int >, double > & globalBlockData() const
Definition: CollectDataOnIORank.hpp:92
const data::Solution & globalCellData() const
Definition: CollectDataOnIORank.hpp:98
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, const std::map< std::tuple< std::string, int, int >, double > &localLgrBlockData)
Definition: CollectDataOnIORank_impl.hpp:1055
Definition: EclGenericWriter.hpp:76
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::tuple< std::string, int, int >, double > &lgrBlockData, const std::map< std::string, double > &miscSummaryData, const std::map< std::string, std::vector< double > > ®ionData, const data::RegionVariableMapping ®VarMap, const RegionVariableCollection ®Vars, const Inplace &inplace, const Inplace *initialInPlace, const InterRegFlowMap &interRegFlows, SummaryState &summaryState, UDQState &udqState, const data::ReservoirCouplingGroupRates *rcGroupRates=nullptr)
Definition: EclGenericWriter_impl.hpp:1058
CollectDataOnIORankType collectOnIORank_
Definition: EclGenericWriter.hpp:192
const Schedule & schedule_
Definition: EclGenericWriter.hpp:195
SimulatorReport simulation_report_
Definition: EclGenericWriter.hpp:206
SimulatorReportSingle sub_step_report_
Definition: EclGenericWriter.hpp:205
const Dune::CartesianIndexMapper< GetPropType< TypeTag, Properties::Grid > > & cartMapper_
Definition: EclGenericWriter.hpp:202
std::unique_ptr< EclipseIO > eclIO_
Definition: EclGenericWriter.hpp:197
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:948
Collects necessary output values and pass it to opm-common's ECL output.
Definition: EclWriter.hpp:123
OutputModule & mutableOutputModule() const
Definition: EclWriter.hpp:774
const OutputModule & outputModule() const
Definition: EclWriter.hpp:771
void writeOutput(data::Solution &&localCellData, const bool isSubStep, const bool isForcedFinalOutput)
Definition: EclWriter.hpp:493
void evalSummaryState(bool isSubStep)
collect and pass data and pass it to eclIO writer
Definition: EclWriter.hpp:223
static void registerParameters()
Definition: EclWriter.hpp:151
void serializeOp(Serializer &serializer)
Definition: EclWriter.hpp:781
void writeInitialFIPReport()
Writes the initial FIP report as configured in RPTSOL.
Definition: EclWriter.hpp:402
std::vector< std::pair< std::string, std::vector< std::size_t > > > DynamicConns
Definition: EclWriter.hpp:149
void beginRestart()
Definition: EclWriter.hpp:579
EclWriter(Simulator &simulator)
Definition: EclWriter.hpp:165
void writeReports(const SimulatorTimer &timer)
Definition: EclWriter.hpp:448
void recordNewDynamicWellConns(const DynamicConns &newConns)
Definition: EclWriter.hpp:213
void endRestart()
Definition: EclWriter.hpp:757
Scalar restartTimeStepSize() const
Definition: EclWriter.hpp:777
~EclWriter()
Definition: EclWriter.hpp:205
const EquilGrid & globalGrid() const
Definition: EclWriter.hpp:208
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:38
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:192
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:81
static constexpr bool value
Definition: EclWriter.hpp:81
Definition: EclWriter.hpp:78
static constexpr bool value
Definition: EclWriter.hpp:78
Definition: EclWriter.hpp:88
static constexpr bool value
Definition: EclWriter.hpp:88
Definition: EclWriter.hpp:85
static constexpr bool value
Definition: EclWriter.hpp:85
SimulatorReportSingle success
Definition: SimulatorReport.hpp:203
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