CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   A question about UEqn sonicFoam (http://www.cfd-online.com/Forums/openfoam-programming-development/104750-question-about-ueqn-sonicfoam.html)

lfgmarc July 14, 2012 20:25

A question about UEqn sonicFoam
 
Hi, I have a question about the UEqn implemented into sonicFoam, the code of the UEqn is:

Code:


fvVectorMatrix UEqn
(
    fvm::ddt(rho, U)
    + fvm::div(phi, U)
    + turbulence->divDevRhoReff(U)
);

My question is about the term that is computed from the turbulence model, i.e if K-epsilon model is selected, this term results:

Code:


tmp<fvVectorMatrix> kEpsilon::divDevRhoReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(muEff(), U)
      - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
    );
}

Initially I thought that it corresponded to

\nabla \cdot \left( \widetilde{\tau}-\bar{\rho}\widetilde{u^{''}u^{''}} \right) =
2\mu\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right) 
+\left( 2\mu_{t}\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right) -
\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}
\right) (1)

but after examining the definition of dev2 in src/OpenFOAM/primitives/Tensor/TensorI.H

I found the following:

dev2(u)=u-\frac{2}{3}tr\left(u\right)

S is the rate-of-strain tensor given by

S=\frac{1}{2}\left(\nabla u + \left(\nabla u \right)^\mathrm{T} \right)

but according to the definition of DivDevRhoReff

divDevRhoReff = -\nabla^{2}\left(\mu_{eff} U\right)
-\nabla \cdot \left( dev2 \left(\mu_{eff}\left(\nabla U \right)^{\mathrm{T}}\right)\right)

And manipulating the expression (1) I conclude that the term

Code:


    + turbulence->divDevRhoReff(U)

does not correspond to (1).

If someone can help me with my confusion about this term, I was very thankful

haze_1986 January 24, 2013 12:26

Quote:

Originally Posted by lfgmarc (Post 371474)
Hi, I have a question about the UEqn implemented into sonicFoam, the code of the UEqn is:

Code:


fvVectorMatrix UEqn
(
    fvm::ddt(rho, U)
    + fvm::div(phi, U)
    + turbulence->divDevRhoReff(U)
);

My question is about the term that is computed from the turbulence model, i.e if K-epsilon model is selected, this term results:

Code:


tmp<fvVectorMatrix> kEpsilon::divDevRhoReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(muEff(), U)
      - fvc::div(muEff()*dev2(fvc::grad(U)().T()))
    );
}

Initially I thought that it corresponded to

\nabla \cdot \left( \widetilde{\tau}-\bar{\rho}\widetilde{u^{''}u^{''}} \right) =
2\mu\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right) 
+\left( 2\mu_{t}\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right) -
\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}
\right) (1)

but after examining the definition of dev2 in src/OpenFOAM/primitives/Tensor/TensorI.H

I found the following:

dev2(u)=u-\frac{2}{3}tr\left(u\right)

S is the rate-of-strain tensor given by

S=\frac{1}{2}\left(\nabla u + \left(\nabla u \right)^\mathrm{T} \right)

but according to the definition of DivDevRhoReff

divDevRhoReff = -\nabla^{2}\left(\mu_{eff} U\right)
-\nabla \cdot \left( dev2 \left(\mu_{eff}\left(\nabla U \right)^{\mathrm{T}}\right)\right)

And manipulating the expression (1) I conclude that the term

Code:


    + turbulence->divDevRhoReff(U)

does not correspond to (1).

If someone can help me with my confusion about this term, I was very thankful

Indeed, I was thinking it should be dev instead of dev2 as well if the explanation by poplar in http://www.cfd-online.com/Forums/ope...tml#post388688 is correct.

I hope I can find out what is wrong.

jens_klostermann February 15, 2013 09:07

Hi,

the term

\nabla\cdot\left[2\mu\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right) 
+\left( 2\mu_{t}\left( \widetilde{S}-\frac{1}{3}\nabla\cdot\left(\widetilde{u}\right)\mathcal{I}\right)
\right)\right]
is equal to
divDevRhoReff = -\nabla \cdot \left(\mu_{eff} \nabla U\right)
-\nabla \cdot \left( dev2 \left(\mu_{eff}\left(\nabla U \right)^{\mathrm{T}}\right)\right)


But I miss the term
\left(-
\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}
\right)

in
Code:

turbulence->divDevRhoReff(U)
maybe someone can comment on this hidden term?

Jens


All times are GMT -4. The time now is 05:25.