Added parameter compute_tracer. Defaults to false.
Triggers tracer computation and output, in addition to time-of-flight.
This commit is contained in:
parent
564b13d0c1
commit
990a944711
@ -133,6 +133,10 @@ main(int argc, char** argv)
|
|||||||
} else {
|
} else {
|
||||||
use_multidim_upwind = param.getDefault("use_multidim_upwind", false);
|
use_multidim_upwind = param.getDefault("use_multidim_upwind", false);
|
||||||
}
|
}
|
||||||
|
bool compute_tracer = param.getDefault("compute_tracer", false);
|
||||||
|
if (use_dg && compute_tracer) {
|
||||||
|
THROW("DG for tracer not yet implemented.");
|
||||||
|
}
|
||||||
|
|
||||||
// Write parameters used for later reference.
|
// Write parameters used for later reference.
|
||||||
bool output = param.getDefault("output", true);
|
bool output = param.getDefault("output", true);
|
||||||
@ -158,12 +162,17 @@ main(int argc, char** argv)
|
|||||||
Opm::time::StopWatch transport_timer;
|
Opm::time::StopWatch transport_timer;
|
||||||
transport_timer.start();
|
transport_timer.start();
|
||||||
std::vector<double> tof;
|
std::vector<double> tof;
|
||||||
|
std::vector<double> tracer;
|
||||||
if (use_dg) {
|
if (use_dg) {
|
||||||
Opm::TransportModelTracerTofDiscGal tofsolver(grid, use_cvi, use_limiter);
|
Opm::TransportModelTracerTofDiscGal tofsolver(grid, use_cvi, use_limiter);
|
||||||
tofsolver.solveTof(&flux[0], &porevol[0], &src[0], dg_degree, tof);
|
tofsolver.solveTof(&flux[0], &porevol[0], &src[0], dg_degree, tof);
|
||||||
} else {
|
} else {
|
||||||
Opm::TransportModelTracerTof tofsolver(grid, use_multidim_upwind);
|
Opm::TransportModelTracerTof tofsolver(grid, use_multidim_upwind);
|
||||||
tofsolver.solveTof(&flux[0], &porevol[0], &src[0], tof);
|
if (compute_tracer) {
|
||||||
|
tofsolver.solveTofTracer(&flux[0], &porevol[0], &src[0], tof, tracer);
|
||||||
|
} else {
|
||||||
|
tofsolver.solveTof(&flux[0], &porevol[0], &src[0], tof);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
transport_timer.stop();
|
transport_timer.stop();
|
||||||
double tt = transport_timer.secsSinceStart();
|
double tt = transport_timer.secsSinceStart();
|
||||||
@ -175,5 +184,14 @@ main(int argc, char** argv)
|
|||||||
std::ofstream tof_stream(tof_filename.c_str());
|
std::ofstream tof_stream(tof_filename.c_str());
|
||||||
tof_stream.precision(16);
|
tof_stream.precision(16);
|
||||||
std::copy(tof.begin(), tof.end(), std::ostream_iterator<double>(tof_stream, "\n"));
|
std::copy(tof.begin(), tof.end(), std::ostream_iterator<double>(tof_stream, "\n"));
|
||||||
|
if (compute_tracer) {
|
||||||
|
std::string tracer_filename = output_dir + "/tracer.txt";
|
||||||
|
std::ofstream tracer_stream(tracer_filename.c_str());
|
||||||
|
tracer_stream.precision(16);
|
||||||
|
const int nt = tracer.size()/grid.number_of_cells;
|
||||||
|
for (int i = 0; i < nt*grid.number_of_cells; ++i) {
|
||||||
|
tracer_stream << tracer[i] << (((i + 1) % nt == 0) ? '\n' : ' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user