added keyword for foam

This commit is contained in:
Franz G. Fuchs
2019-04-26 10:36:34 +02:00
committed by Atgeirr Flø Rasmussen
parent 763702fd0f
commit 2fbf3c4fc9
4 changed files with 11 additions and 4 deletions

View File

@@ -37,7 +37,8 @@ enum class Phase {
SOLVENT = 3,
POLYMER = 4,
ENERGY = 5,
POLYMW = 6
POLYMW = 6,
FOAM = 7
};
Phase get_phase( const std::string& );
@@ -47,7 +48,7 @@ class Phases {
public:
Phases() noexcept = default;
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
bool polymw = false ) noexcept;
bool polymw = false, bool foam = false ) noexcept;
bool active( Phase ) const noexcept;
size_t size() const noexcept;

View File

@@ -36,6 +36,7 @@ Phase get_phase( const std::string& str ) {
if( str == "POLYMER" ) return Phase::POLYMER;
if( str == "ENERGY" ) return Phase::ENERGY;
if( str == "POLYMW" ) return Phase::POLYMW;
if( str == "FOAM" ) return Phase::FOAM;
throw std::invalid_argument( "Unknown phase '" + str + "'" );
}
@@ -45,6 +46,7 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) {
case Phase::OIL: return stream << "OIL";
case Phase::GAS: return stream << "GAS";
case Phase::WATER: return stream << "WATER";
case Phase::FOAM: return stream << "FOAM";
case Phase::SOLVENT: return stream << "SOLVENT";
case Phase::POLYMER: return stream << "POLYMER";
case Phase::ENERGY: return stream << "ENERGY";
@@ -57,14 +59,15 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) {
using un = std::underlying_type< Phase >::type;
Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw ) noexcept :
Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw, bool foam ) noexcept :
bits( (oil ? (1 << static_cast< un >( Phase::OIL ) ) : 0) |
(gas ? (1 << static_cast< un >( Phase::GAS ) ) : 0) |
(wat ? (1 << static_cast< un >( Phase::WATER ) ) : 0) |
(sol ? (1 << static_cast< un >( Phase::SOLVENT ) ) : 0) |
(pol ? (1 << static_cast< un >( Phase::POLYMER ) ) : 0) |
(energy ? (1 << static_cast< un >( Phase::ENERGY ) ) : 0) |
(polymw ? (1 << static_cast< un >( Phase::POLYMW ) ) : 0) )
(polymw ? (1 << static_cast< un >( Phase::POLYMW ) ) : 0) |
(foam ? (1 << static_cast< un >( Phase::FOAM ) ) : 0) )
{}
@@ -196,6 +199,7 @@ Runspec::Runspec( const Deck& deck ) :
active_phases( Phases( deck.hasKeyword( "OIL" ),
deck.hasKeyword( "GAS" ),
deck.hasKeyword( "WATER" ),
deck.hasKeyword( "FOAM" ),
deck.hasKeyword( "SOLVENT" ),
deck.hasKeyword( "POLYMER" ),
deck.hasKeyword( "THERMAL" ),

View File

@@ -0,0 +1 @@
{"name" : "FOAM", "sections" : ["RUNSPEC"]}

View File

@@ -108,6 +108,7 @@ set( keywords
000_Eclipse100/F/FMTIN
000_Eclipse100/F/FMTOUT
000_Eclipse100/F/FMWSET
000_Eclipse100/F/FOAM
000_Eclipse100/F/FRICTION
000_Eclipse100/F/FULLIMP
000_Eclipse100/G/GAS