CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   LES for wind over buildings (

Djub June 13, 2012 11:25

LES for wind over buildings
hi dear Foamers,

I am trying to compute some cases about buildings in a turbulent atmospheric boundary layer. I want to use a LES formulation , but I have absolutely no idea about a correct model and correct parameters to take?
Does anybody has some advices for me?

Another challenge will be to use a controlled inlet. I can generate some correct wind fields (with Jin, Lutes and Sarkani method for example), but how to tell openFoam to take this as inlet?

anishtain4 June 14, 2012 06:19

about the first question read some papers in your context and see what they have done?

about the second question, how did you produced that? I'm sure in LES you can't have an static inlet profile and it should changes with time, there are some threads here about boundary conditions that change with time

Djub June 15, 2012 04:38

Part of solution
Hi !
I found some answers to my questions, and I would like to help other foamers so I post these advices:

This is an excellent source of knowledge on the WEB:

Concerning LES, they say that it is necessary to choose:
- a 3D model (but I succeded with a 2D one, with an OpenFoam warning)
- unsteady analysis: I used pisoFoam
- central diff. schemes for spatial derivatives: I used Gauss Linear (and Gauss linear corrected for laplacian)
- A second order time scheme: I used CrankNicholson .5
All this is to avoid numerical viscosity; it is quite important because natural air viscosity is very small.

The turbulence model choice seems to be of second order.

'hope this wil help some bodyelse!

anishtain4 June 15, 2012 05:03

And what happened to your inlet condition?

btw when you are solving LES you have to do it 3D, there is 2D turbulence but it's not widely accepted because the main turbulence production mechanism which is vortex stretching does not occur in 2D. in your LES case you are having sub-grid scale but your grid-scales don't do what it has to do

Djub June 15, 2012 06:41

Thanks Mahdi; you are right, my turbulence (little scales) is for sure approximate. but I have the main unsteady behavior with large vortices.

By the way, I still have bigger problems with my BC.
  • INLET: For the moment, I used a homogeneous constant inlet. I would like to try first "turbulentInlet", and later a fully controlled inlet (I will calculated the Atmospheric Boundary Layer by another programm).
  • OUTLET: I have problems both with fixedValue + zeroGradient and inletOutlet + outletInlet , with some "explosions" (a global high pressure everywhere in the domain) when a vortex -which has a negative pressure- touchs the outlet.
I can try to send some pictures if you wish. Does anybody has some advices for these subjects? (apart from making a very long domain in order to damp the vortices...)

elvis June 15, 2012 08:31

Guidebook for Practical Applications of CFD to Pedestrian Wind Environment around Buildings

Djub June 15, 2012 08:47

Thanks Elvis. It will help me to check my modelization. Nevertheless, results are mean values and BC are not detailed. It will help me to validate my calculations, but nothing to make them...

fs82 June 15, 2012 09:35

I have some remarks to your problem. With the outlet you will always have trouble if you use a Dirichlet or Neuman BC or a combination of both. But there are ways to overcome this trouble. Look for sponge layer ( or convective Outlet BCs.
The inflow condition is also a bit tricky I guess. If you use a time variing BCs you have to ensure to apply natural turbulence (power spectra) and not some syntetic turbulence. You could ensure this with a longer domain to allow the flow to adjust and develop a natural turbulance before it reaches your buildings. The easiest way to overcome both problems inlet and outlet is to use periodic BCs and drive your flow e.g. with a mesocale pressure gradient (see channelFoam).
I think the choice of your SGS model depends on your problem. I would recomend to check literature. May be the Deardorff model based on the TKE equation (one-equation eddy in OF) is a good choice.
Check your discretization for your convective term carefully. I experience some problems with Gauss linear and switched to Gauss limited linear and apply the TVD flux limiter. This behaves much better in my cases.

Kind regards,

Djub June 25, 2012 05:06

Thanks Fabian ('excuse me for the delayed answer).

Your advices are very interesting, but so dense! You gave me some months of work! I have to:
  • Try a "beach" at the domain end
  • Try periodic BC (and roughnesses on the floor, like in a windtunnel?)
  • Try to impose time- and space- depending inlet (with a problem of divergence-free signals)
  • Read off and test different SGS models (I am totally new about this)
  • Maybe "play" with the discretization schemes. But I don't see the limitations and the advantages of each methods...
I made a little calculation, just to try: a 40-cm diameter 4m long tube.


bounding box: 4m x 4m x 14m
Uo = 4 m/s
dT = 2ms
220 000 cells
non orthogonality: max 45, min 5.8
Tolerance: 1e-2 for all (but P : 1e-3 )
nCorrectors 2
nNonOrthogonalCorrectors 1
relaxation Factors: 0.7 for all (but p: 0.3)

It took me about 16H for 10 second simulated (on a 8 cores cluster).

What tdo you think about these parameters?

(I am still not sure it worked... I have to check for the Von Karman vortex shedding and its Strouhal frequency)

fs82 July 2, 2012 04:50

Sry for my late answer, but I was on holiday :-D
I never done LES for buildings. I am dealing with canopy flows. My indention was to give you some hints, to avoid some problems I have experienced. You should carefully think about your boundary conditions. If you are able to use periodic BCs your fine, the only "problem" to take care of is a the driving pressure gradient for the flow. If you are not able to use periodic BCs you should spent some work on that. The available outflow BCs (if you not know a value for the pressure at outlet, e.g. if you simulate a windtunnel this would be the case) normally have problems if strong vortices reaches the outflow domain. The easies BC to overcome this problem would be a sponge layer. The inflow is the next problem. You have to ensure natural turbulence and this is for my opinion difficult to ensure with synthetic velocity profiles for the inlet. A way to overcome this problem would be using a "beach" before the flow reaches your buildings. Another way probably be a Sommerfeld radiation BC, called convective BC. And for the remaining spanwise boundaries use periodic BC. I checked literature for BC with in and outflow but found nothing usable.
For the SGS model I would recommend to check literature. The choice of an SGS model is very problem depended. But I think you find quickly an appropriate SGS model.
For the problem with the discretization scheme, i just wrote my experience. I have read in the forum that the linear scheme should also work, but for my test with an infinite cylinder I experienced a problem with the SGS model. It generated much turbulence upstream in front of the cylinder, which is physical senseless. Using the limited linear scheme solved this problem for me, but limits the CFL number to less than 1. This is just my experience, so feel free to use other schemes, but check your results.
Your setup seems to be OK. I use 3 orthogonal correctors and 2 nonOrthogonal with less mesh orthogonality, but I never tested it carefully. Its just a feeling :-D The tolerance seems to be a little low. I use 1e-06 for p and 1e-05 for U but this depends on what you expect from your results.

kind regards,

Djub July 12, 2012 12:27

Current flow

I go slowly, but still progressing. So I am quite happy :)!
Now, I have a big (1M2 cells) 3D problem. I work with a LES model (smagorinsky), with PISO algorithm. But I have a comprehension problem:
PISO is an Implicit method; thus, it should be not depending on a low current flow. Nevertheless, my simulation doesn't work with a Cfl > 1 . Did I miss something?

I have also misunderstanding about the size of the LES filter. How to control this size? With the delta (I use cubeRootVol) and deltaCoeff (I use 1) ? Does it mean that my filter is a square gate with size equal to 1xcell size ?

Last, I also have no idea about how to choose the size of the cells of my meshing:confused:... For the moment, my "choice" was to have a maximum of cells, but a number that paraFoam accepts! (I had some core dumps with high refinement meshes...:()

Thanks for help,

PS: I followed your advice and raised my tolerances to 10-5 and 10-6 for P ...

fs82 July 16, 2012 21:22


for me it tooks almost 1 year to get the first simulation running. So be patient and happy about every small step forward. Which method to you choose for the convective term? I use limitedLinerar and this limits the CFL number to less than one as far as I understood.
To figure out how your filter lengthscale delta is calculated step into the source code. Just check $FOAM_SRC/turbulenceModels/LESdeltas/ and go through the .C and .H files and you will find your answer.
The size of your mesh depends on what you need. If you doing a LES for the wake of a cylinder without a wall model you have to ensure y+ (wall coordinate) to be below one to resolve the boundary layer (important for viscous drag). For atmospheric flow this is not possible. You normally not be able to resolve the real boundary layer. You have to use a wall function instead (log law, monin-obukhov) depending on you specific problem. As far as I know the mesh resoltion depends also on your problem forumulation, e.g. neutral stability (no temperature) or instable boundary layer. As far as I know you have to have a finer grid resolution if you would like to get the temperature gradiends correctly, but this is just guessing ;) To be honest I cannot give you an answer. You have to figure out the mesh resolution by yourself with a study of different meshes and checking the results if they change or not.
This is research :-D But check literature and see what other people use for similar problems.

kind regards,

cm_jubayer January 29, 2013 16:29


Did any one of you figure the burning question regarding LES in OpenFoam, which is, whenever you use a fluctuating inlet, pressure field becomes crazy. You can reproduce this just by running the pitzdaily tutorial and checking the pressure contours.


Djub January 30, 2013 05:58

Well, I am not (yet ;)) an expert, so I don't know about pitzDaily.
What I know, is that synthezised turbulence is very hard to create in order to be correct for CFD analysis. Usually, this kind of turbulence has nothing to see with Navier-Stokes: only with statistics within the velocity fields. For example, I don't know any method that involves fluctuation of Pressure. It sounds natural, for me, that a fluctuating veolicty inlet had a fluctuating pressure inlet. I don't remember this kind of pressure field...

I am much more confident in the "recycling" method, with directMapfield.

All times are GMT -4. The time now is 05:27.