CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Specifying a prescribed velocity inlet (https://www.cfd-online.com/Forums/openfoam/240494-specifying-prescribed-velocity-inlet.html)

SadBoySquad February 9, 2022 06:40

Quote:

Originally Posted by Tobi (Post 821937)
So yesterday I was thinking about a new implementation. Its not straight forward and tricky. So lets see if I can get some code-snippet work.
The main problem is, that we can apply the condition to x-y-z coordinate and hence, a more reliable logic needs to be applied here. Furthermore, the search of the lowest "coordinate" for each face is not straight forward either.

I know, it is kinda hard to set it up in a way that works on all possible cases.

The way I tackled it (in an in-house solver) was the following:
-- Read the inflow patch
-- Define zAxis direction for the atmospheric BL, along with other required atm BL properties (kinda like what OpenFoam requires)
-- In addition, define a desired tolerance for the local ground level search algorithm.
-- For each inflow face, search through all other inflow faces and find the one that has the lowest zAxis coordinate while also satisfying the given tolerance.
-- The tolerance is defined as the projected distance on the XY plane (i.e. excluding the zAxis direction)
-- The tolerance can be set on a per mesh basis, since it depends on mesh spacing

This algorithm is crude and not particularly fast (N^2 calculations), however it can find the local ground level given a suitable tolerance.
Even if it does not find the directly below ground face, the errors in atmBL calculation would not be that significant.


All times are GMT -4. The time now is 19:06.