CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   xPlus utility (https://www.cfd-online.com/Forums/openfoam-post-processing/158194-xplus-utility.html)

syavash August 18, 2015 06:36

xPlus utility
 
Dear Foamers,

Is there any utility developed for calculating xPlus and zPlus in a LES simulation?!

Thanks,
Syavash

wyldckat August 18, 2015 10:48

Quick question: Can you please provide more details on what are you talking about?
In other words: What are "x+" and "z+"?

syavash August 18, 2015 14:01

Quote:

Originally Posted by wyldckat (Post 560039)
Quick question: Can you please provide more details on what are you talking about?
In other words: What are "x+" and "z+"?


Hi Bruno,

You make me ashamed of myself!!
By x+ I meant a cell streamwise grid spacing, non-dimensionalized by friction velocity and dynamic viscosity. Maybe I should have named it deltax+.
It is just like deltay+ except in spatial direction.
I need to evalute my grid spacings to compare with literature in terms of x+ and z+ distribution on the wall.

Syavash

-----

A good starting point may be yPlusLES utility, but I cannot manage to find how to consider streamwise grid spacing instead of wall normal spacing.

wyldckat August 18, 2015 14:28

Quick answer: Mmm... sorry, I was expecting something more related to LES modelling, perhaps something related to the filters or something like that... hence my question.

The problem is that the "x" and "z" measurements can't be easily done generically:
  • The "y" value is the distance of the centre of the face on the wall to the centre of the cell, which are both well defined.
  • The remaining dimensions would possibly have to rely on the bounding box of the cell, i.e. to create the minimum and maximum measurements for all vertices of each cell, but in the coordinates of the flow.
This to say that its probably why there is not yet such a utility that calculates this for OpenFOAM.

Either way, you can draw some calculation ideas from the solver "applications/solvers/incompressible/boundaryFoam".

delsolman May 14, 2021 16:25

Hello everyone...is there some possibility to make it happen?
Could be somehow computed the distance between two nodes in x- y- z- direction?

I mean it is not necessary to define stream and spanwise. This can be understood by user from geometry arrangement.

But anyway those node distances would be very helpful to estimate appropriate mesh resolution by LES.

Thank you :-)

HPE May 15, 2021 14:52

Hi,

I think you can use the writeCellCentres function object to obtain the position vectors of the cell centres in a given coordinate system.

Then, you can convert them from physical units to wall units (i.e. +) by scaling the position vector elements by the value of (delta/nu). e.g.

x^+ = (x * uTau)/nu = x * scaleFactor

where

uTau is the magnitude of the friction velocity which becomes constant for a fully-developed flow (e.g. downstream of a plane channel flow), and nu is the constant kinematic viscosity (for incompressible flows).

I think you can use the multiply function object, a coded function object or an external utility to do the elementwise multiplication by using the scaleFactor. (or hopefully one day with the expression function object).

If you want to obtain x^+ field for a subset of cells inside the domain (e.g. only the first cells adjacent to a given patch), you can then use one of the topoSets (link) to get the required cells. (e.g. patchToCell or my favourite haloToCell).

I hope I didn't misunderstand you.

Hope these help.

delsolman May 21, 2021 17:03

Hello Herpes free... thank you for your replay :-)
Can you clear me this please: When I use this writeCellCentres function, then I get dependent on the position of my coordiate system, right?

But I would like to have the delta-value, that means, the difference between nodes of neighborhood cells... as the people above said.

Is there some possibility to modify this function to get this please? It should be also divided by direction.

Another way would be using delta, what means here the volume of the cells, but somehow determine the face length in each direction... Would be something like that possible please?

Oh, I am not the first guy who want to control my LES... :-)

syavash May 22, 2021 05:53

It's been a pretty long time since I asked the question.

For simple configurations like channel flow or flat-plate boundary-layer, the streamwise spacing is usually constant. It's pretty straightforward to calculate x+, having u_tau distribution along the wall.

For more complex configurations such as airfoil, the trick is using cell volume in conjunction with the cell wall distance. Assuming a constant spanwise spacing:

dx=cell_volume/(dz*2d),

where d refers to the cell wall distance. While having dx, x+ can be calculated in a similar way to y+:

dx+=dx*u_tau/nu

A separate utility can be constructed accordingly based on y+ utility which was present in foam older versions.

I hope this will help to clear some doubts.

Bests,
syavash

delsolman May 22, 2021 16:51

Hey Ehsan... I refer to your sentence:
"By x+ I meant a cell streamwise grid spacing, non-dimensionalized by friction velocity and dynamic viscosity. Maybe I should have named it deltax+."

so let me clear the convention:
x+ y+ z+ means dimensionsless distance of cell node to the wall. It could be very high for example in the middle of the channel flow.

x y z dimensions between cell node and the wall. By the channel flow (if x is stremwise) makes x no sence

deltax+ deltay+ deltaz+ are dimensionsless dimensions between two neighborhood cell nodes
...am I right please?

Those delta values are inportant to determinate a proper LES mesh without wall function.
You can find in literature recomended values: deltay+ = 1, deltax+ = 50 (100), deltaz+ = 20

So...I have unstructured snappy hex mesh and I want to check everywhere in the domain my grid spacing in all three directions (not only cell_volume / 3) value

syavash May 23, 2021 02:59

Yes, dx+, dy+, and dz+ are defined based on the distance between two neighboring cells. But note that y+ is calculated commonly based on half cell height in the wall vicinity.

You are correct in the sense that dx+ should be used instead of x+. Hence, I should modify the relationship in my previous post. However, "y+" notation is commonly used in literature instead of dy+/2 (wall vicinity).

In general, these dimensionless parameters are used to address mesh spacing in vicinity of the wall. Away from the wall, other criteria are employed to assess the mesh resolution.

As for snappy, I have not used it for LES so far, so I may not be able to give recommendations.

Bests
syavash

delsolman May 24, 2021 13:19

OK, we can talk briefly about the theoretical background...
y+ dimensionless normal wall distance is important by high Re and low Re models:
- by low Re model is the viscous sublayer integrated to the wall, so one have to go with grid spacing to y+ = 1
- high Re model uses wall function which takes the value from log law and approximate the viscous sublayer. Because of that the first cell has to lay in log low, let's say y+ > 30.

This is only one part of the story...
When one generate the mesh, the RANS model is not sensitive to long cells in streamwise direction. So only what cares is y+

But by LES is mesh the filter between solved and modeled part.
- so one have to care about the mesh resolution
- of course one can check k_unresolved / k_total: Pope said that 80% has to be solved...
- my idea was to control the mesh resolution by delta_x, delta_y, delta_z in each direction separately and so better react
- with CFL can be adjusted the time step
- delta/eta tells how times bigger vortexes than kolmogorov could my captured by the grid.


All times are GMT -4. The time now is 04:59.