CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   LES correct function (http://www.cfd-online.com/Forums/openfoam-solving/59448-les-correct-function.html)

luiz eduardo March 23, 2004 23:14

Dear Sirs, I am trying to f
 
Dear Sirs,
I am trying to find where "correct" member is defined so as to be able to implement a new LES model. (this function correct is used aparently for updating turbulent nu, B, etc.). I could find it in the LES models themselves, but it always comes to a point that I get a variable of type volScalarField (for instance delta_) accessing this member (correct). But I could not find it in GeometricFields.H, GeometricScalarFields.H, or anything similar.
When I call delta_.correct, am I correcting SGS quantities, like in the LES models? Or it is for something else

I think I am a little lost, still struggling with C++. Or pehaps I need some sleep...

I beg your patience...

Luiz

Henry Weller (Henry) March 24, 2004 04:09

Yes the LES model correct func
 
Yes the LES model correct function is indeed in the LES models, for example in the compressible LES models in version 2.3 I am working on:

dm(208) pwd
/home/dm2/henry/foam/foam2.3/src/LESmodels/compressible/lnInclude
dm(209) !gr
grep correct *
DeardorffDiffStress.C:void DeardorffDiffStress::correct(const tmp& tgradU)
DeardorffDiffStress.C: GenSGSStress::correct(gradU);
DeardorffDiffStress.C: muSgs_.correctBoundaryConditions();
DeardorffDiffStress.H: void correct(const tmp& gradU);
dynOneEqEddy.C:void dynOneEqEddy::correct(const tmp& tgradU)
dynOneEqEddy.C: GenEddyVisc::correct(gradU);
dynOneEqEddy.C: muSgs_.correctBoundaryConditions();
dynOneEqEddy.H: void correct(const tmp& gradU);
GenEddyVisc.C:void GenEddyVisc::correct(const tmp& gradU)
GenEddyVisc.C: LESmodel::correct(gradU);
GenEddyVisc.H: virtual void correct(const tmp& gradU);
GenSGSStress.C:void GenSGSStress::correct(const tmp& gradU)
GenSGSStress.C: LESmodel::correct(gradU);
GenSGSStress.H: virtual void correct(const tmp& gradU);
LESmodel.C:void LESmodel::correct(const tmp&)
LESmodel.C: delta_().correct();
LESmodel.C:void LESmodel::correct()
LESmodel.C: correct(fvc::grad(U_));
LESmodel.H: // This calls correct(const tmp& gradU) by supplying
LESmodel.H: void correct();
LESmodel.H: virtual void correct(const tmp& gradU);
lowReOneEqEddy.C:void lowReOneEqEddy::correct(const tmp& tgradU)
lowReOneEqEddy.C: GenEddyVisc::correct(gradU);
lowReOneEqEddy.C: // low Re no corrected eddy viscosity
lowReOneEqEddy.C: muSgs_.correctBoundaryConditions();
lowReOneEqEddy.H: void correct(const tmp& gradU);
oneEqEddy.C:void oneEqEddy::correct(const tmp& tgradU)
oneEqEddy.C: GenEddyVisc::correct(gradU);
oneEqEddy.C: muSgs_.correctBoundaryConditions();
oneEqEddy.H: void correct(const tmp& gradU);
Smagorinsky.C:void Smagorinsky::correct(const tmp& gradU)
Smagorinsky.C: GenEddyVisc::correct(gradU);
Smagorinsky.C: muSgs_.correctBoundaryConditions();
Smagorinsky.H: void correct(const tmp& gradU);
dm(210)

luiz eduardo March 24, 2004 07:59

Yes, but where can I find the
 
Yes, but where can I find the "correct" function definition?
In all of those files.H, for instance, isoLESmodel, the function is referenced by something like

void isoLESmodel::correct(const tmp&)
{
delta_().correct();
}


void isoLESmodel::correct()
{
correct(fvc::grad(U_));
}

The second one ends up in the LES model itself (like isoSmagorinsky). So that I can understand.

But what about the first one (delta_.correct)? Is it for the same purpose? (Correcting SGS wuantities)
Where is its definition? I expected it to be in GeometricField.C or similar... but I dont think it is.

Best Regards,
Luiz

Henry Weller (Henry) March 24, 2004 08:03

> Yes, but where can I find t
 
> Yes, but where can I find the "correct" function definition?

In the corresponding .C file.

> But what about the first one (delta_.correct)?

delta_ is not an LES model it is the LES delta. If you want to change the way the delta is calculated rather than the LES model you will have to look in the LESdeltas library.

luiz eduardo March 24, 2004 11:03

The only thing I found there
 
The only thing I found there was

virtual void correct() = 0;

(in LESdelta.H file)

But I assume there must be any place else where it is calculated rather than just zeroed. If so, could you please tell me the file?

What is the purpose of it? Correct what?

Thanks again,
Luiz

Henry Weller (Henry) March 24, 2004 11:10

There are lots of implemented
 
There are lots of implemented correct functions for the LES deltas, all you have to do is:

dm(215) pwd
/home/dm2/henry/foam/foam2.2/src/LESmodels/LESdeltas/lnInclude
dm(216) grep correct *
cubeRootVolDelta.C:void cubeRootVolDelta::correct()
cubeRootVolDelta.H: void correct();
LESdelta.H: virtual void correct() = 0;
PrandtlDelta.C:void PrandtlDelta::correct()
PrandtlDelta.C: geometricDelta_().correct();
PrandtlDelta.H: void correct();
smoothDelta.C:void smoothDelta::correct()
smoothDelta.C: geometricDelta_().correct();
smoothDelta.H: void correct();

virtual void correct() = 0;

Is in the abstract base class (and doesn't "zero" anything) and clearly isn't implemented. If you want to see what the implementations do you will have to look at one of the derived classes rather than the abstract base class. However, my understanding is that you want to implement an LES model not and LES delta so you are probably looking in the wrong library.

ginapaolo September 14, 2007 04:10

Dear sir, I'm working with
 
Dear sir,

I'm working with a engine solver and I am trying to find exactly how the function correct(), in the hhuCombustionthermo and hhuMixtureThermo, updates the field (h,rho,etc..), because I need to change the way these are changed.

The Foam version I'm using is the 1.3.

Could you help me, please?

I beg your patience.

Thanks

Gianpaolo


All times are GMT -4. The time now is 01:43.