Moved Watercut class to miscUtilities.hpp.
This commit is contained in:
parent
86284d06c1
commit
06d72587cc
@ -224,30 +224,7 @@ static void outputState(const UnstructuredGrid& grid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Encapsulates the watercut curves.
|
static void outputWaterCut(const Opm::Watercut& watercut,
|
||||||
class Watercut
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void push(double time, double fraction, double produced)
|
|
||||||
{
|
|
||||||
data_.push_back(time);
|
|
||||||
data_.push_back(fraction);
|
|
||||||
data_.push_back(produced);
|
|
||||||
}
|
|
||||||
void write(std::ostream& os) const
|
|
||||||
{
|
|
||||||
int sz = data_.size()/3;
|
|
||||||
for (int i = 0; i < sz; ++i) {
|
|
||||||
os << data_[3*i]/Opm::unit::day << " "
|
|
||||||
<< data_[3*i+1] << " "
|
|
||||||
<< data_[3*i+2] << '\n';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
std::vector<double> data_;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void outputWaterCut(const Watercut& watercut,
|
|
||||||
const std::string& output_dir)
|
const std::string& output_dir)
|
||||||
{
|
{
|
||||||
// Write water cut curve.
|
// Write water cut curve.
|
||||||
@ -674,11 +651,11 @@ main(int argc, char** argv)
|
|||||||
double produced[2] = { 0.0 };
|
double produced[2] = { 0.0 };
|
||||||
double tot_injected[2] = { 0.0 };
|
double tot_injected[2] = { 0.0 };
|
||||||
double tot_produced[2] = { 0.0 };
|
double tot_produced[2] = { 0.0 };
|
||||||
Watercut watercut;
|
|
||||||
watercut.push(0.0, 0.0, 0.0);
|
|
||||||
Opm::computeSaturatedVol(porevol, state.saturation(), init_satvol);
|
Opm::computeSaturatedVol(porevol, state.saturation(), init_satvol);
|
||||||
std::cout << "\nInitial saturations are " << init_satvol[0]/tot_porevol
|
std::cout << "\nInitial saturations are " << init_satvol[0]/tot_porevol
|
||||||
<< " " << init_satvol[1]/tot_porevol << std::endl;
|
<< " " << init_satvol[1]/tot_porevol << std::endl;
|
||||||
|
Opm::Watercut watercut;
|
||||||
|
watercut.push(0.0, 0.0, 0.0);
|
||||||
for (; !simtimer.done(); ++simtimer) {
|
for (; !simtimer.done(); ++simtimer) {
|
||||||
// Report timestep and (optionally) write state to disk.
|
// Report timestep and (optionally) write state to disk.
|
||||||
simtimer.report(std::cout);
|
simtimer.report(std::cout);
|
||||||
@ -779,9 +756,9 @@ main(int argc, char** argv)
|
|||||||
total_timer.stop();
|
total_timer.stop();
|
||||||
|
|
||||||
std::cout << "\n\n================ End of simulation ===============\n"
|
std::cout << "\n\n================ End of simulation ===============\n"
|
||||||
<< "Total time taken: " << total_timer.secsSinceStart()
|
<< "Total time taken: " << total_timer.secsSinceStart()
|
||||||
<< "\n Pressure time: " << ptime
|
<< "\n Pressure time: " << ptime
|
||||||
<< "\n Transport time: " << ttime << std::endl;
|
<< "\n Transport time: " << ttime << std::endl;
|
||||||
|
|
||||||
if (output) {
|
if (output) {
|
||||||
outputState(*grid->c_grid(), state, simtimer.currentStepNum(), output_dir);
|
outputState(*grid->c_grid(), state, simtimer.currentStepNum(), output_dir);
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <opm/core/utility/miscUtilities.hpp>
|
#include <opm/core/utility/miscUtilities.hpp>
|
||||||
|
#include <opm/core/utility/Units.hpp>
|
||||||
#include <opm/core/grid.h>
|
#include <opm/core/grid.h>
|
||||||
#include <opm/core/newwells.h>
|
#include <opm/core/newwells.h>
|
||||||
#include <opm/core/fluid/IncompPropertiesInterface.hpp>
|
#include <opm/core/fluid/IncompPropertiesInterface.hpp>
|
||||||
@ -358,5 +359,22 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Watercut::push(double time, double fraction, double produced)
|
||||||
|
{
|
||||||
|
data_.push_back(time);
|
||||||
|
data_.push_back(fraction);
|
||||||
|
data_.push_back(produced);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Watercut::write(std::ostream& os) const
|
||||||
|
{
|
||||||
|
int sz = data_.size()/3;
|
||||||
|
for (int i = 0; i < sz; ++i) {
|
||||||
|
os << data_[3*i]/Opm::unit::day << " "
|
||||||
|
<< data_[3*i+1] << " "
|
||||||
|
<< data_[3*i+2] << '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#define OPM_MISCUTILITIES_HEADER_INCLUDED
|
#define OPM_MISCUTILITIES_HEADER_INCLUDED
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
struct Wells;
|
struct Wells;
|
||||||
struct UnstructuredGrid;
|
struct UnstructuredGrid;
|
||||||
@ -157,6 +158,15 @@ namespace Opm
|
|||||||
/// single-perforation.
|
/// single-perforation.
|
||||||
void wellsToSrc(const Wells& wells, const int num_cells, std::vector<double>& src);
|
void wellsToSrc(const Wells& wells, const int num_cells, std::vector<double>& src);
|
||||||
|
|
||||||
|
/// Encapsulates the watercut curves.
|
||||||
|
class Watercut
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void push(double time, double fraction, double produced);
|
||||||
|
void write(std::ostream& os) const;
|
||||||
|
private:
|
||||||
|
std::vector<double> data_;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user