Merge pull request #1169 from totto82/impl_polymer

Add polymer to blackoilstate
This commit is contained in:
Atgeirr Flø Rasmussen 2017-06-23 13:31:40 +02:00 committed by GitHub
commit 41234f1bee
5 changed files with 18 additions and 0 deletions

View File

@ -39,6 +39,7 @@ namespace Opm
int phase_used[MaxNumPhases];
int phase_pos[MaxNumPhases];
bool has_solvent;
bool has_polymer;
};
/// Check or assign presence of a formed, free phase. Limited to

View File

@ -72,6 +72,12 @@ namespace Opm
pu.has_solvent = true;
}
// Add polyme info
pu.has_polymer = false;
if (phase.active(Phase::POLYMER)) {
pu.has_polymer = true;
}
return pu;
}
@ -124,6 +130,12 @@ namespace Opm
pu.has_solvent = true;
}
// Add polyme info
pu.has_polymer = false;
if (phase.active(Phase::POLYMER)) {
pu.has_polymer = true;
}
return pu;
}

View File

@ -12,6 +12,7 @@ const std::string BlackoilState::GASOILRATIO = "GASOILRATIO";
const std::string BlackoilState::RV = "RV";
const std::string BlackoilState::SURFACEVOL = "SURFACEVOL";
const std::string BlackoilState::SSOL = "SSOL";
const std::string BlackoilState::POLYMER = "POLYMER";
BlackoilState::BlackoilState( size_t num_cells , size_t num_faces , size_t num_phases)
@ -21,6 +22,7 @@ BlackoilState::BlackoilState( size_t num_cells , size_t num_faces , size_t num_p
registerCellData( RV, 1 );
registerCellData( SURFACEVOL, num_phases );
registerCellData( SSOL , 1 );
registerCellData( POLYMER , 1 );
setBlackoilStateReferencePointers();
}

View File

@ -44,6 +44,7 @@ namespace Opm
static const std::string RV;
static const std::string SURFACEVOL;
static const std::string SSOL;
static const std::string POLYMER;
/// Main constructor setting the sizes for the contained data
/// types.

View File

@ -1481,6 +1481,8 @@ namespace Opm
case Phase::WATER: return InjectionSpecification::WATER;
case Phase::GAS: return InjectionSpecification::GAS;
case Phase::SOLVENT: OPM_THROW(std::invalid_argument, "Solvent injector is not supported.");
case Phase::POLYMER: OPM_THROW(std::invalid_argument, "Polymer injector is not supported.");
}
OPM_THROW(std::logic_error, "Invalid state." );
}