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/)
-   -   Weighting scheme for U (https://www.cfd-online.com/Forums/openfoam-solving/233620-weighting-scheme-u.html)

Tibo99 February 4, 2021 09:13

Weighting scheme for U
 
2 Attachment(s)
Hi everyone,

Since I try to simulate an ABL and U varies in a highly non-linear manner, I would like to implement an other interpolation scheme from the one OF use, which usually linear.

For evaluating its face value, I was thinking using the follow weighting function apply on the explicit term of the Reynolds stresses and presented in attachment.

My questions are:

1)Where I can find in the code the linear scheme OF use in order to change it for this one?

2)Is it possible to change the interpolation scheme in the 'fvSchemes' file for one close to the one I presented in attachment(instead of changing the code itself)?


Thank you very much for your answer!

Best Regards,

Tobermory February 4, 2021 11:15

Dear Rene

you probably need to be a bit more explicit about which terms you are trying change the interpolation scheme for. Note that the finite volume method is based on the underlying assumption that variables vary linearly across the cell. Interpolation schemes are then used to map the cell centre values to face centre, for use with the fluxes (eg advection). Interpolation is also used elsewhere, though, so be careful.

You can find the schemes by diving into the doxygen source listing, eg start at:

https://cpp.openfoam.org/v8/dir_4df5...0d9ef5fe1.html

and then dive into the schemes folder and you'll see a linear folder:

https://cpp.openfoam.org/v8/src_2fin...linear_8H.html

I am intrigued why you want to improve the interpolation for an ABL though - it's a very high Re# flow, with typically a large wall-adjacent cell size ... so the gradients shouldn't be too strong even close to the ground. Or are you trying to integrate to the wall?

Tibo99 February 4, 2021 12:13

1 Attachment(s)
Thank you very much for replying!

I'm adding factors for correcting discretization errors. It's presented in the following paper:

https://onlinelibrary.wiley.com/doi/....1002/fld.2709

This also correcting the 'peak' happening from the 2nd cell on the profile 'k'.

I successfully implement the factors involved on the transport equation.

But, two other factors need to be apply on the field U, which I struggle to implement. This one here is one of them.

Thank again!

Best Regards,

Tobermory February 5, 2021 06:24

Aah - I understand now - I had not seen this paper before (in fact you can find Sumner's thesis on line as well). Interesting to see his analysis of which of the discretisation terms is having the biggest contribution to the anomolous k spike, and interesting that a small imbalance can have such a large effect.

One thing that confuses me, however, is why the surface layer approximation is used so often in CFD simulations, with domain depths of 500m or more, when the surface layer is only a theoretical asympote that applies only to the bottom 10% or so of the boundary layer, ie the bottom 100m or less. Why not simulate the real ABL, with a vertical profile of TKE instead of using the coarse assumption that k is constant?

Tibo99 February 5, 2021 09:17

Indeed, I agree with you that is interesting how such a small detail has a tremendous impact.

Since the only two factors I still not implemented are on the field ‘U’, that would probably explain why the ‘nut’ and the ‘velocity’ profile are not close to the analytic results compare to the ‘k’ and ‘epsilon’ profile.

I’m trying to implement this first and let see where I’m going after.

Thank for the discussion!

Best Regards,


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