# Computational fluid dynamics – Wind tunnel

Author:

Categories: Tutorials

Tagged with: | | | | | | |

Idea – Main Goal

If you thought that aerodynamics are something that only aerospace engineers can calculate on a NASA million-dollar budget high-tech computer, then this post will blow your mind. The main goal of this tutorial is to explain how computational fluid dynamics (CFD) can be utilized, analyzed, and translated to urban situations in Prague. Therefore, a plug-in was needed, and I chose Ladybug’s Butterfly, available for free on Food4Rhino. The installation process is tricky, and I recommend watching a YouTube video and reading everything carefully.

Here are the plug-ins I used:

https://www.food4rhino.com/en/app/pufferfish

Step One:

To make an analysis possible, we first have to set up our script, which I will explain step by step on some basic shapes that I created in Rhino. First, we set them as Brep in Grasshopper. Then, we use further components to set up the area of the wind tunnel we want to create. An important note for the Butterfly plug-in is that every input with an underscore (_) at the start is mandatory for it to work. Every input with an underscore at both the start and the end is mandatory but has a default value. Every input with an underscore at the end is optional. We always need to connect a toggle to the “write“ and “run” and turn it on when everything is set.

Step Two:

We create a block mesh on the wind tunnel. The cell size can be manipulated and will make the mesh denser the lower it is.

Step Three:

We create a SnappyHexMesh around the Breps we put inside the wind tunnel. The global refinement level will be higher if we increase the two numbers, making our mesh more precise. Due to long calculation times, I kept it at 1, 1. The SnappyHexMesh is important for the plug-in to recognize our objects. We can always connect the load mesh component to any case output to visualize the results.

Step Four:

To get a final result, we need to define probe points where we want to test the wind speed. For this, I created four different approaches. Two of them use the Populate component to receive randomized point fields in 2D or 3D. We can also do organized point grids in 2D and 3D as shown in the other two cases, but for simplicity, I used the generate point grid component from the Ladybug plug-in, which needs a Brep (I set it as a plane). We then have to sort out all the points that are inside the main Breps. If we don’t do this, the program will try to calculate these values, resulting in extremely high numbers that would influence our final list. The invert Boolean component from the Pufferfish plug-in helps us to select these. Now we connect our final points to the following Butterfly components. Setting the fields as “U” will tell the program to calculate the wind velocity in m/s. The website provides a wide range of other units, such as the kinetic force that the program can calculate. With the control dictionary component, we can adjust the calculation time and the writing interval to shorten the calculation process. To receive a recipe for the final solution, I used the default turbulence model.

Step Five:

To receive the final product, we use the solution components. To display the vectors in a colored pattern, we define one length that we want to see and use the different lengths to set up the domain for the color range. If not all the points inside the Breps were eliminated, we sort the list and check on a panel what the actual limit should be and set the upper limit manually. The following script shows a method to turn the vectors into arrows made of pipes and cones for optional baking, which I decided not to use due to performance issues.

Step Six:

To get the data that refers to real-world weather, in my case from Prague, I used the Windrose component from the Ladybug plug-in. We can also set up a custom legend to showcase the collected data from our experiment.

Result:

At first sight, we can immediately conclude how the simple shapes I used for the example react to wind. A teardrop-shaped building seems to have minimal resistance and lets the wind keep its speed and direction. An arrangement of funnel-like buildings collects a lot of wind and accelerates it more the tighter the corridor gets. We can also see a minimal diffusion at the end of the buildings. A perpendicular setup of buildings slows the wind drastically behind them and results in low-speed vortices. Analyzing the 3D results, natural wind seems to increase in speed the higher it gets.

Case Study Prague:

To showcase the use and further analysis of CFD in Grasshopper, I chose two public squares in Prague: the CVUT campus square in Dejvice and the Old Town Square. Prague has an average windspeed of 12 m/s, mostly towards the west. From an urban perspective, these two locations are very different when it comes to building density. This has a visible influence on the velocity. Open surfaces in Dejvice don’t slow down the wind and allow the few corridors to accelerate it very easily. The rounded edges of the library have a similar effect as the teardrop building from the previous experiment – fast wind reaches the public square more easily due to less resistance. The Old Town Square is surrounded by very densely placed buildings. The corridors are tight, rarely in the same direction as the wind, and not linear. Therefore, the public square is protected from high wind speed.

Conclusion:

To summarize the work with Butterfly in Grasshopper, it has many good analytical values and can help architects, planners, engineers, or product designers to get a first impression of the aerodynamics of their designs. Especially from a planner’s perspective, it is a great tool to get a different view on how the shape and location of buildings in our environment influence the wind and therefore the outdoor comfort. But since Butterfly is a free-to-use plug-in, I don’t think the results are 100% accurate and wouldn’t base important designs and real-life decisions on it. Also the run time can be very long depending on the power of the computer that you’re using and the scale of the model.

Documents: