2012-03-29 06:05:59 -05:00
|
|
|
/*
|
|
|
|
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
2015-07-03 09:31:52 -05:00
|
|
|
Copyright 2015 IRIS AS
|
2012-03-29 06:05:59 -05:00
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-06-05 08:42:49 -05:00
|
|
|
#ifndef OPM_BLACKOILSTATE_HEADER_INCLUDED
|
|
|
|
#define OPM_BLACKOILSTATE_HEADER_INCLUDED
|
2012-03-29 06:05:59 -05:00
|
|
|
|
2016-02-25 14:47:47 -06:00
|
|
|
#include <opm/common/data/SimulationDataContainer.hpp>
|
|
|
|
|
2012-03-29 06:05:59 -05:00
|
|
|
#include <opm/core/grid.h>
|
2013-03-14 04:29:42 -05:00
|
|
|
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
2012-03-29 06:05:59 -05:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
2016-05-13 05:35:08 -05:00
|
|
|
enum HydroCarbonState {
|
|
|
|
GasOnly = 0,
|
|
|
|
GasAndOil = 1,
|
|
|
|
OilOnly = 2
|
|
|
|
};
|
2016-05-13 02:10:13 -05:00
|
|
|
|
2012-06-05 08:42:49 -05:00
|
|
|
/// Simulator state for a blackoil simulator.
|
2016-02-25 14:47:47 -06:00
|
|
|
class BlackoilState : public SimulationDataContainer
|
2012-03-29 06:05:59 -05:00
|
|
|
{
|
|
|
|
public:
|
2016-02-25 14:47:47 -06:00
|
|
|
static const std::string GASOILRATIO;
|
|
|
|
static const std::string RV;
|
|
|
|
static const std::string SURFACEVOL;
|
2012-03-29 06:05:59 -05:00
|
|
|
|
2016-03-29 03:33:37 -05:00
|
|
|
/// Main constructor setting the sizes for the contained data
|
|
|
|
/// types.
|
|
|
|
/// \param num_cells number of elements in cell data vectors
|
|
|
|
/// \param num_faces number of elements in face data vectors
|
|
|
|
/// \param num_phases number of phases, the number of components
|
|
|
|
/// in any data vector must equal 1 or this
|
|
|
|
/// number (this behaviour and argument is deprecated).
|
|
|
|
BlackoilState(size_t num_cells, size_t num_faces, size_t num_phases);
|
|
|
|
|
|
|
|
/// Copy constructor.
|
|
|
|
/// Must be defined explicitly because class contains non-value objects
|
|
|
|
/// (the reference pointers rv_ref_ etc.) that should not simply
|
|
|
|
/// be copied.
|
|
|
|
BlackoilState(const BlackoilState& other);
|
|
|
|
|
|
|
|
/// Copy assignment operator.
|
|
|
|
/// Must be defined explicitly because class contains non-value objects
|
|
|
|
/// (the reference pointers rv_ref_ etc.) that should not simply
|
|
|
|
/// be copied.
|
|
|
|
BlackoilState& operator=(const BlackoilState& other);
|
|
|
|
|
|
|
|
std::vector<double>& surfacevol () { return *surfacevol_ref_; }
|
|
|
|
std::vector<double>& gasoilratio () { return *gasoilratio_ref_; }
|
|
|
|
std::vector<double>& rv () { return *rv_ref_; }
|
2016-05-13 05:35:08 -05:00
|
|
|
std::vector<HydroCarbonState>& hydroCarbonState() { return hydrocarbonstate_; }
|
2016-03-29 03:33:37 -05:00
|
|
|
|
|
|
|
const std::vector<double>& surfacevol () const { return *surfacevol_ref_; }
|
|
|
|
const std::vector<double>& gasoilratio () const { return *gasoilratio_ref_; }
|
|
|
|
const std::vector<double>& rv () const { return *rv_ref_; }
|
2016-05-13 05:35:08 -05:00
|
|
|
const std::vector<HydroCarbonState>& hydroCarbonState() const { return hydrocarbonstate_; }
|
2016-03-29 03:33:37 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setBlackoilStateReferencePointers();
|
|
|
|
std::vector<double>* surfacevol_ref_;
|
|
|
|
std::vector<double>* gasoilratio_ref_;
|
|
|
|
std::vector<double>* rv_ref_;
|
2013-10-29 08:20:36 -05:00
|
|
|
|
2016-05-12 03:32:39 -05:00
|
|
|
// A vector storing the hydro carbon state.
|
2016-05-13 05:35:08 -05:00
|
|
|
std::vector<HydroCarbonState> hydrocarbonstate_;
|
2016-05-12 03:32:39 -05:00
|
|
|
|
2012-03-29 06:05:59 -05:00
|
|
|
|
|
|
|
};
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
|
2012-06-05 08:42:49 -05:00
|
|
|
#endif // OPM_BLACKOILSTATE_HEADER_INCLUDED
|