CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Reg. LES in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-solving/72264-reg-les-openfoam.html)

ganeshv January 31, 2010 03:00

Reg. LES in OpenFOAM
 
hi !

Newbie alert !!

Wherever I look, I get redirected to Oodles or ChannelOodles for LES in OpenFOAM. I have OpenFOAM-1.6.x installed finally and there's no solver called Oodles.

Code:

[blah@blah incompressible]$ pwd
/opt/OpenFOAM/OpenFOAM-1.6.x/applications/solvers/incompressible
[blah@blah incompressible]$ ls
boundaryFoam  nonNewtonianIcoFoam  pisoFoam          simpleFoam
channelFoam  pimpleDyMFoam        porousSimpleFoam
icoFoam      pimpleFoam          shallowWaterFoam

channelFoam.c in channelFoam says that it the LES solver for channel flows. I have the following questions/doubts

1. Is an LES solver in OpenFOAM nothing more than SGS stress terms added to the NS equation ? So it's pisoFOAM with SGS stress terms with appropriate turbulence models and modified boundary conditions, wall functions etc. ?
2. I do want to do a channel flow simulation. But what solver do I use in general for LES of incompressible flows ? pisoFoam ?
3. Can you suggest any better place than Eugene's thesis to start looking inside the box ?

ganesh

paulo February 1, 2010 12:44

I would to add one more question:

- Is there already a solver in OF suitable for external aerodynamics LES?

Best Regards,

Paulo Rocha.

eugene February 2, 2010 04:39

For LES I would suggest pimpleFoam with the appropriate turbulenceProproperties (LES) settings and boundary conditions. pimpleFoam is like pisoFoam but with incomplete convergence of the corrector steps.

For external aero LES just use the SpalartAllmaras DES model as SGS model.

paulo February 2, 2010 19:13

Thank you very much for the fast reply.

I will investigate further.

Best Regards,

Paulo Rocha.

paulo February 3, 2010 06:36

Quote:

Originally Posted by eugene (Post 244545)
For external aero LES just use the SpalartAllmaras DES model as SGS model.

Hi Eugene and all,

Isn't DES a hybrid approach between RANS (near wall) and LES (free stream)? Isn't there a way to test pure LES for external aero? :confused:

Thanks in advance,

Best Regards,

Paulo Rocha

lakeat February 3, 2010 21:35

Quote:

Originally Posted by paulo (Post 244749)
Hi Eugene and all,

Isn't DES a hybrid approach between RANS (near wall) and LES (free stream)? Isn't there a way to test pure LES for external aero? :confused:

Thanks in advance,

Best Regards,

Paulo Rocha


Of coarse you can, provided you have a suitable mesh, etc.
Try pisoFoam, I used to use them to do flow like flow past circular cylinder, building, etc. It works very well.

Regards,

eugene February 4, 2010 06:48

DES is indeed a hybrid approach. I just assume that you would not be able to mesh external aerodynamic cases fine enough to use pure LES. If you do have the meshes to do pure LES, then I suggest you try the oneEqEddy, dynOneEqEdy or locDynOneEqEddy SGS models to start off with.

Check the openfoam workshop and open source cfd conference proceedings for similar applications.

panda60 February 4, 2010 08:10

Quote:

Originally Posted by eugene (Post 244920)
DES is indeed a hybrid approach. I just assume that you would not be able to mesh external aerodynamic cases fine enough to use pure LES. If you do have the meshes to do pure LES, then I suggest you try the oneEqEddy, dynOneEqEdy or locDynOneEqEddy SGS models to start off with.

Check the openfoam workshop and open source cfd conference proceedings for similar applications.

Dear Eugene,
I have two questions:

1. If using oneEqEddy model, how we can set boundary for k?
because for RANS model, we can get k from experiment for inlet condition.
But for LES, we couldn't get sub-grid turbulent kinetic energy for inlet. Or just give a small value is OK ? for example 5e-5.
So I think why so many people use Smagorinsky model, maybe don't need to set boundary for k, am I right ?

2. I have read your paper, that is very good!
the size of my case is very similar to your "Side Mirror" one. First I use 300000 meshes Smagorinsky+ Spading law wall function, and then I use a little finer mesh 500000 mesh Smagorinsky+ VanDriset damping function, both of my velocity value is smaller than RANS and Experiment data above ground 12mm position, that meas my LES result shear stress is larger, so velocity is small. Could you give me some suggestions to improve my LES result ?
Tnank you very much.

eugene February 5, 2010 04:47

Hi,

The boundary for k is pretty straight-forward, since you will have no resolved scale turbulence at the inlet, just set it to the equivalent RANS value. It will adjust really quickly once things start happening. Setting it too small is not a good idea, as this can lead to spurious numerical noise if you have any grid abnormalities.

All I can suggest, is that you try the other turbulence models and see what happens. I haven't run pure LES for a while, but in literature most people use some kind of dynamic model. Also, the oneEqEddy model I used in my thesis is not the same as the one currently in OPENFOAM. I had a separate near-wall dissipation length-scale that was independent of the turbulent energy length scale. This improved results on channel flows by a few percent relative to the current model. The independent dissipation scale does not fit into the current SGS model framework though and was not incorporated into the release code as a result. Unfortunately, I no longer have the code for this.

paulo February 6, 2010 18:21

Eugene, Daniel and all

Thanks a lot for the information and time. I will start trying to solve my problem.

Best Regards,

Paulo Rocha

alberto February 7, 2010 03:02

Quote:

Originally Posted by panda60 (Post 244937)
Dear Eugene,
I have two questions:

1. If using oneEqEddy model, how we can set boundary for k?
because for RANS model, we can get k from experiment for inlet condition.
But for LES, we couldn't get sub-grid turbulent kinetic energy for inlet. Or just give a small value is OK ? for example 5e-5.
So I think why so many people use Smagorinsky model, maybe don't need to set boundary for k, am I right ?

Some picky comment, but I hope of some help. ;)

  1. Depending on the information you have from experiments, you can, at least roughly, estimate the residual kinetic energy at the inlet, and use that value. If you have PIV measurements of the inlet, you can filter that velocity filter that velocity field with the same filter size you use in the simulation, and obtain the value of the residual k at the BC.
  2. Giving as boundary condition the total turbulent kinetic energy when you are solving an equation for the residual one does not sound correct in principle, since your solution is going to depend on that value.
If there are numerical problems due to grid anomalies when k is set to be small, it simply means the mesh is not good enough for a LES anyway, or there is some problem in the numerics.
Remember that, strictly speaking, you cannot use a non-uniform mesh in LES, since you assume you can commute the integral and the derivative operators, and you neglect the terms depending on the filter size when you filter the conservation equations. The error is generally not negligible. It was shown (Guerts and co-workers, take a look at what they published in Physics of Fluids in 2005 on the commutation error) that the error becomes small if the change in the filter is slow and its skew is limited, but this is surely not the case if the mesh anomalies can cause numerical problems. :D
In addition, there is quite some interest around commutative filters and other approches to account for the commutation error. You might be interested in reading, for example, the work of
  • Marsden et al, Journal of Computational Physics, 2002 (Commutative filters on unstructured grids)
  • Iovieno and Tordella, Physics of Fluid, 2003 (Incorporation of filter-dependent terms in the conservation equations)
  • Geurts and co-workers, Physics of Fluids, 2005
  • Piomelli et al., Stanford CTR Proceedings Summer 2006
Best,

deji May 7, 2010 15:12

LES turbulent inlet
 
Hey there Eugene. I have a question that has being on-going for a short while. My research entails feeding the mean velocity and temperature profile into the lower portion of a plate (turbulent natural convection flow). So, to accurately predict the turbulent flow field downstream, what is the best approach to take in setting the turbulent inlet. I have considered superimposing some perturbations at the inlet and also remapping the flow field downstream back into the inlet. So any thoughts on this? Thanks.
And, I have not found any literature on how to set these turbulent boundaries in openFOAM. Is there any documentation or example in the code? Thanks.
Kind regards
Deji

eugene May 10, 2010 04:48

Hi Deji,

The only implementation available in the standard code for LES inlets is the directMapped boundary for looping stuff back onto the inlet.

You can find an example case here:
$FOAM_TUTORIALS/iincompressible/pisoFoam/pitzDailyDirectMapped

You could of course also write your own boundary with perturbation specifications.
For a reference, search for papers by Gavin Tabor. (There are others as well, if you don't mind digging in the forum and online.)

deji May 10, 2010 09:42

Thank you very much Eugene.

deji May 24, 2010 10:12

Inlet velocity profile
 
Hey there Eugene, I have a question. I am trying to implement the directmapped inlet for my LES simulation, and I happen to have my non-uniform velocity and temperature profiles at the inlet. I am unsure as to how to prescribe the average profile on the line I have marked on the posted sample velocity inlet profile. If possible , kindly give me some input on this matter. Thanks much.

inlet
{
type directMapped;
value nonuniform
2
(
(0 0 .15)
(0 0 .12)
);
setAverage true;
average ( ); <---------- ?? :confused:
}

eugene May 24, 2010 11:42

Its not an average profile, its an average value.

average (<x y z>);

for velocity and other vectors.

average <x>;

for temperature and other scalars.

deji May 24, 2010 12:48

Thanks for the response Eugene. Hence, to clarify, for each vector that I prescribe at the inlet, there should be an average (<x y z>) when utilizing the directmapped inlet bc. For example,

inlet
{
type directMapped;
value nonuniform
2
(
(0 0 .15)
(0 0 .12)
);
setAverage true;
average
( <x y z> )
( <x y z> );

}

Thanks

eugene May 27, 2010 05:22

Unfortunately, what you want is not possible without code alteration. I checked the directMapped source code and it only admits a single value. This value fixes the mapped field average at every single timestep - i.e. the average is constant in time.

You are trying to impose a mean distribution, should not the shape of the distribution emerge from the flow calculation itself? It should not be too difficult to add an "average" field distribution, but I have no idea how you would use this to force your time-mean input field (instead of you instantaneous field) toward the desired value.

deji May 27, 2010 08:44

Unfortunately, what you want is not possible without code alteration. I checked the directMapped source code and it only admits a single value. This value fixes the mapped field average at every single timestep - i.e. the average is constant in time.

You are trying to impose a mean distribution, should not the shape of the distribution emerge from the flow calculation itself? It should not be too difficult to add an "average" field distribution, but I have no idea how you would use this to force your time-mean input field (instead of you instantaneous field) toward the desired value.

Eugene,
With the directMapped code, I assume it feeds the instantaneous field back into the inlet. So, I gather it would be more feasible to use the instantaneous field rather than some mean distribution.

And it seems that the use of the single average value is only for a uniform inlet? I did take a look at your thesis work as you utilized this capability for the diffuser's inlet. In my research, there was a free convection experiment along a vertical plate and at some point the flow became turbulent. So, I am basically taking data at the inception of turbulence for the experiment and using it for my CFD calculation.

Thanks.

Best regards
Deji

deji May 27, 2010 13:49

Hey there Eugene. I thought about this and the fact is I would rather have the instantaneous profiles at the inlet instead of the mean quantities. Mean profiles are utilized since that is all I have at that particular location of the start of a turb. b.L. Perhaps, the directMapped code should be suitable for my computation. The only thing that I am still somewhat confused by is the average quantity.

Kind regards
Deji

eugene May 28, 2010 11:13

The "average" value that you specify is not what is applied to the boundary. If you specify an average value, then the instantaneous mapped data is scaled such that the average of the mapped data matches the specified average.

If you want to use mapping for a developing boundary layer, then you need something different. I suggest you try and contact Gavin Tabor at Exeter University. They published some work on this type of stuff.

impecca July 28, 2010 14:03

SGS stress
 
Hi, Eugene.
I am simulating the plane channel flow using LES and I look into your PhD thesis as a reference. It helps alot, thanks.
BTW, I also want to see SGS stress on channel as you presented (in your case SGS shrear stress, Sigma_xy). So I am wondering if there is any option to calculate SGS stress. I think I need to calculate SGS stress and U simultaneously because SGS stress = nu_SGS * dU_i/dx_j (U_i is resolved velocity vector, not mean velocity). Correct me If I am wrong.
Thanks in advance.
Yusik

eugene August 27, 2010 18:10

Unfortunately, to calculate the mean sgs stress, will require some coding. You need to add something like this to your solver:

Before the time loop in pisoFoam, e.g. in createFields.H add:

"tmp<volSymmTensorField> R(turbulence->R());"

for the oodles solver replace with sgsModel->() . Also add the following inside the time loop:

R = turbulence->R();

Now, use the fieldAverage function object to get RMean.

Hope this helps.

impecca September 8, 2010 03:26

Quote:

Originally Posted by eugene (Post 273148)
Unfortunately, to calculate the mean sgs stress, will require some coding. You need to add something like this to your solver:

Before the time loop in pisoFoam, e.g. in createFields.H add:

"tmp<volSymmTensorField> R(turbulence->R());"

for the oodles solver replace with sgsModel->() . Also add the following inside the time loop:

R = turbulence->R();

Now, use the fieldAverage function object to get RMean.

Hope this helps.


Thanks, Eugene.

To generate R field, I added this code in 'createField.H' :
Info<< "Reading field U\n" << endl;
volSymmTensorField R
(
IOobject
(
"R",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

rather than
tmp<volSymmTensorField> R(turbulence->R());

because if I use only one line above, I had this error message ' turbulence was not declared in this scope'.

The others are fine. Thanks again.
Yusik

lakeat September 8, 2010 09:37

:)
He was not wrong, I guess you have misunderstood him, "turbulence" in his post is more a general type than a specific variable. Bye

ehsan July 24, 2012 17:25

I had a basic question on LES. In OF, we use the same equations for momentum while we selected every type of turbulence models including LES, K-e and so on. So, where is the effect of volume filtering in LES in momentum equation?

Thanks

lakeat July 24, 2012 17:31

Generally speaking, filter operation is done "implicitly", which is a common practice in many finite volume code.

And you are right, the idea of "implicit" filtering or averaging, makes the gap between RANS and LES no longer big from the programming point of view, and then hybrid methods arise!

Go hybrid!

ehsan July 24, 2012 17:39

Hi Daniel

O.K, But does it mean all LES models in Openfoam are implicit? When we select some models which permit us selecting filter (like Laplace), I think the LES in explicit in these cases, am I wrong?

Ehsan

ehsan July 24, 2012 17:45

And I had another key question:

If our Momentum equation is the same for RANS and LES, and all the effects of small scales eddies are given by: B=-2v_sgs*D, the final momentum equation in LES reads the same as any other turbulence modelling: v_effective=v+v_sgs (in RANS it is v+v_turb),
assume we use OneEqEddy model and solve an equation for k to get v_sgs. This OneEqEddy is typically close to the one in RANS. So, what is the different LES and RANS finally? Why LES gives much better results?
Only because this v_sgs is limited to sub grid sclae unlike RANS where v_t is for whole domain?

Ehsan

lakeat July 24, 2012 18:01

Are LES and RANS big different?

In short: Yes and No.

1. The stress scaling with delta or scaling with wall distance makes a huge difference, the former we call LES, the latter we call RANS. 2. Of cause, there are more differences in numerics so it is not easy to convert a RANS-based code to LES, but if you just consider the turbulence modeling part, it is not that difficult, as you already noticed, their formula are quite similar 3. Both ways, both formulations are correct, so once you know how to use them, their answers should be bother correct and accurate, so saying LES is always better is not correct. 4. Since LES only try to model a small portion of energy in the spectrum, and these small eddies tends to be isotropic away from the wall, so the model accuracy is not so sensitive as a rans model, so even with a smagrinsky model, you can have a pretty good results, no needs always go dynamics, however, as you may experience, building a powerful RANS model is such a great challenge because it is not easy to find an universal one, but to be sure, we still need a new and powerful generation of RANS model.

ehsan July 24, 2012 18:12

Thanks a lot, could you please give a clue on my former question, explicit LES in OpenFOAM as well.

Regards

lakeat July 24, 2012 18:21

That I dont know very well, hope someone else could shed some lights on it and share some comparison results!

My understanding is that through some mathematical operations, the "effect" of of filter is actually only working on the SGS stress term, that is the viscosity formulation in terms of EVM theory. At least for some filters.

vkrastev July 25, 2012 06:00

To my knowledge an explicit LES model means that the sgs viscosity is modeled explicitly in some way (e. g. with an algebraic expression which uses flow variables, such as the Smagorinsky formulation). On the other side an implicit LES does not have a separately modeled sgs viscosity, but it simply introduces the necessary viscosity level into the flow domain in form of numerical viscosity generated by the numerical schemes. So, generally speaking OpenFOAM treats LES modeling in an explicit way.

Regards

V.

ehsan July 25, 2012 08:34

If you see in the implementations of LES models in OF, some of theme does not require any filter (like OneEqEddy) but some other categories require it. I think that implicit models does not need filter while explicit ones need.

Regards

vkrastev July 25, 2012 08:56

In the OneEqEddy model there is still an explicitly calculated sgs viscosity, which depends on the filtering spatial cutoff value "delta", so to me this cannot be defined as an implicit LES model. However, if someone else wants to enter the discussion it would be interesting to further clarify this point.

Regards

V.

ehsan July 25, 2012 09:05

2 Attachment(s)
1- Please see this nice paper which comes from Furbey,

Numerical Simulation of an Oscillating Cylinder Using Large Eddy Simulation and Implicit Large Eddy Simulation

DOI: 10.1115/1.4005766

Journal of Fluids Engineering, 2012, MARCH 2012, Vol. 134

See Eq. 2 and 5 about implicit and explicit LES. This work is done with OpenFOAM.

2- And as I see the 2008 paper (attached some pages), oneEqEddy is explicit, as you told. So where are the implicit models that Bensow used?

Regads

vkrastev July 25, 2012 09:35

Honestly I don't know how the implicit LES modeling has been implemented in these papers (I don't have access to the full copies), but remember that OpenFOAM is an open code, so the fact that apparently there isn't a "standardized" implicit LES modeling approach in the official releases does not mean that such modeling cannot be done (probably you should ask one of the authors of the papers for more information about it). Anyway, I think that an interesting passage extracted from the second of your attachments is the following:

"The discretization scheme used is a central differencing scheme with different TVD limiters applied to the convective term to ensure stability and introduce the necessary dissipation for the implicit modeling."

Regards

V.

lakeat July 25, 2012 10:04

I was saying "implicit filtering", not Implicit LES (ILES). ILES is a different matter.

Quote:

"So, generally speaking OpenFOAM treats LES modeling in an explicit way." -vkrastev
I Agree!

curiosity August 29, 2012 06:37

solvers for LES in steady flow
 
Quote:

Originally Posted by eugene (Post 244545)
For LES I would suggest pimpleFoam with the appropriate turbulenceProproperties (LES) settings and boundary conditions. pimpleFoam is like pisoFoam but with incomplete convergence of the corrector steps.

For external aero LES just use the SpalartAllmaras DES model as SGS model.

Hi Eugene,

You told about the solver pisoFoam to solve a flow for LES, but Iīve read itīs for transient flow... do you know which solver can be used to solve a steady one?

Thanks in advance

Paula

palmerlee February 26, 2014 20:07

Quote:

Originally Posted by alberto (Post 245231)
... Depending on the information you have from experiments, you can, at least roughly, estimate the residual kinetic energy at the inlet, and use that value....

Hi, Alberto!

Could you please give me any suggestion on how should I set up k at wall boundary in my LES simulation? The y+ is smaller than 2 in my case.

Best regards,
Peter


All times are GMT -4. The time now is 14:51.