CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   DyOneEqEddy negative nuSgs (

roth March 3, 2009 19:43

dyOneEqEddy (and perhaps other
dyOneEqEddy (and perhaps other dynamic models) depends upon a localized ck i.e.

nuSgs = ck(D) * sqrt(k) * delta

I've found that ck(D) can become negative leading to negative nuSgs.

How about bounding nuSgs e.g. in dyOneEqEddy.C after the k solve with somebody like

bound(nuSgs_, dimensionedScalar("zero", nuSgs_.dimensions(), 0.0));

Or upstream in the actual calculation of ck.

Of course, perhaps we're simply trying to reverse the cascade.


kumar2 March 3, 2009 20:02

Hi Michael, Does the dyOneE
Hi Michael,

Does the dyOneEqEddy model calculate one single global constant, ck, or is it a localized costant. If it is local then in the presence of backsactter ck can be negative ( and nuSgs also negative). One the other hand if the constant is a global one, then the backscatter << forward scatter and the chance of the constant going negative is small.



roth March 3, 2009 20:34

Hi Kumar, dyOneEqEddy uses
Hi Kumar,

dyOneEqEddy uses a localized ck.

Hmmm backscatter. Good point though I'm seeing far too much of it. I wonder if the ck needs some form of limiting or stabilization.

Thanks, I'll investigate further.


kumar2 March 4, 2009 01:25

Hi Michael, I was looking
Hi Michael,

I was looking at the code for calculating ck in dynOneEqEddy.C (i have also pasted it below

///////////////////////////////// Begin Code///////////////////////////////////////////////////////////
dimensionedScalar dynOneEqEddy::ck(const volSymmTensorField& D) const
volScalarField KK = 0.5*(filter_(magSqr(U())) - magSqr(filter_(U())));

volSymmTensorField LL = dev(filter_(sqr(U())) - sqr(filter_(U())));

volSymmTensorField MM =
delta()*(filter_(sqrt(k_)*D) - 2*sqrt(KK + filter_(k_))*filter_(D));

dimensionedScalar MMMM = average(magSqr(MM));

if (MMMM.value() > VSMALL)
return average(LL && MM)/MMMM;
return 0.0;

//////////////////////////////// End Code ///////////////////////////////////////////////////////////////

ck is average(LL && MM)/MMMM

and MMMM = average(magSqr(MM)); // Is this not a single number for the whole domain ?
average(LL && MM) // This also appears to be a single number for the whole domain ?

Thus ck is just one number for the whole domain. or am i wrong here ??

Any ideas as to how locDynOneEqEddy is different from dynOneEqEddy. I thought the dynOneEqn gives a globalized ck and locDynOneEqEddy gives a local ck. any comments ?

Thanks again.


henry March 4, 2009 04:09

Hi Michael, Personally I am
Hi Michael,

Personally I am not convinced by the argument that negative nuSgs represents back-scatter; it violates the entropy inequality. This is a big problem with localized dynamic models and the reason why I don't use them. Putting a clip in to stop nuSgs becoming negative is one "solution" but it's not very physical.


kumar2 March 4, 2009 17:23

Hi Henry, What is the diffe
Hi Henry,

What is the difference between the locDynOneEqEddy and dynOneEqEddy ?

Thanks a lot

Best regards


henry March 4, 2009 18:03

locDynOneEqEddy uses locally e
locDynOneEqEddy uses locally evaluated coefficients.

dynOneEqEddy uses globally averaged coefficients and is hence only formally applicable to homogeneous turbulence e.g. in a box with cyclic boundaries.


kumar2 March 4, 2009 18:28

Hi Henry Thanks a lot for y
Hi Henry

Thanks a lot for your reply.

Best Regards


All times are GMT -4. The time now is 09:54.