Files
opm-common/opm/input/eclipse/EclipseState/SimulationConfig/RockConfig.hpp
Bård Skaflestad 5cdeb6137b Implement Proper Record Copying Behaviour for ROCK
This commit adds the expected behaviour for all-defaulted records in
ROCK, provided the all-defaulted records are not the first of the
keyword.  Similarly to, e.g. PVTW, all-defaulted records are treated as
copies of the immediately preceding record.

In other words, given

    ROCK
    -- REF. PRES   COMPRESSIBILITY
       280.000        5.6E-5 /
    /

the second record is supposed to be a copy of the first.
2023-04-26 14:29:28 +02:00

100 lines
2.4 KiB
C++

/*
Copyright 2020 Equinor ASA.
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/>.
*/
#ifndef OPM_ROCK_CONFIG_HPP
#define OPM_ROCK_CONFIG_HPP
#include <cstddef>
#include <string>
#include <vector>
namespace Opm {
class Deck;
class FieldPropsManager;
class RockConfig
{
public:
enum class Hysteresis
{
REVERS = 1,
IRREVERS = 2,
HYSTER = 3,
BOBERG = 4,
REVLIMIT = 5,
PALM_MAN = 6,
NONE = 7,
};
struct RockComp
{
double pref{};
double compressibility{};
RockComp() = default;
RockComp(double pref_arg, double comp_arg);
bool operator==(const RockComp& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(pref);
serializer(compressibility);
}
};
RockConfig();
RockConfig(const Deck& deck, const FieldPropsManager& fp);
static RockConfig serializationTestObject();
bool active() const;
const std::vector<RockConfig::RockComp>& comp() const;
const std::string& rocknum_property() const;
std::size_t num_rock_tables() const;
Hysteresis hysteresis_mode() const;
bool water_compaction() const;
bool operator==(const RockConfig& other) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_active);
serializer(m_comp);
serializer(num_property);
serializer(num_tables);
serializer(m_water_compaction);
serializer(hyst_mode);
}
private:
bool m_active = false;
std::vector<RockComp> m_comp;
std::string num_property;
std::size_t num_tables = 0;
bool m_water_compaction = false;
Hysteresis hyst_mode = Hysteresis::REVERS;
};
} //namespace Opm
#endif // OPM_ROCK_CONFIG_HPP