ladybug-tools / butterfly

:butterfly: A light python API for creating and running OpenFoam cases for CFD simulation.
http://ladybug-tools.github.io/butterfly.html
GNU General Public License v3.0
246 stars 70 forks source link

Extracting Solutions of Free Surface Only #263

Open lucadvn opened 7 years ago

lucadvn commented 7 years ago

Hi I am working on the optimization of an airplane wing. The idea is to run a gradient based optimization which aims to minimize the L/D ratio of the wing. In order to do this I need to extract the force vector created by the fluid traveling, with fixed initial velocity, around the airfoil. I was able to run OpenFOAM using butterfly in grasshopper, and able to write the p and U file. I now need to extract the values of these two variables around the airfoil only so I can integrate over the volume around the airfoil to get the force vector. Is it a good way of doing this? Could I get the Force vector directly from OpenFoam. How is the mesh and solution related in the solver?

Thanks in advance for your help and support

Luca

lucadvn commented 7 years ago

This is an image of the velocity vector field. I am also having trouble visualizing the P field on this 2D plane. Is there a tutorial that explains how to do 3D visualization directly from grasshopper??

image

mostaphaRoudsari commented 7 years ago

Hi @lucadvn, I think I cover both of them briefly in the tutorials. Also see this example on Hydra. You can always sample the case afterwards.

Not sure about the force vector. @TheodoreGalanos knows better.

lucadvn commented 7 years ago

Hi Mostapha I see you cove part of the visualization on the tutorial videos but I haven't found anything related to extracting the solution values only at the free surface. Is this something that is possible from within GH?

Hope @TheodoreGalanos can give me an insight on how to generate the force vectors :D

Thanks again

TheodoreGalanos commented 7 years ago

Hi @lucadvn

You can actually extract that directly from OF using function objects. Check here for example: http://www.openfoam.com/documentation/cpp-guide/html/group__grpForcesFunctionObjects.html

For eg. the forces function calculates this on specific patches or surfaces. I feel you can make it work through BF, by the custom function object input.

Let us know how it goes.

Kind regards, Theodore.

mostaphaRoudsari commented 7 years ago

@lucadvn did you get it to work using @TheodoreGalanos's suggestion?