CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Find z from given (x,y) on STL file (https://www.cfd-online.com/Forums/openfoam-pre-processing/200851-find-z-given-x-y-stl-file.html)

lebc April 14, 2018 16:32

Find z from given (x,y) on STL file
 
Hi all,

I'm working with a simulation of a wind farm including some wind turbines using the actuator disk model on OF 4.0.

The problem is, as I'm working with a real terrain on a STL file, in order to correctly place the disk I need to know the terrain z coordinate corresponding to a (x,y) location, otherwise the absolute height (terrain height + hub height) would be wrong.

Does anyone have a clue of how to do it?

One way would be to write a code that would read each triangle in the STL and check if the coordinate I have is inside the current triangle, but this doesn't seem to be very effective...

I can't do it manually because this is part of an optimization process, it has to be done automatically.

Kind regards,
Luis


All times are GMT -4. The time now is 07:20.