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/)
-   -   Best-Practices for LES (https://www.cfd-online.com/Forums/openfoam-solving/196958-best-practices-les.html)

gu1 December 22, 2017 13:33

Best-Practices for LES
 
Hi,

I was reading the file "BEST-PRACTICES FOR LES IN FLUENT", the file recommends:

Quote:

Recommended Procedure:

1. Compute the mean flow with steady RANS;
k-ε model is sufficient
The RANS solution doesn’t have to be fully converged

2. Superimpose the synthesized turbulence on the mean flow;

3. Switch to LES, select the SGS turbulence model of your choice.
For the same geometry (and mesh), how would the procedure in OpenFOAM be?
- MapFields?! (I believe it is for different geometries...but, needed in case there is a change in the mesh?)

- once you've finished modeling the field using RANS, switch to LES and overwrite existing files (from RANS results)?! But if you take a non-ideal approach to the problem (fvSquemes, fvSolution), you would have to redo the whole process (RANS -> LES ...)?

The intention of the post is not only to answer my question, but also to serve as a guide for future adventurers in LES.

GerhardHolzinger January 9, 2018 23:16

mapFields works perfectly well for identical geometries.

RobertHB January 10, 2018 07:57

Quote:

Originally Posted by gu1 (Post 675906)
For the same geometry (and mesh), how would the procedure in OpenFOAM be?
- MapFields?! (I believe it is for different geometries...but, needed in case there is a change in the mesh?)

mapFields can also be used for identical geometries. You can specify which parameters you want to copy from your RANS case to your LES case.
OR you simple copy the case and the latest timestep ;) Can work, doesnt have to.

Quote:

- once you've finished modeling the field using RANS, switch to LES and overwrite existing files (from RANS results)?!
If you copy your case or map the final results onto a new case you do not overwrite the results from your RANS simulation.

Quote:

But if you take a non-ideal approach to the problem (fvSquemes, fvSolution), you would have to redo the whole process (RANS -> LES ...)?
For trial&error purposes your RANS simulations should be quick. You do not need the finest refinement or full convergence at a residual value of 1e-6 to check your setup. I'd suggest you figure out your schemes and solution settings first. If you have a stable model, make a save of your case.
If your RANS is fine, you shouldnt need to much adjustments to make your LES run. And if RANS is fine, you will only need to tweak your LES, not both.

Santiago January 11, 2018 04:18

How would you get a turbulent flow in OF with only a RANS field? You need means to trigger instabilities.

RobertHB January 11, 2018 04:29

Quote:

Originally Posted by Santiago (Post 677665)
How would you get a turbulent flow in OF with only a RANS field? You need means to trigger instabilities.

How about having a high Re flow and a long simulation runtime? Or inducing the turbulence using perturbU or the turbulentInlet boundary condition. Having a solid object in your domain can cause turbulence behing/around your object.

Santiago January 11, 2018 04:46

1. Having just a high Re doesnt guarantee obtaining a turbulent field. In an error-free numerical solver, an initially laminar Poiseuille flow with Re*=1000000 will stay laminar, unless you introduce an instability.

2. Having obstacles in the flow may or may not trigger turbulence. It depends on many things. Besides, it may triggers turbulence in the wake generated by the blockage.

3. You could perfectly perturb a potential field with perturbU, if youre modelling wall bounded channels. I dont know whether extrapolating this method to any sort of flow will render useful. I remember that perturbU is an implementation of the work of Schoppa & Hussain, which provides an unstable mode for channel flows.

gu1 January 11, 2018 16:30

Hi,
 
Quote:

Originally Posted by RobertHB (Post 677569)
mapFields can also be used for identical geometries. You can specify which parameters you want to copy from your RANS case to your LES case.
OR you simple copy the case and the latest timestep ;) Can work, doesnt have to.

If you copy your case or map the final results onto a new case you do not overwrite the results from your RANS simulation.

For trial&error purposes your RANS simulations should be quick. You do not need the finest refinement or full convergence at a residual value of 1e-6 to check your setup. I'd suggest you figure out your schemes and solution settings first. If you have a stable model, make a save of your case.
If your RANS is fine, you shouldnt need to much adjustments to make your LES run. And if RANS is fine, you will only need to tweak your LES, not both.

Thanks Robert.

I've been trying to do what you mentioned, I do not know if it's ''working''. I start the field in RANS (steadyState - simpleFOAM) and later make a copy of the folder with the intention of starting the simulations in LES (pisoFOAM). That is ... the folders generated are: 100, 200 (simple), ..., 0,01; 0.02; ... (piso). I get the convergence of my model in RANS, but unfortunately I'm not getting success in LES. I've attached my file, I hope you can advise me.

pipe_internal_flow

RobertHB January 12, 2018 03:37

Hello gu1,
i cant run your case as there is no blockMeshDict included. As such i cant run your simulation.
If you can run your RANS simulation, thats a good start.
1) Now make a new folder for your LES and copy only the 0, constant and system folder.
2) Make your changes to the turbulenceProperties, fvSolution and fvSchemes files to set up a LES simulation.
3) Inside your LES folder create a folder called 300* (*or the name of your last RANS timestep if it doesnt run to 300).
4) Find out which 0/ files (U, p, nut) are used by your RANS as well as your LES simulation.
5) Inside your LES case copy these files from 0/ to 300*/.
6) Change your start time to 300* and run mapFields to map your RANS results to your LES case.
7) Move the mapped files back to 0/
Now your RANS results are used as a starting point for your LES case.

If you still struggle with your LES simulation, please provide me with a complete, unmeshed, case. As written above, i cant do alot with single files.

gu1 January 12, 2018 07:31

Thanks
 
Quote:

Originally Posted by RobertHB (Post 677819)
Hello gu1,
i cant run your case as there is no blockMeshDict included. As such i cant run your simulation.
If you can run your RANS simulation, thats a good start.
1) Now make a new folder for your LES and copy only the 0, constant and system folder.
2) Make your changes to the turbulenceProperties, fvSolution and fvSchemes files to set up a LES simulation.
3) Inside your LES folder create a folder called 300* (*or the name of your last RANS timestep if it doesnt run to 300).
4) Find out which 0/ files (U, p, nut) are used by your RANS as well as your LES simulation.
5) Inside your LES case copy these files from 0/ to 300*/.
6) Change your start time to 300* and run mapFields to map your RANS results to your LES case.
7) Move the mapped files back to 0/
Now your RANS results are used as a starting point for your LES case.

If you still struggle with your LES simulation, please provide me with a complete, unmeshed, case. As written above, i cant do alot with single files.

Hi Robert, thank you for your patience.

My case with mesh:
CASE

I believe that based on the settings (Allrun) I created for my case, your recommendations are being made (at least I hope, if not, please ... help me), except for mapFields (whose I do not know how to do ).

I'm following some recommendations about 'dissipative terms' in fvSchenes, so I've tried using LUST. I still have not figured out if it's a good choice.

RobertHB January 12, 2018 09:02

Hey gu1,
i started your case and i will let it run over the weekend. I'll come back to you next week.

RobertHB January 12, 2018 09:31

Quick feedback. Solution is converged. Copying and mapping the RANS onto the LES case wasn't a problem. LES simulation runs fine at Co = 0.24.
Residuals @ convergence:
Code:

# Time          p                Ux              Uy              Uz              k                omega     
2020            2.676000e-06    9.205660e-07    8.977710e-06    7.257140e-06    4.958210e-06    4.850250e-08

Where ist the problem?? :)

gu1 January 12, 2018 10:38

1 Attachment(s)
Quote:

Originally Posted by RobertHB (Post 677866)
Quick feedback. Solution is converged. Copying and mapping the RANS onto the LES case wasn't a problem. LES simulation runs fine at Co = 0.24.
Residuals @ convergence:
Code:

# Time          p                Ux              Uy              Uz              k                omega     
2020            2.676000e-06    9.205660e-07    8.977710e-06    7.257140e-06    4.958210e-06    4.850250e-08

Where ist the problem?? :)

OMG. I did not understand anything, seriously. KKK
Were you able to converge the simulation on LES ?! HOW ?! I've been trying for weeks, believing my setup was flawed. Yesterday, using this same setup, I could not. I did not do mapFields ... but ... please teach me (if possible attach the case that converged with you) !!

Just one question, using the Smagorinsky model, the log (pisoFoam), does not display the values of 'k', 'omega' ... So I did not understand what you had attached (led me to believe you were talking about RANS ).

My RESIDUAL in LES is attached in the image.

RobertHB January 12, 2018 12:00

Hey gu1,
that is in fact the convergence data for the RANS simulation. The LES is running and i will post my results on Monday. But it started without problems after mapping the data from the RANS case. The code snippet is from the residual data your RANS simulation writes to the folder "postProcessing". The simulation converged to a residual value of 1e-6 after 2020 iterations.

gu1 January 12, 2018 12:26

Okay. I'll continue my attempts to understand my problem and find a solution. I look forward to your contact.

RobertHB January 15, 2018 04:25

Hey gu1,
feedback as promised. The LES simulation finished over the weekend, and here are the (residual) results:
https://ibb.co/kcCnhRhttps://image.ibb.co/hBaUwm/Residuals_png.png
Certainly not perfectly converged, but i'm not even sure if that is to be expected during an transient simulation.
You can download the case file HERE. I've uploaded it to the cloud storage of my university ("seafile.zfn.uni-bremen"), as it was to large for the attachments. The upload contains the case, the postProcessing folder as well as the last timestep, 0.24 s.

/edit: Heres another explanation on how to use mapFields: How to mapFields @ cfd.online
https://www.cfd-online.com/Forums/da...AAAElFTkSuQmCC

gu1 January 16, 2018 07:36

Thanks
 
Quote:

Originally Posted by RobertHB (Post 678112)
Hey gu1,
feedback as promised. The LES simulation finished over the weekend, and here are the (residual) results:

Hi Robert,

I believe that mapFields led you to have better results than mine, in the same setup (see the image I attached in the post above - of my redisual). I'll do other tests. By the way, do you believe that there is a need for modifications in the setup? According to your experience ... your opinion would be of great help.

RobertHB January 16, 2018 08:51

1 Attachment(s)
Hey Gui,
the only "modification" i made was running the RANS case with my fvSolution dictionary (s. attachments) because it provides convergence for my, more complicated, cases. And then running mapFields.
For the LES simulation i used the files you provided in the download. So, for the moment, i don't see any necessary changes you should make.

gu1 January 16, 2018 10:04

OK
 
Quote:

Originally Posted by RobertHB (Post 678317)
Hey Gui,
the only "modification" i made was running the RANS case with my fvSolution dictionary (s. attachments) because it provides convergence for my, more complicated, cases. And then running mapFields.
For the LES simulation i used the files you provided in the download. So, for the moment, i don't see any necessary changes you should make.

OK... I'll get in touch as soon as I finish some tests. About mapFields ... I just need to run it once, or whenever I make modifications to the LES files, do I need to run it again?

RobertHB January 16, 2018 10:07

Whenever you create a new mesh, e.g. run blockMesh: yes.
For changes to e.g. turbulenceProperties, fvOptions, fvSchemes, fvSolution: no.

gu1 January 16, 2018 10:44

mapFields
 
Quote:

Originally Posted by RobertHB (Post 678336)
Whenever you create a new mesh, e.g. run blockMesh: yes.
For changes to e.g. turbulenceProperties, fvOptions, fvSchemes, fvSolution: no.

I have one more question: According to the 'User Guide':

"First, we say that the data is mapped from the source to the target. The fields are deemed consistent if the geometry and boundary types, or conditions, of both source and target fields are identical. The field data that mapFields maps are those fields within the time directory specified by startFrom/startTime in the controlDict of the target case."

mapFields <source dir> -consisten
t

So, I would not need to use mapFieldsDict
Right?


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