CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   LES by pisoFoam (IC from simpleFoam's lastest solution & BC for nuSgs) (https://www.cfd-online.com/Forums/openfoam/131348-les-pisofoam-ic-simplefoams-lastest-solution-bc-nusgs.html)

vut March 13, 2014 10:04

LES by pisoFoam (IC from simpleFoam's lastest solution & BC for nuSgs)
 
Hi all,

I use OpenFoam for a couple of time (several weeks only). Please be gentle and slow :)

My task is to simulate a turbulent flow inside an injector via the LES. The solver pisoFoam seems to be suitable for my case study. I have two following questions:



* Do you have idea about the boundary condition for nuSgs at the symmetry plane?

* How can the lastest solutions of RANS (computed by simpleFoam) be imported as initial conditions for pisoFoam?

I mean, inside the folder of simpleFoam's solutions, there are several sub-folders corresponding to different time steps: 50, 100, 150 ...



All your ideas are wellcome. Thanks in advance,

VUT

Crazyman2008 March 13, 2014 10:22

Hey VUT,

I am also a new user to OpenFOAM. I already ran some simulations with RANS models and now I am also trying to switch to LES models. I used the UMean and pMean as initial conditions for my LES model by using the mapFields function. I don't know if you tried that, but maybe you could do the same. You can find some things about mapFields in the Userguide.

About the boundary conditions, I do not know :P

Greetings

edit: i used the mean values and mapped them to form the ICs for my flow for Re 1e6. Uptill now I could not run a full simulation because after a few timesteps, the case diverged. Did you already run a simulation and with what kind of LES properties did you run?

vut March 17, 2014 07:47

Hi "crazyman" :)

I have never run a LES simulation in OpenFoam and I am searching information for a case study.

I'll let you know my setup and result later.

Regards,

VUT

danieldesant March 25, 2014 05:52

Hey Vut,

I'm also a new user and I have the same problem. To begin with, you can see in the motorbike tutorial of pisoFoam. You can find the files which have to be used for the LES simulation.
I'm trying to take advantage of a previous RANS simulation too. I think the things you have to do are the following ones:

-Changing the start Time. Your new startTime will be the latestTime of the RANS simulation.
-Changing the files "fvSolution" and "fvSchemes" which you can find in the motorbike tutorial
-Adding "nuTilda" and "nuSgs" to your latestTime case. These files are not used in a RANS simulation and because of that you will have to add them. This last thing is what I'm not sure about, I will look into it and I'll tell you. But it's sure you have to add some new file to be able to do a LES simulation.

Regards

danieldesant March 26, 2014 11:13

Hello again,

I've managed to do the simulation without FOAM fatal error. As I said, I've used my RANS results to do the LES simulation. These are the steps you have to follow:

- Control dict, changing simulation to pisoFoam and verify you're not going to have problems with your timeStep. I'm using a Courant Number of 0.05, with Co=0.5 my calculation diverged for instance.

- You have to change "fvSchemes" and "fvSolution" as I wrote the other day. The motorbike tutorial files work well.

- You have to add "nuSgs" and "nuTilda" to the startTime of the LES simulation which will be the endTime of the RANS simulation, and in my case I erased "nut".

- If you're running a parallel calcul you will have to add "proc.*", you can find this in the motorbike tutorial too.

- Finally, you will have to change the constant folder too. You must erase the "RASproperties" file and add "LESproperties" and "turbulenceproperties", you can find both of them again in the motorbike tutorial.

-I've also had a problem because my system folder included a "streamlines" file. This file had a calculation of the "k" filed which can't be done when using a LES simulation. So, be careful if you have something like that, because your calculation will stop suddenly when writing the results.

I hope this information can help you

greeting

vut March 26, 2014 11:44

Hi danieldesant,

Thanks for your kind answer.

Just some remarks I obtained after the first simulation (without RANS solution as initial solution for LES):

* In fvSolution, I fixed startTime = lastestTime
* nuTilda is always there but I don't think it is mandatory because an incompressible flow is considered
* nuSgs is the sub-scale viscosity

My LES ran well but I always unable to use RANS solution as initial condition for LES.

In my case study, I have 3 folders:

0/, system/ and constant/

Should I paste the RANS solution (folder 5000/ for example) here?

Hope hearing from you soon.

Best regards,

vut

danieldesant March 27, 2014 04:50

Hi vut,

Yes, you have to paste the RANS solution folder. Sorry, I didn't tell you that. In my case, I ran the RANS simulation and I use the same case for running the LES simulation. But, you have to change the files I told you to manage to run the simulation. And you can write as startTime your 5000 for instance, so you make openFoam take this as your startTime, just in case there is a problem if you write latestTime as startTime.

Greetings

vut March 27, 2014 08:58

Hi Daniel,

It seems OK for me now. I obtained LES results by running pimpeFoam (merged simple and piso algorith(?)). I only know the meaning of this option and no more!

I set BC at the inlet for U as: "referenceField" (by giving an uniform z-velocty) and a "fluctuationScale" = 0.02.

Just two questions:

- What is the meaning of the very "fluctuationScale"? Is it equivalent to turbulence intensity? If that is true, 0.02 means a turbulence intensity of 2%?

- Now, I used a "oneEqEddy" in constant/LESProperties. What should I do if one day I hope changing to another LES model?

Greetings,

vut

aylalisa April 4, 2014 08:22

Hi Vut,

as far as I know:

Different LES models

LES_case/constant/LESProperties

add for example...

Code:

LESModel            dynamicSmagorinsky; //by Alberto Pasquale
 
delta              cubeRootVol;

printCoeffs            on;


//homogeneousDynSmagorinskyCoeffs
//{ 
    //filter simple;   
//}

 dynamicSmagorinskyCoeffs
 {
      filter    simple;
      ce        1.048;
 }

RANS simulation results as initial conditions for LES run

I've copied necessary files from folder (last time step: 2000) .../simpleFoam_Case_RANS/2000/* to folder .../LES_case/0/

add additional files for LES: nuSgs, nut, nuTilda (depending on your LES model, is a damping function necessary or not)


Do you need boundary conditions at a symmetry plane?

Best regards,
Aylalisa

Bernhard April 4, 2014 08:30

LES and RANS simulations require different types of meshes. If you constructed your LES mesh, you can use mapFields to map the solution from your RANS case to your LES case.

Only, explain me why your are going from steady state RANS to LES? The in-between step would be unsteady RANS?

aylalisa April 4, 2014 10:57

Dear Bernhard, Dear Vut,

I've mapped results from a RAS simulation case (last time step) to a LES simulation case with help of
Quote:

mapFields <source dir> -consistent
as described in the documentation.
Later on I read through a thread and one user described that he just copied the files from the last time folder of the RAS case to the 0/ folder of the LES case.

The files (U, p, etc.) of last time step contain internal fields, therefore I thought this proceeding would be fine as well (and I did the same).
startTime in controlDict of target folder could be set to 0 (instead of final time step of source folder).
Is it wrong not to use mapFields <source dir> -consistent and manually copying the files ? Has mapFields more effects??? (Did I make a mistake:confused:)


Where are the solvers Oodles and ChannelOodles? I haven't found them in $FOAM_SOLVERS but read in OpenFOAM Wiki that they are supposed to be used for LES computations.
What is/was the difference between Oodles and, for example, pimpleFoam?

Greetings!
Aylalisa

vut April 5, 2014 05:58

Dear Aylalisa and Bernhard,

1/

Now I can use mapFields to interpolate results from my latest RANS solution to initialize an LES. Thanks for your valuable shares!

The BC at the symmetry plane is also needed. I tried simply "type symmetryPlane".

Just two things:
- The name of folder 0/ which contains boundary conditions is changed to 0.org
- Then I followed your advices. The name of my latest RANS solution is modified to become 0 and some additional files for LES are added. It worked...

2/

The latest RANS solution is preferred to implemented here because it seems more realistic than an initial condition given by user.

Greetings,

vut

Bernhard April 7, 2014 04:05

@Aylalisa

Copying the files is not wrong, but it only works when the meshes and the boundary conditions are exactly the same. mapFields works on dissimilar meshes by interpolating value, and is thus much more useful.

Oodles is an old 1.6 (?) style solver, and replaced bu pisoFoam and pimpleFoam.

vut April 7, 2014 08:32

Dear Bernhard,

Your post is right :)

vut

vut April 25, 2014 04:47

Just one attention one should make:

Do not forget to modify the BC in the files U and p in folder 0/ (latest solution of RANS) !!!

Greetings,

vut

Andy_bm April 6, 2015 10:22

I use oneEddyEq LES model. How to calculate initial conditions for k sgs on inlet?


All times are GMT -4. The time now is 10:55.