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 the source code of realizableKE.C (http://www.cfd-online.com/Forums/openfoam-programming-development/65739-question-about-source-code-realizableke-c.html)

yuhai June 24, 2009 14:45

A question about the source code of realizableKE.C
 
Hallo, foamers,
My question is about using realizable KE on dynamic mesh.
I am reading the realizableKE.C, and found the treatment of Cmu:

--------------------------------------------------
tmp<volScalarField> realizableKE::rCmu
(
const volTensorField& gradU,
const volScalarField& S2,
const volScalarField& magS
)
{
tmp<volSymmTensorField> tS = dev(symm(gradU));
const volSymmTensorField& S = tS();
volScalarField W =
(2*sqrt(2.0))*((S&S)&&S)
/(
magS*S2
+ dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL)
);
tS.clear();
volScalarField phis =
(1.0/3.0)*acos(min(max(sqrt(6.0)*W, -scalar(1)), scalar(1)));
volScalarField As = sqrt(6.0)*cos(phis);
volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
return 1.0/(A0_ + As*Us*k_/(epsilon_ + epsilonSmall_));
}


tmp<volScalarField> realizableKE::rCmu
(
const volTensorField& gradU
)
{
volScalarField S2 = 2*magSqr(dev(symm(gradU)));
volScalarField magS = sqrt(S2);
return rCmu(gradU, S2, magS);
}
----------------------------------------------------------


in line:
------------------------------------------------
volScalarField Us = sqrt(S2/2.0 + magSqr(skew(gradU)));
--------------------------------------------------

I guess this is well for a fixed mesh.

but for a dynamic mesh, we have these equations:
http://venus.imp.mx/hilario/SuperCom...ml/img1590.gif
http://venus.imp.mx/hilario/SuperCom...ml/img1591.gif
http://venus.imp.mx/hilario/SuperCom...ml/img1592.gif
http://venus.imp.mx/hilario/SuperComputo/Fluent.Inc/manuals/fluent5/ug/html/node349.htm
I am wondering whether the "skew(gradU)" should substract something, before being the operation of "magSpr" for a dynamic mesh?
or the tensors are already updated in some other modules before this step?

Maybe this is a stupid question, for I am not good at matrix............., I am still waiting for your answer.



Best Regards
Hai

yuhai June 26, 2009 08:05

1 Attachment(s)
realizable.C


All times are GMT -4. The time now is 19:15.