diff --git a/opm/core/fluid/blackoil/SinglePvtLiveGas.cpp b/opm/core/fluid/blackoil/SinglePvtLiveGas.cpp index 97ec0273..048bc834 100644 --- a/opm/core/fluid/blackoil/SinglePvtLiveGas.cpp +++ b/opm/core/fluid/blackoil/SinglePvtLiveGas.cpp @@ -166,16 +166,16 @@ namespace Opm } void SinglePvtLiveGas::evalBDeriv(const double press, const double* surfvol, - double& B, double& dBdp) const + double& Bval, double& dBdpval) const { if (surfvol[phase_pos_[Vapour]] == 0.0) { // To handle no-gas case. - B = 1.0; - dBdp = 0.0; + Bval = 1.0; + dBdpval = 0.0; return; } - B = miscible_gas(press, surfvol, 1, false); - dBdp = miscible_gas(press, surfvol, 1, true); + Bval = miscible_gas(press, surfvol, 1, false); + dBdpval = miscible_gas(press, surfvol, 1, true); } double SinglePvtLiveGas::evalR(const double press, const double* surfvol) const @@ -197,12 +197,12 @@ namespace Opm } void SinglePvtLiveGas::evalRDeriv(const double press, const double* surfvol, - double& R, double& dRdp) const + double& Rval, double& dRdpval) const { if (surfvol[phase_pos_[Liquid]] == 0.0) { // To handle no-gas case. - R = 0.0; - dRdp = 0.0; + Rval = 0.0; + dRdpval = 0.0; return; } double satR = linearInterpolationExtrap(saturated_gas_table_[0], @@ -210,14 +210,14 @@ namespace Opm double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]]; if (satR < maxR ) { // Saturated case - R = satR; - dRdp = linearInterpolDerivative(saturated_gas_table_[0], + Rval = satR; + dRdpval = linearInterpolDerivative(saturated_gas_table_[0], saturated_gas_table_[3], press); } else { // Undersaturated case - R = maxR; - dRdp = 0.0; + Rval = maxR; + dRdpval = 0.0; } } @@ -227,12 +227,12 @@ namespace Opm const bool deriv) const { int section; - double R = linearInterpolationExtrap(saturated_gas_table_[0], - saturated_gas_table_[3], press, - section); + double Rval = linearInterpolationExtrap(saturated_gas_table_[0], + saturated_gas_table_[3], press, + section); double maxR = surfvol[phase_pos_[Liquid]]/surfvol[phase_pos_[Vapour]]; if (deriv) { - if (R < maxR ) { // Saturated case + if (Rval < maxR ) { // Saturated case return linearInterpolDerivative(saturated_gas_table_[0], saturated_gas_table_[item], press); @@ -258,7 +258,7 @@ namespace Opm return val; } } else { - if (R < maxR ) { // Saturated case + if (Rval < maxR ) { // Saturated case return linearInterpolationExtrap(saturated_gas_table_[0], saturated_gas_table_[item], press); diff --git a/opm/core/fluid/blackoil/SinglePvtLiveOil.cpp b/opm/core/fluid/blackoil/SinglePvtLiveOil.cpp index bc64da37..2d42997d 100644 --- a/opm/core/fluid/blackoil/SinglePvtLiveOil.cpp +++ b/opm/core/fluid/blackoil/SinglePvtLiveOil.cpp @@ -243,10 +243,10 @@ namespace Opm void SinglePvtLiveOil::evalBDeriv(const double press, const double* surfvol, - double& B, double& dBdp) const + double& Bval, double& dBdpval) const { - B = evalB(press, surfvol); - dBdp = -B*B*miscible_oil(press, surfvol, 1, true); + Bval = evalB(press, surfvol); + dBdpval = -Bval*Bval*miscible_oil(press, surfvol, 1, true); } double SinglePvtLiveOil::evalR(double press, const double* surfvol) const @@ -254,36 +254,36 @@ namespace Opm if (surfvol[phase_pos_[Vapour]] == 0.0) { return 0.0; } - double R = linearInterpolationExtrap(saturated_oil_table_[0], + double Rval = linearInterpolationExtrap(saturated_oil_table_[0], saturated_oil_table_[3], press); double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]]; - if (R < maxR ) { // Saturated case - return R; + if (Rval < maxR ) { // Saturated case + return Rval; } else { return maxR; // Undersaturated case } } void SinglePvtLiveOil::evalRDeriv(const double press, const double* surfvol, - double& R, double& dRdp) const + double& Rval, double& dRdpval) const { if (surfvol[phase_pos_[Vapour]] == 0.0) { - R = 0.0; - dRdp = 0.0; + Rval = 0.0; + dRdpval = 0.0; return; } - R = linearInterpolationExtrap(saturated_oil_table_[0], + Rval = linearInterpolationExtrap(saturated_oil_table_[0], saturated_oil_table_[3], press); double maxR = surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]]; - if (R < maxR ) { + if (Rval < maxR ) { // Saturated case - dRdp = linearInterpolDerivative(saturated_oil_table_[0], + dRdpval = linearInterpolDerivative(saturated_oil_table_[0], saturated_oil_table_[3], press); } else { // Undersaturated case - R = maxR; - dRdp = 0.0; + Rval = maxR; + dRdpval = 0.0; } } @@ -294,12 +294,12 @@ namespace Opm const bool deriv) const { int section; - double R = linearInterpolationExtrap(saturated_oil_table_[0], - saturated_oil_table_[3], - press, section); + double Rval = linearInterpolationExtrap(saturated_oil_table_[0], + saturated_oil_table_[3], + press, section); double maxR = (surfvol[phase_pos_[Liquid]] == 0.0) ? 0.0 : surfvol[phase_pos_[Vapour]]/surfvol[phase_pos_[Liquid]]; if (deriv) { - if (R < maxR ) { // Saturated case + if (Rval < maxR ) { // Saturated case return linearInterpolDerivative(saturated_oil_table_[0], saturated_oil_table_[item], press); @@ -321,7 +321,7 @@ namespace Opm return val; } } else { - if (R < maxR ) { // Saturated case + if (Rval < maxR ) { // Saturated case return linearInterpolationExtrap(saturated_oil_table_[0], saturated_oil_table_[item], press); diff --git a/opm/core/pressure/msmfem/coarse_conn.c b/opm/core/pressure/msmfem/coarse_conn.c index 4a9beb34..19533456 100644 --- a/opm/core/pressure/msmfem/coarse_conn.c +++ b/opm/core/pressure/msmfem/coarse_conn.c @@ -431,7 +431,7 @@ coarse_topology_build_final(int ncoarse_f, int nblk, int *subfacepos, int *subfaces) /* ---------------------------------------------------------------------- */ { - int coarse_f, b1, b2, n, subpos, subface_valid; + int coarse_f, b1, b2, n, subpos, subface_valid = 1; size_t i; struct hash_set *set; @@ -451,8 +451,6 @@ coarse_topology_build_final(int ncoarse_f, int nblk, coarse_f = 0; subpos = 0; - subface_valid = 1; - for (b1 = 0; (b1 < nblk) && subface_valid; b1++) { if (bns[b1] != NULL) { for (n = 0; n < bns[b1]->nneigh; n++) { diff --git a/opm/core/pressure/msmfem/coarse_sys.c b/opm/core/pressure/msmfem/coarse_sys.c index 781369b1..3cae75c3 100644 --- a/opm/core/pressure/msmfem/coarse_sys.c +++ b/opm/core/pressure/msmfem/coarse_sys.c @@ -718,7 +718,7 @@ blkdof_fill(struct coarse_topology *ct, struct coarse_sys *sys) /* ---------------------------------------------------------------------- */ { - int p, ret, dof; + int p, ret = 0, dof; size_t b, nb; nb = ct->nblocks; @@ -749,7 +749,6 @@ blkdof_fill(struct coarse_topology *ct, if (sys->blkdof == NULL) { free(sys->blkdof_pos); sys->blkdof_pos = NULL; - ret = 0; } else { sys->blkdof_pos[0] = 0; diff --git a/opm/core/pressure/msmfem/ifsh_ms.c b/opm/core/pressure/msmfem/ifsh_ms.c index bbd50b50..a2822ca0 100644 --- a/opm/core/pressure/msmfem/ifsh_ms.c +++ b/opm/core/pressure/msmfem/ifsh_ms.c @@ -296,7 +296,7 @@ ifsh_ms_impl_construct(struct UnstructuredGrid *G , LocalSolver linsolve) /* ---------------------------------------------------------------------- */ { - int max_nconn, nb, nconn_tot; + int max_nconn = -1, nb, nconn_tot; int expected_nconn, alloc_ok; struct ifsh_ms_impl *new; diff --git a/opm/core/pressure/tpfa/cfs_tpfa_residual.c b/opm/core/pressure/tpfa/cfs_tpfa_residual.c index dc68392f..0bc207dd 100644 --- a/opm/core/pressure/tpfa/cfs_tpfa_residual.c +++ b/opm/core/pressure/tpfa/cfs_tpfa_residual.c @@ -785,7 +785,7 @@ assemble_completion_to_well(int w, int c, int nc, int np, { int wdof; size_t jc, jw; - double res, w2c, w2w; + double res = 0.0, w2c = 0.0, w2w = 0.0; switch (W->ctrl->ctrl[w]) { case BHP : diff --git a/opm/core/utility/parameters/ParameterGroup.cpp b/opm/core/utility/parameters/ParameterGroup.cpp index 7b492f75..30e7b8e4 100644 --- a/opm/core/utility/parameters/ParameterGroup.cpp +++ b/opm/core/utility/parameters/ParameterGroup.cpp @@ -85,9 +85,9 @@ namespace Opm { return path_; } - ParameterGroup::ParameterGroup(const std::string& path, + ParameterGroup::ParameterGroup(const std::string& patharg, const ParameterGroup* parent) - : path_(path), parent_(parent), output_is_enabled_(true) + : path_(patharg), parent_(parent), output_is_enabled_(true) { } diff --git a/opm/core/utility/parameters/ParameterXML.cpp b/opm/core/utility/parameters/ParameterXML.cpp index 8d8d9c17..a894bb85 100644 --- a/opm/core/utility/parameters/ParameterXML.cpp +++ b/opm/core/utility/parameters/ParameterXML.cpp @@ -54,6 +54,8 @@ namespace Opm { namespace parameter { namespace tinyxml { + std::string getProperty(const std::string& property, + const TiXmlElement* node_ptr); void read_xml(ParameterGroup& pg, const std::string filename); void fill_tree(ParameterGroup& pg, const TiXmlNode* root, diff --git a/opm/core/utility/parameters/tinyxml/tinyxml.cpp b/opm/core/utility/parameters/tinyxml/tinyxml.cpp index 9c161dfc..e3dda1e2 100644 --- a/opm/core/utility/parameters/tinyxml/tinyxml.cpp +++ b/opm/core/utility/parameters/tinyxml/tinyxml.cpp @@ -667,7 +667,7 @@ int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const } -int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) const +int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* valuearg ) const { const TiXmlAttribute* node = attributeSet.Find( name ); if ( !node ) @@ -675,7 +675,7 @@ int TiXmlElement::QueryUnsignedAttribute( const char* name, unsigned* value ) co int ival = 0; int result = node->QueryIntValue( &ival ); - *value = (unsigned)ival; + *valuearg = (unsigned)ival; return result; }