From 71f46afb6c2d7dfcd67f1bb6d0ee41d7bb91d62f Mon Sep 17 00:00:00 2001
From: Klaus Mosthaf <klmos@env.dtu.dk>
Date: Tue, 24 Jul 2012 15:34:44 +0000
Subject: [PATCH] Added eddyViscosity, eddyDiffusivity and eddyConductivity
 functions and adapted the evaluation of the respective fluxes in the local
 residua. The methods return 0 and have to be implemented, if required.

Reviewed by Christoph.


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@8723 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/freeflow/stokes/stokesfluxvariables.hh         |  6 ++++++
 dumux/freeflow/stokes/stokeslocalresidual.hh         |  7 +++----
 dumux/freeflow/stokes2c/stokes2cfluxvariables.hh     | 10 ++++++++--
 dumux/freeflow/stokes2c/stokes2clocalresidual.hh     |  2 +-
 dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh |  8 +++++++-
 dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh |  2 +-
 6 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/dumux/freeflow/stokes/stokesfluxvariables.hh b/dumux/freeflow/stokes/stokesfluxvariables.hh
index a072788125..56b4ee040a 100644
--- a/dumux/freeflow/stokes/stokesfluxvariables.hh
+++ b/dumux/freeflow/stokes/stokesfluxvariables.hh
@@ -297,6 +297,12 @@ public:
     const DimMatrix &velocityGradAtIP() const
     { return velocityGrad(); }
 
+    /*!
+     * \brief Return the eddy viscosity (if implemented).
+     */
+    const Scalar eddyViscosity() const
+    { return 0; }
+
 //    /*!
 //     * \brief Return the divergence of the normal velocity at the
 //     *        integration point.
diff --git a/dumux/freeflow/stokes/stokeslocalresidual.hh b/dumux/freeflow/stokes/stokeslocalresidual.hh
index d53d5c38f3..79929fa8e7 100644
--- a/dumux/freeflow/stokes/stokeslocalresidual.hh
+++ b/dumux/freeflow/stokes/stokeslocalresidual.hh
@@ -228,7 +228,7 @@ protected:
             // TODO: dilatation term has to be accounted for in outflow, coupling, neumann
             //            velGradComp[velIdx] += 2./3*fluxVars.velocityDiv;
 
-            velGradComp *= fluxVars.viscosity();
+            velGradComp *= fluxVars.viscosity() + fluxVars.eddyViscosity();
 
             flux[momentumXIdx + velIdx] -=
                 velGradComp*fluxVars.face().normal;
@@ -249,9 +249,8 @@ protected:
         if (calculateNavierStokes)
         {
             for (int dimIndex = 0; dimIndex < dim; ++dimIndex)
-            {
-                flux[momentumXIdx + dimIndex] += up.density() * up.velocity()[dimIndex] * fluxVars.normalVelocity();
-            }
+                flux[momentumXIdx + dimIndex] +=
+                        up.density() * up.velocity()[dimIndex] * fluxVars.normalVelocity();
         }
     }
 
diff --git a/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh b/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh
index f2b9565b9c..bd1ccef29f 100644
--- a/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh
+++ b/dumux/freeflow/stokes2c/stokes2cfluxvariables.hh
@@ -87,7 +87,7 @@ public:
     /*!
      * \brief Return the mass fraction of the transported component at the integration point.
      */
-    Scalar massFraction() const
+    const Scalar massFraction() const
     { return massFraction_; }
 
     /*!
@@ -100,9 +100,15 @@ public:
     /*!
      * \brief Return the molar diffusion coefficient at the integration point.
      */
-    Scalar diffusionCoeff() const
+    const Scalar diffusionCoeff() const
     { return diffusionCoeff_; }
 
+    /*!
+     * \brief Return the eddy diffusivity (if implemented).
+     */
+    const Scalar eddyDiffusivity() const
+    { return 0; }
+
     /*!
      * \brief Return the molar diffusion coefficient at the integration point.
      */
diff --git a/dumux/freeflow/stokes2c/stokes2clocalresidual.hh b/dumux/freeflow/stokes2c/stokes2clocalresidual.hh
index 98e6021c5b..3e934d660c 100644
--- a/dumux/freeflow/stokes2c/stokes2clocalresidual.hh
+++ b/dumux/freeflow/stokes2c/stokes2clocalresidual.hh
@@ -152,7 +152,7 @@ public:
             flux[transportEqIdx] -=
                 fluxVars.moleFractionGrad()[dimIdx] *
                 fluxVars.face().normal[dimIdx] *
-                fluxVars.diffusionCoeff() *
+                (fluxVars.diffusionCoeff() + fluxVars.eddyDiffusivity()) *
                 fluxVars.molarDensity() *
                 FluidSystem::molarMass(transportCompIdx);
 
diff --git a/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh b/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh
index 66c6a8ce4b..ba5c448bc2 100644
--- a/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh
+++ b/dumux/freeflow/stokes2cni/stokes2cnifluxvariables.hh
@@ -80,7 +80,7 @@ public:
     /*!
      * \brief Returns the heat conductivity at the integration point.
      */
-    Scalar heatConductivity() const
+    const Scalar heatConductivity() const
     { return heatConductivity_; }
     
     /*!
@@ -96,6 +96,12 @@ public:
     const DimVector &temperatureGrad() const
     { return temperatureGrad_; }
 
+    /*!
+     * \brief Return the eddy conductivity (if implemented).
+     */
+    const Scalar eddyConductivity() const
+    { return 0; }
+
     /*!
      * \brief Returns the temperature gradient at the integration point.
      */
diff --git a/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh b/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh
index e26c0da7cb..7b21e7a33b 100644
--- a/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh
+++ b/dumux/freeflow/stokes2cni/stokes2cnilocalresidual.hh
@@ -137,7 +137,7 @@ public:
             flux[energyEqIdx] -=
                 fluxVars.temperatureGrad()[dimIdx] *
                 fluxVars.face().normal[dimIdx] *
-                fluxVars.heatConductivity();
+                (fluxVars.heatConductivity() + fluxVars.eddyConductivity());
     }
 };
 
-- 
GitLab