CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   A question about the source code of realizableKE.C (

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 =
+ dimensionedScalar("small", dimensionSet(0, 0, -3, 0, 0), SMALL)
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:
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

yuhai June 26, 2009 08:05

1 Attachment(s)

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