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/)
-   -   Using LEMOS turbulence inflowGenerator in 2 perpendicular inlets (https://www.cfd-online.com/Forums/openfoam-solving/230265-using-lemos-turbulence-inflowgenerator-2-perpendicular-inlets.html)

Dreoasteh September 16, 2020 03:06

Using LEMOS turbulence inflowGenerator in 2 perpendicular inlets
 
1 Attachment(s)
Hi everyone,

I've been succesfuly working with the synthetic eddy method bourndary condition to generate a realistic boundary condition in LES simulation from the LEMOS group at Rostock Uni.

If someone is not aware of it, it is called decayingTurbulenceInflowGenerator and works really well for generating turbulent inlets for LES (you can find it here: https://github.com/LEMOS-Rostock/LEMOS-2.4.x).

So the thing is, it works like a charm if you only have one inlet. The boundary condition is hard coded to generate turbulence only in the +x or -x direction, so you have to rotate your mesh in such a way that the turbulent inlet you want to use is in that direction. However, I am now simulating a case with two perdendicular inlets (one in the x-direction an the other in the y-direction, something similar like the image attached). So, currently I can only choose to have one of the inlets turbulent while the other has to remain laminar. This is quite bad and I would need to fix it so that both inlets are turbulent.

Can anyone provide me with some guidance as to how to do this? I tried compiling a modified version of the LEMOS condition but hard-coding the y direction instead but I was not able to do so.

Thank you!

cryabroad September 18, 2020 07:55

I use this B.C. quite often, I would think that modifying it is not easy, there are many details one has to pay attention to. For example, the Lund transformation may need to be changed accordingly. The math can be hard due to all the tensor manipulations.

Have you considered other B.C.s? I think there are other types of synthetic boundary conditions. Also, Eugene's thesis might be helpful ("The Pothential of Large Eddy Simulation for the Modeling of Wall Bounded Flows"). His way of generating disturbances in the flow may be something to explore. Additionally, what about the default turbulentInlet? Your flow is internal, where the turbulence is generated mainly due to walls. If the mesh is fine enough maybe turbulentInlet works well.

If you download OF from openfoam.com, it comes with a turbulentDFSEMInlet B.C., and I don't think it has a direction limitation. I've never used it so I can't provide more details.

By the way, when using LEMOS, what is the length scale you use? I normally put 7% or 10% of the piple diameter there. And what about the Reynolds stress?

Ruiyan

Dreoasteh September 18, 2020 12:47

1 Attachment(s)
Indeed, I tried to modify the BC and it was too hard for me, so I dropped that route.

The image was not quite my setup just something I found with a quick search online to illustrate my point. I've upload a real representation of my geometry. Bottom line: two inlets, one against the other. One is bigger than the other and the smaller one is coming from a bent pipe. So indeed, the turbulence in the smaller inlet will mainly come from the instability in the bend. Therefore, I could maybe get away with turbulentInlet. Regarding the thesis you mentioned, it could be useful but I can't justify the time it would take to implement a turbulent BC from scratch. turbulentDFSEMInlet could be an option, or even the new digital filter but I need a precursor RANS simulation of a long pipe to have developed turbulence in order to get the U, R and L data with a matching mesh for each inlet. It also looks like too much work and I haven't done precursor sims before.

Regarding LEMOS settings, indeed 10% of the characteristic length scale (i.e. pipe diameter) and R usually has to be higher than I would like to in order to preserve good rms values downstream. Something like 50% is not unlikely but it really depends on the case, the mesh and so on. The best way I've found is to have some validation rms values downstream of the inlet from experimental or DNS and use trial and error to get close. This is a pain as it requires several runs with converged mean values but I haven't found a better way. You?

cryabroad September 19, 2020 09:28

I think Eugene developed a tool for generating the disturbances, search in the forum and you may find it.

As for the LEMOS settings, especially the R field, I used to assume a certain amount of turbulence intensity (e.g., I = 5%) and istropic turbulence, so my R field is uniform and looks like (Rxx, 0, 0, Ryy, 0, Rzz), with Rxx = Ryy = Rzz = 3/2*(Uref*I)^2. This applies when Uref is uniform at the inlet. I know this is not right for sure, but may be a good approximation.

Now what I normally use is a velocity profile (from experiments if there are any, otherwise a 1/7 profile) with a R profile (from experiments, if no experiments then I use the method I mentioned above). I have to say though, different R field seems to give similar results (I test this using a circular pipe). I used to run precursor simulations as well but like you said, they take too much time.

Another way I see some people have done is to add a tube before the inlet, they claim that this allows the turbulence to develop and by the time the flow reaches the actual inlet, you will have a more natural velocity and R field. But then it comes with additional questions, e.g. how long should this pipe be? 5D? 10D? I kind of don't like this idea but it seems to resolve the problem in certain cases.

Dreoasteh September 21, 2020 09:00

I found Eugene's perturbU files but unfortunately it is used to initialize turbulent fields, no to generate turbulent inlets. It's nice to reduce the time it takes a simulation to develop turbulence fully inside a domain but I do not believe this will sustain the turbulence generation as it can only be used previous to the simulation running (i.e. it's not a BC).

I use the same method for R. How do you define the 1/7 velocity profile, with swak4foam? I do it this way.

I have done the "pre-inlet" solution sometimes and I have found it to be the best way to have a natural turbulent field. I agree that the pre-inlet pipe length is a bit arbitrary but above a rather small value (i.e. ~2D) it there is little difference. So just take the smallest possible length that makes it work. A bit of trial and error is required which is not optimal.

Anyway, I went with the stock turbulentInlet with 3% intensity on the pipe bend and LEMOS with also 3% in the bigger inlet. The Re is small so I think it's a good approximation. Let's see how that goes.

By the way, any suggestion for U schemes when just linear gives you troubles? I somethimes use filteredLinear3V with a value os arround 0.1 but just wanted to know what you tipically use.

Dreoasteh September 22, 2020 08:38

Quote:

Originally Posted by cryabroad (Post 783193)
As for the LEMOS settings, especially the R field, I used to assume a certain amount of turbulence intensity (e.g., I = 5%) and istropic turbulence, so my R field is uniform and looks like (Rxx, 0, 0, Ryy, 0, Rzz), with Rxx = Ryy = Rzz = 3/2*(Uref*I)^2. This applies when Uref is uniform at the inlet. I know this is not right for sure, but may be a good approximation.

Wait, shouldn't you drop the 3/2? Let's see:

The turbulence intensity is defined as:

I=\frac{u^{\prime}}{U}

and:

u^{\prime}=\sqrt{\frac{2}{3}k}

where k is the turbulence kinetic energy (TKE). If we substitute the later into the former and re-arrange:

k=\frac{3}{2}(I \cdot U)^2

The TKE is also defined as half of the trace of the Reynolds stress tensor:

k=\mathrm{tr(\textbf{R})}= \frac{1}{2}(R_{xx}+R_{yy}+R_{zz})

If we assume isotropic turbulence, then \mathrm(R_{iso} \equiv R_{xx}=R_{yy}=R_{zz}):

k= \frac{3}{2}R_{iso}

Substituting back this result in the third equation:

R_{iso}=(I \cdot U)^2

So the RField in the LEMOS decayingTurbulenceInflowGenerator boundary condition should be:

Code:

RField          uniform ((U*I)^2 0 0 (U*I)^2 0 (U*I)^2);
Did I miss anything?

cryabroad September 23, 2020 01:40

Seems like you are right! It should be just (U*I)^2 without 3/2, but like I mentioned, I found the R field to be not that important. I have used different levels of I (at least 2%) and found just minor difference in the RMS values, mean values are almost not affected.

I use Matlab to impose the velocity profile. To do this I first use writeCellCentres to obtain the cell centroids at the inlet, then calculate the corresponding velocities for each cell, then put it back into OpenFOAM. This way I have full control of the velocity vector.

I generally use a "pre-inlet" with ~5D to ~10D, but sometimes without it.

I've seen people suggesting linear schemes for U, which is suppose to minimize the numerical viscosity, but I also found it unstable in some cases. Now I tend to use vanLeer, and Gamma scheme as well. I'd say both of them are quite good.

sadsid June 18, 2021 21:33

Hi,

From your discussion I came to know how I can set Rfield. Can you please tell me about Lfield and points/value ? I am trying to use it but I do not know how to obtain these.

Dreoasteh June 19, 2021 05:08

Sure sadsid!

The authors of the boundary condition made a small and not very descriptive PDF, which you can see here.


LField is the integral length scale, in a way the size of the largest eddies that the boundary condition will generate. A simple rule of thumb is 10% of the characteristic length (i.e. pipe diameter in a pipe flow). There is more information about estimates of this quantities in different situations here.

Finally, values is the actual value of the velocity field you want to input through this boundary. You have to just introduce it as a vector in the same way done in the typical fixedValue boundary condition. An example can be seen in the inlet boundary field, here.

Hope this helps!

sadsid June 19, 2021 11:02

Quote:

Originally Posted by Dreoasteh (Post 806424)
Sure sadsid!

The authors of the boundary condition made a small and not very descriptive PDF, which you can see here.


LField is the integral length scale, in a way the size of the largest eddies that the boundary condition will generate. A simple rule of thumb is 10% of the characteristic length (i.e. pipe diameter in a pipe flow). There is more information about estimates of this quantities in different situations here.

Finally, values is the actual value of the velocity field you want to input through this boundary. You have to just introduce it as a vector in the same way done in the typical fixedValue boundary condition. An example can be seen in the inlet boundary field, here.

Hope this helps!

Thank you for your detailed response. It clear my doubts. I further want to know what do you recommend from your experience about the minimum length of lists (L, R, U, Value) to generate vortex with random size and locations at the inlet.


All times are GMT -4. The time now is 03:18.