Skip to content
Snippets Groups Projects
Commit d3d00555 authored by Thomas Fetzer's avatar Thomas Fetzer
Browse files

[freeflow][komega] Add dissipation limiter

parent 80bfcd7f
No related branches found
No related tags found
1 merge request!1027Freeflow/komega
...@@ -104,9 +104,6 @@ struct KOmegaModelTraits : RANSModelTraits<dimension> ...@@ -104,9 +104,6 @@ struct KOmegaModelTraits : RANSModelTraits<dimension>
//! The indices //! The indices
using Indices = KOmegaIndices<dim(), numComponents()>; using Indices = KOmegaIndices<dim(), numComponents()>;
//! The model includes a limiter to the production term
static constexpr bool enableKOmegaProductionLimiter() { return true; }
}; };
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
// NOTE: then update the volVars // NOTE: then update the volVars
VolumeVariables volVars; VolumeVariables volVars;
volVars.update(elemSol, asImp_(), element, scv); volVars.update(elemSol, asImp_(), element, scv);
storedDynamicEddyViscosity_[elementID] = volVars.calculateEddyViscosity(); storedDynamicEddyViscosity_[elementID] = volVars.calculateEddyViscosity(*this);
} }
} }
} }
......
...@@ -103,11 +103,13 @@ public: ...@@ -103,11 +103,13 @@ public:
const auto& volVars = elemVolVars[scv]; const auto& volVars = elemVolVars[scv];
// production // production
static const auto enableKOmegaProductionLimiter
= getParamFromGroup<bool>(problem.paramGroup(), "KOmega.EnableProductionLimiter", false);
Scalar productionTerm = 2.0 * volVars.kinematicEddyViscosity() * volVars.stressTensorScalarProduct(); Scalar productionTerm = 2.0 * volVars.kinematicEddyViscosity() * volVars.stressTensorScalarProduct();
if (ModelTraits::enableKOmegaProductionLimiter()) if (enableKOmegaProductionLimiter)
{ {
Scalar productionAlternative = 20.0 * volVars.betaK() * volVars.turbulentKineticEnergy() * volVars.dissipation(); Scalar productionAlternative = 20.0 * volVars.betaK() * volVars.turbulentKineticEnergy() * volVars.dissipation();
productionTerm = min(productionTerm, productionAlternative); productionTerm = min(productionTerm, productionAlternative);
} }
source[turbulentKineticEnergyEqIdx] += productionTerm; source[turbulentKineticEnergyEqIdx] += productionTerm;
source[dissipationEqIdx] += volVars.alpha() * volVars.dissipation() / volVars.turbulentKineticEnergy() * productionTerm; source[dissipationEqIdx] += volVars.alpha() * volVars.dissipation() / volVars.turbulentKineticEnergy() * productionTerm;
......
...@@ -47,6 +47,7 @@ class KOmegaVolumeVariables ...@@ -47,6 +47,7 @@ class KOmegaVolumeVariables
using NavierStokesParentType = NSVolumeVariables; using NavierStokesParentType = NSVolumeVariables;
using Scalar = typename Traits::PrimaryVariables::value_type; using Scalar = typename Traits::PrimaryVariables::value_type;
using ModelTraits = typename Traits::ModelTraits;
static constexpr bool enableEnergyBalance = Traits::ModelTraits::enableEnergyBalance(); static constexpr bool enableEnergyBalance = Traits::ModelTraits::enableEnergyBalance();
static constexpr int fluidSystemPhaseIdx = Traits::ModelTraits::Indices::fluidSystemPhaseIdx; static constexpr int fluidSystemPhaseIdx = Traits::ModelTraits::Indices::fluidSystemPhaseIdx;
...@@ -101,23 +102,29 @@ public: ...@@ -101,23 +102,29 @@ public:
if (problem.useStoredEddyViscosity_) if (problem.useStoredEddyViscosity_)
dynamicEddyViscosity_ = problem.storedDynamicEddyViscosity_[RANSParentType::elementID()]; dynamicEddyViscosity_ = problem.storedDynamicEddyViscosity_[RANSParentType::elementID()];
else else
dynamicEddyViscosity_ = calculateEddyViscosity(); dynamicEddyViscosity_ = calculateEddyViscosity(problem);
calculateEddyDiffusivity(problem); calculateEddyDiffusivity(problem);
} }
/*! /*!
* \brief Returns the dynamic eddy viscosity \f$\mathrm{[Pa s]}\f$. * \brief Returns the dynamic eddy viscosity \f$\mathrm{[Pa s]}\f$.
*/ */
Scalar calculateEddyViscosity() template<class Problem>
Scalar calculateEddyViscosity(const Problem& problem)
{ {
using std::sqrt; using std::sqrt;
using std::max; using std::max;
//! Use the Dissipation limiter proposed in wilcox08 // use the Dissipation limiter proposed in wilcox2008
Scalar limitiedDissipation = (7.0 / 8.0) * sqrt( 2.0 * stressTensorScalarProduct() Scalar limitiedDissipation = std::numeric_limits<Scalar>::min();
* stressTensorScalarProduct() / betaK() ); static const auto enableKOmegaDissipationLimiter
Scalar Wbar = max(dissipation(), limitiedDissipation); = getParamFromGroup<bool>(problem.paramGroup(), "KOmega.EnableDissipationLimiter", true);
return turbulentKineticEnergy() / Wbar * NavierStokesParentType::density(); if (enableKOmegaDissipationLimiter)
{
limitiedDissipation = (7.0 / 8.0) * sqrt(2.0 * stressTensorScalarProduct() / betaK());
}
return turbulentKineticEnergy() / max(dissipation(), limitiedDissipation)
* NavierStokesParentType::density();
} }
/*! /*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment