Fix SOIL restart initialization

This commit is contained in:
Tor Harald Sandve 2017-01-05 10:02:50 +01:00
parent edf883e747
commit 5990201ee9

View File

@ -120,6 +120,7 @@ inline void solutionToSim( const data::Solution& sol,
SimulationDataContainer& state ) { SimulationDataContainer& state ) {
const auto stride = phases.num_phases; const auto stride = phases.num_phases;
if( sol.has( "SWAT" ) ) { if( sol.has( "SWAT" ) ) {
stripe( sol.data( "SWAT" ), stripe( sol.data( "SWAT" ),
stride, stride,
@ -134,6 +135,18 @@ inline void solutionToSim( const data::Solution& sol,
state.saturation() ); state.saturation() );
} }
for (size_t c = 0; c < state.numCells(); ++c) {
double& so = state.saturation()[phases.num_phases*c + phases.phase_pos[ BlackoilPhases::Liquid ]];
so = 1.0;
if (phases.phase_used[ BlackoilPhases::Aqua]) {
so -= state.saturation()[phases.num_phases*c + phases.phase_pos[ BlackoilPhases::Aqua ]];
}
if (phases.phase_used[ BlackoilPhases::Vapour]) {
so -= state.saturation()[phases.num_phases*c + phases.phase_pos[ BlackoilPhases::Vapour ]];
}
}
if( sol.has( "PRESSURE" ) ) { if( sol.has( "PRESSURE" ) ) {
state.pressure() = sol.data( "PRESSURE" ); state.pressure() = sol.data( "PRESSURE" );
} }