Moved Watercut class to miscUtilities.hpp.

This commit is contained in:
Atgeirr Flø Rasmussen 2012-03-14 12:47:01 +01:00
parent 08e12d7be1
commit d98b83bd3d
2 changed files with 28 additions and 0 deletions

View File

@ -18,6 +18,7 @@
*/
#include <opm/core/utility/miscUtilities.hpp>
#include <opm/core/utility/Units.hpp>
#include <opm/core/grid.h>
#include <opm/core/newwells.h>
#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

View File

@ -21,6 +21,7 @@
#define OPM_MISCUTILITIES_HEADER_INCLUDED
#include <vector>
#include <iosfwd>
struct Wells;
struct UnstructuredGrid;
@ -157,6 +158,15 @@ namespace Opm
/// single-perforation.
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