How to calculate the LES turbulent kinetic erengy in OpenFOAM
hi
i recently want to calculate the turbulent kinetic erengy using LES, when i search on the net, i only search the formula: k= 0.5((u')^2+(v')^2+(w')^2) where,u'=u-umean,v'=v-vmean,w'=w-wmean i think this formula is uncorrect,but i can't find how to calculate LES TKE in openfoam help! best wishes! ziwang |
Hey!
This is asked quite a lot on the forum, you'll probably find a fair few discussions about if you were to type in "LES TKE CFD-Online" into Google. Your formula for Turbulent Turbulent Kinetic Energy is (more or less) correct. I've recently posted a thread where I was working on a function to output the ratio of resolved/total TKE for my own LES work, see here. The quick version of which is that the 'R' post-processing function will provide you with the sub-grid Reynolds Stress Tensor, and the 'UPrime2Mean' calculation in the 'fieldAverage' function will provide you with the resolved Reynolds Stress Tensor, where: so your total Turbulent Kinetic Energy is: Hopefully this and the links provided should be enough to see you through! |
Since someone might be as lazy as myself, here goes the code that adds the totalTKE into account:
Code:
totalTKE The only changes from cjc96 function are the referencing to R (from R to turbulenceProperties:R) and the calculation itself. I checked function results with some literature data available and it seems to yield adequate values. |
Does the order of the functions call matter? If I want to time average the totalTKE so I can compare it to RANS, I need to do the following:
fieldAverage U to get Uprime2Mean turbulenceProperties to get R totalTKE function to using the above two fieldAverage TKE to get the time average of the above. Obviously there are various calls in here, will openFOAM handle this so long as they are all in the controlDict? Or do I need to place them in the order they need to be called? |
Yes, the order of the function matters when calling it. Personally, I add the totalTKE as an external file, so in the controlDict I only include this function, similar to what you do with residuals. But nothing stops you from adding it all to the controlDict file, it should work exactly the same.
The order you presented is fine and this should work. A noticed bug occurs when you start totalTKE along with the field average and the R function it will not identify the required fields and most likely crash. A quick fix for this is making it start one timestep after the fieldAveraging and the R start. Also, it will save at each timestep. you can disable this by deleting the line Code:
totalTKE.write(); |
How to add this to the controlDict
Quote:
|
Here's all you need to add at the bottom of your controlDict to get it working. If there is an existing "functions" section in your controlDict, then just combine their contents together. This was on OpenFOAMv2206.
Code:
|
Can we also use this approach in the case of the Smagorinsky model?
Quote:
|
All times are GMT -4. The time now is 04:05. |