From 9b6719c9ddaad8191ab86c34860aa418ff93d83b Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Thu, 5 Jul 2018 14:32:10 +0200
Subject: [PATCH] [rans] Fix maybe uninitialized warning

---
 dumux/freeflow/rans/oneeq/volumevariables.hh  | 16 +++++------
 .../rans/twoeq/kepsilon/volumevariables.hh    | 27 ++++++++++---------
 .../rans/twoeq/komega/volumevariables.hh      | 22 +++++++--------
 .../twoeq/lowrekepsilon/volumevariables.hh    | 14 +++++-----
 dumux/freeflow/rans/zeroeq/volumevariables.hh |  8 +++---
 5 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/dumux/freeflow/rans/oneeq/volumevariables.hh b/dumux/freeflow/rans/oneeq/volumevariables.hh
index f7d060cb6e..9f18c1f9ec 100644
--- a/dumux/freeflow/rans/oneeq/volumevariables.hh
+++ b/dumux/freeflow/rans/oneeq/volumevariables.hh
@@ -332,15 +332,15 @@ public:
     }
 
 protected:
-    Scalar dynamicEddyViscosity_;
-    Scalar eddyDiffusivity_;
-    Scalar viscosityTilde_;
-    Scalar storedViscosityTilde_;
-    DimVector storedViscosityTildeGradient_;
-    Scalar stressTensorScalarProduct_;
-    Scalar vorticityTensorScalarProduct_;
+    Scalar dynamicEddyViscosity_ = 0.0;
+    Scalar eddyDiffusivity_ = 0.0;
+    Scalar viscosityTilde_ = 0.0;
+    Scalar storedViscosityTilde_ = 0.0;
+    DimVector storedViscosityTildeGradient_ = 0.0;
+    Scalar stressTensorScalarProduct_ = 0.0;
+    Scalar vorticityTensorScalarProduct_ = 0.0;
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
index acbf39a8cf..b06269c068 100644
--- a/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
@@ -51,6 +51,7 @@ class KEpsilonVolumeVariables
     static constexpr int fluidSystemPhaseIdx = Traits::ModelTraits::Indices::fluidSystemPhaseIdx;
 
 public:
+
     //! export the underlying fluid system
     using FluidSystem = typename Traits::FluidSystem;
     //! export the indices type
@@ -265,20 +266,20 @@ public:
     }
 
 protected:
-    Scalar dynamicEddyViscosity_;
-    Scalar eddyDiffusivity_;
-    Scalar turbulentKineticEnergy_;
-    Scalar dissipation_;
-    Scalar storedTurbulentKineticEnergy_;
-    Scalar storedDissipation_;
-    Scalar stressTensorScalarProduct_;
-    Scalar yPlusNominal_;
-    Scalar uPlusNominal_;
-    Scalar cMu_;
-    bool inNearWallRegion_;
-    bool isMatchingPoint_;
+    Scalar dynamicEddyViscosity_ = 0.0;
+    Scalar eddyDiffusivity_ = 0.0;
+    Scalar turbulentKineticEnergy_ = 0.0;
+    Scalar dissipation_ = 0.0;
+    Scalar storedTurbulentKineticEnergy_ = 0.0;
+    Scalar storedDissipation_ = 0.0;
+    Scalar stressTensorScalarProduct_ = 0.0;
+    Scalar yPlusNominal_ = 0.0;
+    Scalar uPlusNominal_ = 0.0;
+    Scalar cMu_ = 0.0;
+    bool inNearWallRegion_ = false;
+    bool isMatchingPoint_ = false;
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
index 7220511bee..cdcc575664 100644
--- a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
@@ -259,18 +259,18 @@ public:
     }
 
 protected:
-    Scalar betaOmega_;
-    Scalar eddyDiffusivity_;
-    Scalar dynamicEddyViscosity_;
-    Scalar dissipation_;
-    Scalar turbulentKineticEnergy_;
-    Scalar storedDissipation_;
-    DimVector storedDissipationGradient_;
-    Scalar storedTurbulentKineticEnergy_;
-    DimVector storedTurbulentKineticEnergyGradient_;
-    Scalar stressTensorScalarProduct_;
+    Scalar betaOmega_ = 0.0;
+    Scalar eddyDiffusivity_ = 0.0;
+    Scalar dynamicEddyViscosity_ = 0.0;
+    Scalar dissipation_ = 0.0;
+    Scalar turbulentKineticEnergy_ = 0.0;
+    Scalar storedDissipation_ = 0.0;
+    DimVector storedDissipationGradient_ = 0.0;
+    Scalar storedTurbulentKineticEnergy_ = 0.0;
+    DimVector storedTurbulentKineticEnergyGradient_ = 0.0;
+    Scalar stressTensorScalarProduct_ = 0.0;
 };
 
-}
+} // end namespace Dumux
 
 #endif
diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
index 5521c6f5fd..f9ba874a21 100644
--- a/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
@@ -276,13 +276,13 @@ public:
     }
 
 protected:
-    Scalar dynamicEddyViscosity_;
-    Scalar eddyDiffusivity_;
-    Scalar turbulentKineticEnergy_;
-    Scalar dissipationTilde_;
-    Scalar storedTurbulentKineticEnergy_;
-    Scalar storedDissipationTilde_;
-    Scalar stressTensorScalarProduct_;
+    Scalar dynamicEddyViscosity_ = 0.0;
+    Scalar eddyDiffusivity_ = 0.0;
+    Scalar turbulentKineticEnergy_ = 0.0;
+    Scalar dissipationTilde_ = 0.0;
+    Scalar storedTurbulentKineticEnergy_ = 0.0;
+    Scalar storedDissipationTilde_ = 0.0;
+    Scalar stressTensorScalarProduct_ = 0.0;
 };
 
 }
diff --git a/dumux/freeflow/rans/zeroeq/volumevariables.hh b/dumux/freeflow/rans/zeroeq/volumevariables.hh
index efb256f856..2d6a5264db 100644
--- a/dumux/freeflow/rans/zeroeq/volumevariables.hh
+++ b/dumux/freeflow/rans/zeroeq/volumevariables.hh
@@ -223,10 +223,10 @@ public:
     { return NavierStokesParentType::fluidState_; }
 
 protected:
-    Scalar dynamicEddyViscosity_;
-    Scalar eddyDiffusivity_;
-    Scalar additionalRoughnessLength_;
-    Scalar yPlusRough_;
+    Scalar dynamicEddyViscosity_ = 0.0;
+    Scalar eddyDiffusivity_ = 0.0;
+    Scalar additionalRoughnessLength_ = 0.0;
+    Scalar yPlusRough_ = 0.0;
 };
 
 } // end namespace Dumux
-- 
GitLab