mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Corrected typing pointed out by atgeirr in respose to pullrequest
This commit is contained in:
committed by
Bård Skaflestad
parent
423b5074b5
commit
5004f3c4b9
@@ -132,10 +132,11 @@ namespace Opm
|
|||||||
return pimpl_->run(timer, state, well_state);
|
return pimpl_->run(timer, state, well_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reportVolumes(std::ostream &os,double satvol[2],double tot_porevol_init,
|
static void reportVolumes(std::ostream &os,double satvol[2],double tot_porevol_init,
|
||||||
double tot_injected[2],double tot_produced[2],
|
double tot_injected[2], double tot_produced[2],
|
||||||
double injected[2], double produced[2],
|
double injected[2], double produced[2],
|
||||||
double init_satvol[2]){
|
double init_satvol[2])
|
||||||
|
{
|
||||||
std::cout.precision(5);
|
std::cout.precision(5);
|
||||||
const int width = 18;
|
const int width = 18;
|
||||||
os << "\nVolume balance report (all numbers relative to total pore volume).\n";
|
os << "\nVolume balance report (all numbers relative to total pore volume).\n";
|
||||||
@@ -163,7 +164,7 @@ namespace Opm
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
os.precision(8);
|
os.precision(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void outputStateVtk(const UnstructuredGrid& grid,
|
static void outputStateVtk(const UnstructuredGrid& grid,
|
||||||
const Opm::TwophaseState& state,
|
const Opm::TwophaseState& state,
|
||||||
const int step,
|
const int step,
|
||||||
@@ -174,10 +175,10 @@ namespace Opm
|
|||||||
vtkfilename << output_dir << "/vtk_files";
|
vtkfilename << output_dir << "/vtk_files";
|
||||||
boost::filesystem::path fpath(vtkfilename.str());
|
boost::filesystem::path fpath(vtkfilename.str());
|
||||||
try {
|
try {
|
||||||
create_directories(fpath);
|
create_directories(fpath);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
THROW("Creating directories failed: " << fpath);
|
THROW("Creating directories failed: " << fpath);
|
||||||
}
|
}
|
||||||
vtkfilename << "/" << std::setw(3) << std::setfill('0') << step << ".vtu";
|
vtkfilename << "/" << std::setw(3) << std::setfill('0') << step << ".vtu";
|
||||||
std::ofstream vtkfile(vtkfilename.str().c_str());
|
std::ofstream vtkfile(vtkfilename.str().c_str());
|
||||||
@@ -193,47 +194,47 @@ namespace Opm
|
|||||||
Opm::writeVtkData(grid, dm, vtkfile);
|
Opm::writeVtkData(grid, dm, vtkfile);
|
||||||
}
|
}
|
||||||
static void outputVectorMatlab(const std::string name,
|
static void outputVectorMatlab(const std::string name,
|
||||||
const std::vector<int> vec,
|
const std::vector<int>& vec,
|
||||||
const int step,
|
const int step,
|
||||||
const std::string& output_dir)
|
const std::string& output_dir)
|
||||||
{
|
{
|
||||||
std::ostringstream fname;
|
std::ostringstream fname;
|
||||||
fname << output_dir << "/" << name;
|
fname << output_dir << "/" << name;
|
||||||
boost::filesystem::path fpath = fname.str();
|
boost::filesystem::path fpath = fname.str();
|
||||||
try {
|
try {
|
||||||
create_directories(fpath);
|
create_directories(fpath);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
THROW("Creating directories failed: " << fpath);
|
THROW("Creating directories failed: " << fpath);
|
||||||
}
|
}
|
||||||
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
||||||
std::ofstream file(fname.str().c_str());
|
std::ofstream file(fname.str().c_str());
|
||||||
if (!file) {
|
if (!file) {
|
||||||
THROW("Failed to open " << fname.str());
|
THROW("Failed to open " << fname.str());
|
||||||
}
|
}
|
||||||
std::copy(vec.begin(), vec.end(), std::ostream_iterator<double>(file, "\n"));
|
std::copy(vec.begin(), vec.end(), std::ostream_iterator<double>(file, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void outputVectorMatlab(const std::string name,
|
static void outputVectorMatlab(const std::string name,
|
||||||
const std::vector<double> vec,
|
const std::vector<double> vec,
|
||||||
const int step,
|
const int step,
|
||||||
const std::string& output_dir)
|
const std::string& output_dir)
|
||||||
{
|
{
|
||||||
std::ostringstream fname;
|
std::ostringstream fname;
|
||||||
fname << output_dir << "/" << name;
|
fname << output_dir << "/" << name;
|
||||||
boost::filesystem::path fpath = fname.str();
|
boost::filesystem::path fpath = fname.str();
|
||||||
try {
|
try {
|
||||||
create_directories(fpath);
|
create_directories(fpath);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
THROW("Creating directories failed: " << fpath);
|
THROW("Creating directories failed: " << fpath);
|
||||||
}
|
}
|
||||||
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
||||||
std::ofstream file(fname.str().c_str());
|
std::ofstream file(fname.str().c_str());
|
||||||
if (!file) {
|
if (!file) {
|
||||||
THROW("Failed to open " << fname.str());
|
THROW("Failed to open " << fname.str());
|
||||||
}
|
}
|
||||||
std::copy(vec.begin(), vec.end(), std::ostream_iterator<double>(file, "\n"));
|
std::copy(vec.begin(), vec.end(), std::ostream_iterator<double>(file, "\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -255,10 +256,10 @@ namespace Opm
|
|||||||
fname << output_dir << "/" << it->first;
|
fname << output_dir << "/" << it->first;
|
||||||
boost::filesystem::path fpath = fname.str();
|
boost::filesystem::path fpath = fname.str();
|
||||||
try {
|
try {
|
||||||
create_directories(fpath);
|
create_directories(fpath);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
THROW("Creating directories failed: " << fpath);
|
THROW("Creating directories failed: " << fpath);
|
||||||
}
|
}
|
||||||
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
fname << "/" << std::setw(3) << std::setfill('0') << step << ".txt";
|
||||||
std::ofstream file(fname.str().c_str());
|
std::ofstream file(fname.str().c_str());
|
||||||
@@ -543,18 +544,18 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
|
for (int tr_substep = 0; tr_substep < num_transport_substeps_; ++tr_substep) {
|
||||||
tsolver_.solve(&state.faceflux()[0], &porevol[0], &transport_src[0],
|
tsolver_.solve(&state.faceflux()[0], &porevol[0], &transport_src[0],
|
||||||
stepsize, state.saturation());
|
stepsize, state.saturation());
|
||||||
Opm::computeInjectedProduced(props_, state.saturation(), transport_src, stepsize, injected, produced);
|
Opm::computeInjectedProduced(props_, state.saturation(), transport_src, stepsize, injected, produced);
|
||||||
if (use_segregation_split_) {
|
if (use_segregation_split_) {
|
||||||
tsolver_.solveGravity(columns_, &porevol[0], stepsize, state.saturation());
|
tsolver_.solveGravity(columns_, &porevol[0], stepsize, state.saturation());
|
||||||
}
|
}
|
||||||
watercut.push(timer.currentTime() + timer.currentStepLength(),
|
watercut.push(timer.currentTime() + timer.currentStepLength(),
|
||||||
produced[0]/(produced[0] + produced[1]),
|
produced[0]/(produced[0] + produced[1]),
|
||||||
tot_produced[0]/tot_porevol_init);
|
tot_produced[0]/tot_porevol_init);
|
||||||
if (wells_) {
|
if (wells_) {
|
||||||
wellreport.push(props_, *wells_, state.saturation(),
|
wellreport.push(props_, *wells_, state.saturation(),
|
||||||
timer.currentTime() + timer.currentStepLength(),
|
timer.currentTime() + timer.currentStepLength(),
|
||||||
well_state.bhp(), well_state.perfRates());
|
well_state.bhp(), well_state.perfRates());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transport_timer.stop();
|
transport_timer.stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user