mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1097 from nairr/add_timestamp_fip_output
Add timestamp fip output
This commit is contained in:
commit
d4ce1eddc9
@ -32,7 +32,7 @@
|
|||||||
#include <opm/autodiff/StandardWellsDense.hpp>
|
#include <opm/autodiff/StandardWellsDense.hpp>
|
||||||
#include <opm/autodiff/RateConverter.hpp>
|
#include <opm/autodiff/RateConverter.hpp>
|
||||||
#include <opm/autodiff/SimFIBODetails.hpp>
|
#include <opm/autodiff/SimFIBODetails.hpp>
|
||||||
|
#include <opm/autodiff/moduleVersion.hpp>
|
||||||
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
|
#include <opm/simulators/timestepping/AdaptiveTimeStepping.hpp>
|
||||||
#include <opm/core/utility/initHydroCarbonState.hpp>
|
#include <opm/core/utility/initHydroCarbonState.hpp>
|
||||||
#include <opm/core/utility/StopWatch.hpp>
|
#include <opm/core/utility/StopWatch.hpp>
|
||||||
@ -324,16 +324,28 @@ public:
|
|||||||
// update timing.
|
// update timing.
|
||||||
report.solver_time += solver_timer.secsSinceStart();
|
report.solver_time += solver_timer.secsSinceStart();
|
||||||
|
|
||||||
|
if ( output_writer_.output() ) {
|
||||||
|
if ( output_writer_.isIORank() )
|
||||||
|
{
|
||||||
|
stepReport.reportParam(tstep_os);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Increment timer, remember well state.
|
||||||
|
++timer;
|
||||||
|
|
||||||
// Compute current fluid in place.
|
// Compute current fluid in place.
|
||||||
std::vector<std::vector<double>> currentFluidInPlace;
|
std::vector<std::vector<double>> currentFluidInPlace;
|
||||||
currentFluidInPlace = solver->computeFluidInPlace(fipnum);
|
currentFluidInPlace = solver->computeFluidInPlace(fipnum);
|
||||||
std::vector<double> currentFluidInPlaceTotals = FIPTotals(currentFluidInPlace, state);
|
std::vector<double> currentFluidInPlaceTotals = FIPTotals(currentFluidInPlace, state);
|
||||||
|
const std::string version = moduleVersionName();
|
||||||
|
|
||||||
FIPUnitConvert(eclState().getUnits(), currentFluidInPlace);
|
FIPUnitConvert(eclState().getUnits(), currentFluidInPlace);
|
||||||
FIPUnitConvert(eclState().getUnits(), currentFluidInPlaceTotals);
|
FIPUnitConvert(eclState().getUnits(), currentFluidInPlaceTotals);
|
||||||
|
|
||||||
if (terminal_output_ )
|
if (terminal_output_ )
|
||||||
{
|
{
|
||||||
|
outputTimestampFIP(timer, version);
|
||||||
outputFluidInPlace(originalFluidInPlaceTotals, currentFluidInPlaceTotals,eclState().getUnits(), 0);
|
outputFluidInPlace(originalFluidInPlaceTotals, currentFluidInPlaceTotals,eclState().getUnits(), 0);
|
||||||
for (size_t reg = 0; reg < originalFluidInPlace.size(); ++reg) {
|
for (size_t reg = 0; reg < originalFluidInPlace.size(); ++reg) {
|
||||||
outputFluidInPlace(originalFluidInPlace[reg], currentFluidInPlace[reg], eclState().getUnits(), reg+1);
|
outputFluidInPlace(originalFluidInPlace[reg], currentFluidInPlace[reg], eclState().getUnits(), reg+1);
|
||||||
@ -346,16 +358,6 @@ public:
|
|||||||
OpmLog::note(msg);
|
OpmLog::note(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( output_writer_.output() ) {
|
|
||||||
if ( output_writer_.isIORank() )
|
|
||||||
{
|
|
||||||
stepReport.reportParam(tstep_os);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Increment timer, remember well state.
|
|
||||||
++timer;
|
|
||||||
|
|
||||||
// write simulation state at the report stage
|
// write simulation state at the report stage
|
||||||
Dune::Timer perfTimer;
|
Dune::Timer perfTimer;
|
||||||
perfTimer.start();
|
perfTimer.start();
|
||||||
@ -690,6 +692,20 @@ protected:
|
|||||||
return totals;
|
return totals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void outputTimestampFIP(SimulatorTimer& timer, const std::string version)
|
||||||
|
{
|
||||||
|
std::ostringstream ss;
|
||||||
|
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d %b %Y");
|
||||||
|
ss.imbue(std::locale(std::locale::classic(), facet));
|
||||||
|
ss << "\n **************************************************************************\n"
|
||||||
|
<< " Balance at" << std::setw(10) << (double)unit::convert::to(timer.simulationTimeElapsed(), unit::day) << " Days"
|
||||||
|
<< " *" << std::setw(30) << eclState().getTitle() << " *\n"
|
||||||
|
<< " Report " << std::setw(4) << timer.reportStepNum() << " " << timer.currentDateTime()
|
||||||
|
<< " * Flow version " << std::setw(11) << version << " *\n"
|
||||||
|
<< " **************************************************************************\n";
|
||||||
|
OpmLog::note(ss.str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void outputFluidInPlace(const std::vector<double>& oip, const std::vector<double>& cip, const UnitSystem& units, const int reg)
|
void outputFluidInPlace(const std::vector<double>& oip, const std::vector<double>& cip, const UnitSystem& units, const int reg)
|
||||||
|
Loading…
Reference in New Issue
Block a user