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 13: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 10: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

sasanghomi June 14, 2013 15:36

Hi jens
Did you find this term ? I have a similar problem .
\left(-
\frac{2}{3}\bar{\rho}\widetilde{k}\mathcal{I}
\right)

Thanks
Sasan.

jens_klostermann June 17, 2013 09:57

No, I didn't habe time to work further on this problem.

sharonyue December 24, 2014 16:48

Quote:

Originally Posted by jens_klostermann (Post 434460)
No, I didn't habe time to work further on this problem.

I found a similar thing on this: http://www.cfd-online.com/Forums/ope...oam-2-2-x.html

pgiannatselis February 1, 2015 17:49

Reading http://www.cfd-online.com/Forums/ope...ivdevreff.html I concluded that this term is zero if the fluid is incompressible and near convergence it doesn't concern us. The term remains for stability reasons when we are still far from the solution. If somebody more experienced confirms my thinking, the problem is solved.

I don't feel able to tell you that my point is 100% correct.


All times are GMT -4. The time now is 22:41.