Merge pull request #5841 from atgeirr/smaller-enums

Reduce size of enums to save 15 bytes per cell.
This commit is contained in:
Bård Skaflestad 2025-01-06 10:50:41 +01:00 committed by GitHub
commit 61ff8a85fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View File

@ -43,6 +43,8 @@
#include <opm/models/discretization/common/fvbaseprimaryvariables.hh>
#include <cstdint>
namespace Opm::Parameters {
template<class Scalar>
@ -122,33 +124,33 @@ class BlackOilPrimaryVariables : public FvBasePrimaryVariables<TypeTag>
static_assert(numComponents == 3, "The black-oil model assumes three components!");
public:
enum class WaterMeaning {
enum class WaterMeaning : std::uint8_t {
Sw, // water saturation
Rvw, // vaporized water
Rsw, // dissolved gas in water
Disabled, // The primary variable is not used
};
enum class PressureMeaning {
enum class PressureMeaning : std::uint8_t {
Po, // oil pressure
Pg, // gas pressure
Pw, // water pressure
};
enum class GasMeaning {
enum class GasMeaning : std::uint8_t {
Sg, // gas saturation
Rs, // dissolved gas in oil
Rv, // vapporized oil
Disabled, // The primary variable is not used
};
enum class BrineMeaning {
enum class BrineMeaning : std::uint8_t {
Cs, // salt concentration
Sp, // (precipitated) salt saturation
Disabled, // The primary variable is not used
};
enum class SolventMeaning {
enum class SolventMeaning : std::uint8_t {
Ss, // solvent saturation
Rsolw, // dissolved solvent in water
Disabled, // The primary variable is not used

View File

@ -26,6 +26,7 @@
#include <stdexcept>
#include <fmt/format.h>
#include <fmt/ranges.h>
namespace Opm {