Fix to handle cases without DISGAS and VAPOIL

- adds boolean has_disgas and has_vapoil to initHydroCarbonState()
This commit is contained in:
Tor Harald Sandve
2016-06-06 15:43:35 +02:00
parent 42e5e41fa2
commit ae9a10942e

View File

@@ -6,7 +6,7 @@
namespace Opm namespace Opm
{ {
void initHydroCarbonState(BlackoilState& state, const PhaseUsage& pu, const int num_cells) { void initHydroCarbonState(BlackoilState& state, const PhaseUsage& pu, const int num_cells, const bool has_disgas, const bool has_vapoil) {
enum { Oil = BlackoilPhases::Liquid, Gas = BlackoilPhases::Vapour, Water = BlackoilPhases::Aqua }; enum { Oil = BlackoilPhases::Liquid, Gas = BlackoilPhases::Vapour, Water = BlackoilPhases::Aqua };
// hydrocarbonstate is only used when gas and oil is present // hydrocarbonstate is only used when gas and oil is present
assert(pu.phase_used[Oil]); assert(pu.phase_used[Oil]);
@@ -29,11 +29,11 @@ void initHydroCarbonState(BlackoilState& state, const PhaseUsage& pu, const int
continue; // cases (almost) filled with water is treated as GasAndOil case; continue; // cases (almost) filled with water is treated as GasAndOil case;
} }
} }
if ( saturation[c*np + pu.phase_pos[ Gas ]] == 0.0) { if ( saturation[c*np + pu.phase_pos[ Gas ]] == 0.0 && has_disgas) {
hydroCarbonState[c] = HydroCarbonState::OilOnly; hydroCarbonState[c] = HydroCarbonState::OilOnly;
continue; continue;
} }
if ( saturation[c*np + pu.phase_pos[ Oil ]] == 0.0) { if ( saturation[c*np + pu.phase_pos[ Oil ]] == 0.0 && has_vapoil) {
hydroCarbonState[c] = HydroCarbonState::GasOnly; hydroCarbonState[c] = HydroCarbonState::GasOnly;
} }
} }