From 89361792e24bb43f8e31db92f943f6baa15a299f Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Mon, 3 Aug 2015 15:16:15 +0200 Subject: [PATCH] InitStateEquil: fix valgrind complaint about uninitialized values it seems that it was pure luck that this worked so far! --- opm/core/simulator/initStateEquil_impl.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opm/core/simulator/initStateEquil_impl.hpp b/opm/core/simulator/initStateEquil_impl.hpp index 642fc5695..aa138126d 100644 --- a/opm/core/simulator/initStateEquil_impl.hpp +++ b/opm/core/simulator/initStateEquil_impl.hpp @@ -693,7 +693,9 @@ namespace Opm // Adjust oil pressure according to gas saturation and cap pressure double pc[BlackoilPhases::MaxNumPhases]; double sat[BlackoilPhases::MaxNumPhases]; + sat[waterpos] = sw; sat[gaspos] = sg; + sat[oilpos] = 1.0 - sat[waterpos] - sat[gaspos]; props.capPress(1, sat, &cell, pc, 0); phase_pressures[oilpos][local_index] = phase_pressures[gaspos][local_index] - pc[gaspos]; } @@ -704,6 +706,9 @@ namespace Opm double sat[BlackoilPhases::MaxNumPhases]; double threshold_sat = 1.0e-6; + sat[waterpos] = smax[waterpos]; + sat[gaspos] = smax[gaspos]; + sat[oilpos] = 1.0 - sat[waterpos] - sat[gaspos]; if (sw > smax[waterpos]-threshold_sat ) { sat[waterpos] = smax[waterpos]; props.capPress(1, sat, &cell, pc, 0);