2013-10-29 08:20:36 -05:00
|
|
|
#include "BlackoilState.hpp"
|
2016-02-05 11:29:04 -06:00
|
|
|
#include <opm/common/util/numeric/cmp.hpp>
|
2013-10-29 08:20:36 -05:00
|
|
|
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
|
|
|
|
2016-02-05 11:29:04 -06:00
|
|
|
|
2013-10-29 08:20:36 -05:00
|
|
|
using namespace Opm;
|
|
|
|
|
|
|
|
void
|
2015-07-03 09:26:59 -05:00
|
|
|
BlackoilState::init(int number_of_cells, int number_of_phases, int num_phases)
|
|
|
|
{
|
|
|
|
SimulatorState::init(number_of_cells, number_of_phases, num_phases);
|
|
|
|
|
|
|
|
// register cell data in base class
|
|
|
|
gorId_ = SimulatorState::registerCellData( "GASOILRATIO", 1 );
|
|
|
|
rvId_ = SimulatorState::registerCellData( "RV", 1 );
|
|
|
|
|
2015-07-03 09:31:52 -05:00
|
|
|
// surfvolumes intentionally empty, left to initBlackoilSurfvol
|
2015-07-03 09:26:59 -05:00
|
|
|
surfaceVolId_ = SimulatorState::registerCellData( "SURFACEVOL", 0 );
|
2013-10-29 08:20:36 -05:00
|
|
|
}
|
|
|
|
|
2014-02-17 06:23:01 -06:00
|
|
|
void
|
|
|
|
BlackoilState::init(const UnstructuredGrid& g, int num_phases)
|
|
|
|
{
|
|
|
|
init(g.number_of_cells, g.number_of_faces, num_phases);
|
|
|
|
}
|
2013-10-29 08:20:36 -05:00
|
|
|
|
|
|
|
bool
|
|
|
|
BlackoilState::equals(const SimulatorState& other,
|
|
|
|
double epsilon) const {
|
|
|
|
const BlackoilState* that = dynamic_cast <const BlackoilState*> (&other);
|
|
|
|
bool equal = that != 0;
|
|
|
|
equal = equal && SimulatorState::equals (other, epsilon);
|
2016-02-17 15:01:52 -06:00
|
|
|
equal = equal && cmp::vector_equal(this->surfacevol(),
|
|
|
|
that->surfacevol(),
|
|
|
|
cmp::default_abs_epsilon,
|
|
|
|
epsilon);
|
|
|
|
|
|
|
|
equal = equal && cmp::vector_equal(this->gasoilratio(),
|
|
|
|
that->gasoilratio(),
|
|
|
|
cmp::default_abs_epsilon,
|
|
|
|
epsilon);
|
|
|
|
|
|
|
|
equal = equal && cmp::vector_equal(this->rv(),
|
|
|
|
that->rv(),
|
|
|
|
cmp::default_abs_epsilon,
|
|
|
|
epsilon);
|
2013-10-29 08:20:36 -05:00
|
|
|
return equal;
|
|
|
|
}
|