Commit 2a96db92 authored by Ned Coltman's avatar Ned Coltman Committed by Kilian Weishaupt
Browse files

[rans][kepsilon] add density in all terms of the kepsilon model

parent 518ebf94
......@@ -325,7 +325,7 @@ public:
{
unsigned int elementIdx = asImp_().gridGeometry().elementMapper().index(element);
return FacePrimaryVariables(asImp_().tangentialMomentumWallFunction(elementIdx, elemFaceVars[scvf].velocitySelf())
* elemVolVars[scvf.insideScvIdx()].density());
* asImp_().storedDensity(elementIdx) );
}
//! \brief Returns the flux for non-isothermal and compositional RANS models
......
......@@ -97,11 +97,11 @@ public:
// calculate advective flux
auto upwindTermK = [](const auto& volVars)
{
return volVars.turbulentKineticEnergy();
return volVars.turbulentKineticEnergy() * volVars.density();
};
auto upwindTermEpsilon = [](const auto& volVars)
{
return volVars.dissipation();
return volVars.dissipation() * volVars.density();
};
flux[turbulentKineticEnergyEqIdx]
......@@ -116,19 +116,10 @@ public:
const auto& outsideVolVars = elemVolVars[scvf.outsideScvIdx()];
// effective diffusion coefficients
Scalar insideCoeff_k = insideVolVars.kinematicEddyViscosity() / insideVolVars.sigmaK();
Scalar outsideCoeff_k = outsideVolVars.kinematicEddyViscosity() / outsideVolVars.sigmaK();
Scalar insideCoeff_e = insideVolVars.kinematicEddyViscosity() / insideVolVars.sigmaEpsilon();
Scalar outsideCoeff_e = outsideVolVars.kinematicEddyViscosity() / outsideVolVars.sigmaEpsilon();
static const auto kEpsilonEnableKinematicViscosity_
= getParamFromGroup<bool>(problem.paramGroup(), "KEpsilon.EnableKinematicViscosity", true);
if (kEpsilonEnableKinematicViscosity_)
{
insideCoeff_k += insideVolVars.kinematicViscosity();
outsideCoeff_k += outsideVolVars.kinematicViscosity();
insideCoeff_e += insideVolVars.kinematicViscosity();
outsideCoeff_e += outsideVolVars.kinematicViscosity();
}
Scalar insideCoeff_k = (insideVolVars.dynamicEddyViscosity() / insideVolVars.sigmaK()) + insideVolVars.viscosity();
Scalar outsideCoeff_k = (outsideVolVars.dynamicEddyViscosity() / outsideVolVars.sigmaK()) + outsideVolVars.viscosity();
Scalar insideCoeff_e = (insideVolVars.dynamicEddyViscosity() / insideVolVars.sigmaEpsilon()) + insideVolVars.viscosity();
Scalar outsideCoeff_e = (outsideVolVars.dynamicEddyViscosity() / outsideVolVars.sigmaEpsilon()) + outsideVolVars.viscosity();
// scale by extrusion factor
insideCoeff_k *= insideVolVars.extrusionFactor();
......
......@@ -89,8 +89,8 @@ public:
{
CellCenterPrimaryVariables storage = ParentType::computeStorageForCellCenter(problem, scv, volVars);
storage[turbulentKineticEnergyEqIdx] = volVars.turbulentKineticEnergy();
storage[dissipationEqIdx] = volVars.dissipation();
storage[turbulentKineticEnergyEqIdx] = volVars.turbulentKineticEnergy() * volVars.density();
storage[dissipationEqIdx] = volVars.dissipation() * volVars.density();
return storage;
}
......@@ -113,23 +113,23 @@ public:
// turbulence production is equal to dissipation -> exclude both terms (according to local equilibrium hypothesis, see FLUENT)
if (!volVars.isMatchingPoint())
{
source[turbulentKineticEnergyEqIdx] += 2.0 * volVars.kinematicEddyViscosity()
source[turbulentKineticEnergyEqIdx] += 2.0 * volVars.dynamicEddyViscosity()
* volVars.stressTensorScalarProduct();
}
source[dissipationEqIdx] += volVars.cOneEpsilon()
* dissipation / turbulentKineticEnergy
* 2.0 * volVars.kinematicEddyViscosity()
* 2.0 * volVars.dynamicEddyViscosity()
* volVars.stressTensorScalarProduct();
// destruction
// turbulence production is equal to dissipation -> exclude both terms (according to local equilibrium hypothesis, see FLUENT)
if (!volVars.isMatchingPoint())
{
source[turbulentKineticEnergyEqIdx] -= dissipation;
source[turbulentKineticEnergyEqIdx] -= dissipation * volVars.density();
}
source[dissipationEqIdx] -= volVars.cTwoEpsilon()
* dissipation * dissipation
/ turbulentKineticEnergy;
/ turbulentKineticEnergy * volVars.density();
return source;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment