36#ifndef OPENRS_SIMULATORTESTER_HEADER
37#define OPENRS_SIMULATORTESTER_HEADER
41#include <dune/grid/io/file/vtk/vtkwriter.hh>
52 template <
class SimTraits>
63 std::vector<double> saturation_old(saturation);
68 if (this->
gravity_.two_norm() > 0.0) {
69 OPM_MESSAGE(
"Warning: Gravity not handled by flow solver.");
74 std::cout <<
"\n\n================ Simulation step number " << i
75 <<
" ===============" << std::endl;
85 this->injection_rates_);
91 "testsolution-" + boost::lexical_cast<std::string>(i));
93 writeField(saturation,
"saturation-" + boost::lexical_cast<std::string>(i));
96 int num_cells = saturation.size();
98 for (
int i = 0; i < num_cells; ++i) {
99 maxdiff = std::max(maxdiff, std::fabs(saturation[i] - saturation_old[i]));
101 std::cout <<
"Maximum saturation change: " << maxdiff << std::endl;
104 saturation_old = saturation;
Definition: SimulatorBase.hpp:81
Vector gravity_
Definition: SimulatorBase.hpp:128
double stepsize_
Definition: SimulatorBase.hpp:126
ResProp res_prop_
Definition: SimulatorBase.hpp:135
std::vector< double > injection_rates_psolver_
Definition: SimulatorBase.hpp:138
TransportSolver transport_solver_
Definition: SimulatorBase.hpp:140
int linsolver_verbosity_
Definition: SimulatorBase.hpp:130
FlowSolver flow_solver_
Definition: SimulatorBase.hpp:139
int linsolver_type_
Definition: SimulatorBase.hpp:131
GridInterface ginterf_
Definition: SimulatorBase.hpp:134
BCs bcond_
Definition: SimulatorBase.hpp:136
double residual_tolerance_
Definition: SimulatorBase.hpp:129
std::vector< double > init_saturation_
Definition: SimulatorBase.hpp:127
int simulation_steps_
Definition: SimulatorBase.hpp:125
Definition: SimulatorTester.hpp:54
void run()
Definition: SimulatorTester.hpp:59
SimulatorBase< SimTraits > Super
Definition: SimulatorTester.hpp:56
Definition: BlackoilFluid.hpp:32
void writeField(const std::vector< double > &field, const std::string &filename)
Definition: SimulatorUtilities.hpp:288
void writeVtkOutput(const GridInterface &ginterf, const ReservoirProperties &rp, const FlowSol &flowsol, const std::vector< double > &saturation, const std::string &filename)
Definition: SimulatorUtilities.hpp:234