Model Rocketry

Reference / Paper · 2025

Peak of Flight #644: Computational Fluid Dynamics for Model Rocketry Pt. 3

Read the PDF ↗

Apogee Components' Peak of Flight newsletter, issue 644 (2025-01-28).

Author
Tim Van Milligan / Apogee Components
Year
2025
Type
Reference / Paper
Credit
Apogee Components, Inc. (Colorado Springs, CO) — Peak of Flight newsletter
  • peak-of-flight
  • apogee-components
  • model-rocketry

← Back to the Reference Library

Peak of Flight #644: Computational Fluid Dynamics for Model Rocketry Pt. 3

Apogee Components' Peak of Flight newsletter, issue 644 (2025-01-28).

Issue 644 / January 28th, 2025 Apogee Components, Inc. / ApogeeRockets.com / Colorado Springs, CO Computational Fluid Dynamics for Model Rocketry Pt. 3 Nike Apache Rocket flown by Steve Reigel Pueblo, CO Issue 644 / January 28th, 2025 COVER PHOTO Streamlines in the Rocket Wake within CFD Software FEATURED ARTICLES Computational Fluid Dynamics for Model Rocketry Part 3 by Ken Karbon Part 3 of this article series focused on CFD in Model Rocketry, this article focuses on the software side for running an example rocket CFD simulation. Apogee Components, Inc. 4960 Northpark Dr. Colorado Springs, CO 80918 1-719-535-9335 www.ApogeeRockets.com About this Newsletter You can subscribe to recieve this e-zine FREE at the Apogee Components website: www.ApogeeComponents.com, or by clicking the link here Newsletter Sign-Up Editor-in-Chief: Tim Van Milligan Managing Editor: Michelle Mason Content Editor: Martin Jay McKee Layout Design: Ogden Sikel 2 Would you like to see your launch photo featured in the Peak-of-Flight newsletter? Submit your photo at apogeerockets.com. Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 www.ApogeeRockets.com Computational Fluid Dynamics for Model Rocketry Pt. 3 by Ken Karbon Introduction The previous two articles in this series gave some background and best practices for Computational Fluid Dynamics (CFD) simulation of model rockets. This article will be a software tutorial for setting up and running an example rocket external aerodynamics simulation in the CfdOF workbench within FreeCAD. The software steps and menu selections will follow the analysis process discussed previously, so refer to those newsletters for more detail. Before we begin, the user should have the following software installed and configured: - FreeCAD - CfdOF External Workbench - CfdOF dependencies (Edit > Preferences > CfdOF) - OpenFOAM - ParaView - gmesh - cfMesh - HiSA - Rocket Workbench (not required, but recommended) for building CAD components and parametric automation 3 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 As with any software, installation may or may not be seamless and depends on the computer operating system (Windows, Mac, or Linux). The user should also have basic knowledge of the FreeCAD and ParaView interfaces or previous experience with similar CAD/CAE software. There are in-depth written instructions, forums, and YouTube videos on how to get started with FreeCAD and CfdOF, so those preliminaries will not be discussed here. Step 1. Rocket Geometry Create or import a rocket CAD model in a new FreeCAD file. Make sure the origin of the model is the tip of the nosecone. Figure 1 shows a simple FatBoy model I built using the Rocket Workbench. The diameter is 66 mm, and the length is 320 mm. Note the Workbench pulldown is set to Rocket, and a Rocket menu with all its functions appears in the top ribbon. The ribbon menu will change when a different Workbench is selected. Workbench functions also appear as icon shortcuts. The model consists of three entities, NoseCone, FinCan, and Bulkhead, listed in the tree view. All components must be “Solids” in FreeCAD parlance. One way to check the compliance is to switch to the Part Workbench. Select an entity in the tree and then Part > Convert to solid. A message in the Report view window will indicate if the entity is already a solid. 4 www.ApogeeRockets.com Figure 1. FatBoy CAD model in the Rocket Workbench For ease of CFD setup, all the rocket parts should be joined together in a parent container. Multi-select the rocket entities and then select Part > Compound > Make Compound. Change the name of the Compound to something useful by editing the Label in the data window as in Figure 2. Step 2. Domain & Refinement Volumes Use the Part Workbench to create a cylinder around the rocket representing the computational domain. Part > Primitives > Cylinder. Double click the item after it appears in the tree to see its properties in the Tasks tab. Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Figure 2. Combining Rocket Parts into a Compound Following the size guidelines for an inlet-outlet virtual wind tunnel in the first article, the cylinder Radius is 1.0 m and Height is 3.2 m. Use the Location inputs to position the cylinder about two rocket lengths upstream and to orient the cylinder along the rocket axis. See Figure 3. Figure 3. Create the Domain Cylinder 5 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 www.ApogeeRockets.com In a similar fashion, create three more nested cylinders as in Figure 4. These will be used as mesh refinement volumes. Lastly, the air volume to mesh needs to be defined with an intersection of the domain and the rocket. Multi-select Cylinder-Do- main (first click) and Compound-Rocket (second click) and create another compound with Part > Compound > Make Compound. Rename this as Compound-Fluid as in Figure 5. (Caption for Above) Figure 4. Create Additional Cylinders for Mesh Refinements (Caption for Below) Figure 5. Make a Compound of the Domain + Rocket 6 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Step 3. The Analysis Container Switch to the CfdOF Workbench. Click on the Analysis Container icon. This creates CFD analysis data structures in the tree. See Figure 6. Step 3.1 Physics Model Double click on PhysicsModel to open the task menu in Figure 7. For this example, we will choose Steady, Single phase, Isothermal, Viscous, RANS, kOmegaSST. Everything else is grayed out. Figure 6. CfdOF Analysis Container Step 3.2 Fluid Properties Select Air from the Predefined fluid library as in Figure 8. Keep the default values for Density and DynamicViscosity. Figure 7. Physics Model Figure 8. Fluid Properties 7 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 Step 3.3 Initialize Fields Select Potential flow for both Velocity and Pressure. Keep the default values for k and ω Turbulence as in Figure 9. www.ApogeeRockets.com Step 3.4 Cfd Solver Single click CfdSolver to open its properties in the data tab. Edit the highlighted values as in Figure 10. Convergence Tol sets the residual tolerance and Max Iterations is the maximum iterations the simulation is allowed to run. Steady Write Interval controls how often the field data is written. If you have multiple cores on your computer, set Parallel to true and enter the number of Parallel Cores of your machine. My computer has 4 cores. Purge Write of 2 will keep only the two most recent field data files, overwriting older files as the simulation progresses. It is wise to keep this a small number for steady simulations, as the data will not change much near convergence, and the files are very large. Figure 9. Initialize Fields Figure 10. Solver Settings 8 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 Step 4. Boundary Conditions Step 4.1 Rocket Select CfdOF > Fluid boundary. Choose Wall and No-slip (viscous). In the Select from list tab, check Compound-Rocket as in Figure 11. Rename the Label as wall-rocket. www.ApogeeRockets.com Figure 11. Rocket No-Slip Wall Boundary Step 4.2 Tunnel Side Wall Display the Cylinder-Domain in the model view. Again, select CfdOF > Fluid boundary to create another boundary condition instance. Choose Wall and Slip (inviscid). Move to the Select in model tab. Single click the annular surface of the cylinder to highlight it, then Add. The result should look like Figure 12. Rename the Label as wall-slip. Figure 12. Tunnel Slip-Wall Boundary 9 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 Step 4.3 Inlet Repeat for the inlet. Choose Inlet and Uniform velocity. Single click the inlet face of the cylinder to highlight it, then Add. Choose Magnitude and normal and specify a Magnitude of 100 m/s (about Mach 0.3). Select the inlet face again and Pick to populate the Normal to face box. Check Inward Normal. (Using magnitude and normal instead of cartesian components will help simplify angle of attack simulations in the future.) Specify Pressure as 0.0 Pa. Keep the default values for Turbulence intensity and Length scale. See Figure 13. 10 www.ApogeeRockets.com Figure 13. Inlet Boundary Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 Figure 14. Outlet Boundary Step 4.4 Outlet Repeat for the outlet. Choose Outlet and Static pressure. Single click the outlet face of the cylinder to highlight it, then Add. Specify zero Velocity and zero Pressure. This flow simulation is relative to atmospheric pressure and does not use absolute values. See Figure 14. www.ApogeeRockets.com Step 5. Reporting Function CfdOF > Reporting function creates the parameters to calculate aerodynamic force and moment coefficients on the rocket. Choose ForceCoefficients and wall-rocket from the Patch list. Relative pressure reference should be 0 Pa and confirm that the Center of Rotation is 0, 0, 0. Lift Direction and Drag Direction are given as xyz unit vectors. In my coordinate system, I choose Lift as 0, 0, 1 and Drag is 1, 0, 0. Free-stream flow speed is specified at 100 m/s, same as the 11 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 inlet condition. Reference length for this model is the nose cone diameter, 66 mm. Reference area is the base of the nose cone, 0.00342 m2. The software may change the units in the display for some reason, but they remain dimensionally correct. Calculations and output will be in SI units. Ignore the spatial data binning. See Figure 15. Figure 15. Reporting Function 12 www.ApogeeRockets.com Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Step 6. CFD Mesh Highlight Compound-Fluid in the tree & click the CFD Mesh icon. Select cfMesh and input 80 mm as Base element size in the parameters menu. See Figures 16 and 17. Figure 16. Create CFD Mesh Figure 17. CFD Mesh Menu 13 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 www.ApogeeRockets.com Step 6.1 Rocket Surface Refinement Highlight the resulting Compound001_Mesh then click the Mesh refinement icon as in Figure 18. Select Surface refinement with Relative element size of 0.035 and Refinement thickness of 10 mm. Check Boundary layers. Number of Layers = 4, Expansion ratio = 1.2, Max first cell height = 0.2 mm. In the Select from list tab, check Compound-Rocket. Rename the Label as MeshRefinement-Surface. See Figure 19. Figure 18. Create Mesh Refinement Figure 19. Rocket Surface Refinement 14 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Step 6.2 Volume Refinement CfdOF > mesh refinement to create another instance of refinement. See Figure 20. Choose Volume refinement and Relative element size of 0.075. In Select from list, click on Cylinder-Refine0 and check Solid1. Rename the Label as MeshRefinement-Refine0. - Repeat for Cylinder-Refine1 with Relative element size of 0.3 - Repeat for Cylinder-Refine2 with Relative element size of 0.6 Setup is complete. The model tree should look like Figure 21. Boundary conditions and meshing items are now members of the Analysis Container. Double click any element to edit its properties. If circular arrows appear next to any element in the tree, hit the Refresh button. Figure 20. Volume Refinement Figure 21. Completed Setup 15 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 Step 7. Running the Simulation Define the directory where the simulation files will be written by giving the Default output directory in Edit > Preferences > CfdOF. See Figure 22. www.ApogeeRockets.com Figure 22. Output Directory Step 7.1 Generating the Mesh Double-click Compound001_Mesh to open its parameters menu in Figure 23. Click Write mesh case. After the mesh case is written successfully, click Run mesher. Watch for any error messages in the Status window. This mesh ran in 1 minute on my computer. Figure 23. Writing and Running the Mesher 16 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Figure 24. Load Surface Mesh When the mesh is complete, click Check Mesh to go through some quality measures and to display mesh information. Click Load surface mesh. This will create a mesh entity in the tree containing the external nodes and elements. Put the Draw Style in Wireframe mode so that you can visualize the rocket and domain external mesh as in Figure 24. For more through viewing of the mesh, especially the internal cells, click on ParaView. ParaView software should launch automatically and load the model. It also generates a Filter called ExtractCellsByRegion1. Intersect this as Plane with the Y_Normal and hit Apply. This will allow you to visualize the internal mesh cells as in Figure 25. If the mesh does not look as intended, go back and edit mesh properties before running the solver. Figure 25. Visualize Interior Mesh in ParaView 17 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 Step 7.2 Run the Solver Double-click CfdSolver as in Figure 26. Click Write to write the case files, then Run the solver. Monitor the progress in the Status and Report view windows. During the run, two tabs will appear. One plots the Simulation residuals, and the other plots the ReportingFunction of CD and CL. Use these plots to determine how well the solution is converging. This example converged based on residuals in 749 iterations and took about an hour on my machine. The CD and CL results www.ApogeeRockets.com are leveled-out and of the proper magnitude, so the simulation looks good. Step 8. Post-Processing Results Step 8.1 Force and Moment Coefficients Navigate to <output directory>/<case directory>/postprocessing/ ReportingFunction/0. In this folder will be a file called coefficient. dat that contains force and moment coefficients vs. iteration time. This file can be plotted in Excel or similar software. Step 8.2 Flow Visualization In Figure 26, click the ParaView button and the software should launch and load the model into the Pipeline Browser. Click on OpenFOAMReader1 and ensure that internalMesh and patch/ wall-rocket are checked to activate. Remember to always hit Apply when finished. See Figure 27. Flow visualization and processing with ParaView is nearly unlimited in scope, and there are many powerful techniques. I will cover just a couple examples, but they will show the general method for creating other visualizations. The key thing to distinguish is the internal mesh/fluid vs. the rocket walls. Some aerodynamic functions are applicable to only one or the other, so it is important to separate the model into these two factions. Also, note that elements in the Pipeline Browser follow a parent and child relationship. Figure 26. Writing and Running the Solver 18 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Figure 27. CFD Model Loaded into ParaView 19 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 Figure 28. Extract Blocks. Fluid (left) and Rocket (Right) Click on OpenFOAMReader1 as the parent and then go to Filters > Alphabetical > Extract Block. Check internalMesh & Apply. This extracts the internal fluid cells into a child element. You can highlight the name and edit it to something more meaningful. 20 www.ApogeeRockets.com Repeat the process, this time extracting the wall-rocket block. See Figure 28. Now the fluid can be visualized with a 2D-slice as in Figure 29. Highlight the fluid block as the parent and click the Slice icon. Click Y_Normal and Apply. Color the slice by U (velocity) and Magnitude. The eyeball icon next to each element in the browser controls its visibility. Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 www.ApogeeRockets.com Now we can work on the rocket. It should be colored by pressure by default. However, in the world of fluid mechanics, most data are non-dimensionalized. So, let us calculate pressure coefficient, Cp. Highlight the rocket block as the parent and click on the Calculator icon as in Figure 30. Change the Result Array Name to Cp. Enter the formula for pressure coefficient on the line below and Apply. Note that incompressible OpenFOAM normalizes the pressure field by density, so density can be omitted from the denominator of the calculation. Lastly, we will go back to the fluid and compute velocity streamlines through the domain. Highlight the fluid block as the parent and click the Stream Tracer icon. Choose Point Cloud as the Seed Type. You can position the emitter sphere with the mouse or type in the Center and Radius boxes. Position a smallish sphere behind the rocket. This will generate traces in the recirculation zone of the rocket wake. Initially choose a small Number Of Points, say 50-100. Apply. See Figure 31. Figure 29. Create Slice Through the Fluid Colored by Velocity Magnitude 21 Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 / January 28th, 2025 (Above) Figure 30. Calculating Pressure Coeff. on the Rocket 22 www.ApogeeRockets.com (Below) Figure 31. Setting Up the Stream Tracer Computational Fluid Dynamics for Model Rocketry Part 3 Issue 644 /January 28th, 2025 When the traces are done computing, uncheck Show Sphere and visualize the complex 3D flow pattern as in Figure 32. Conclusion This completes the tutorial in creating and running a CFD simulation in FreeCAD. The CfdOF Workbench makes it easy to step through the OpenFOAM CFD setup procedure with an intuitive GUI. For further information, and to stay on top of the ongoing development of the software, visit the FreeCAD discussion forum, https://forum.freecad.org www.ApogeeRockets.com About the Author: Ken Karbon is a rocketeer from Michigan. He is a retired engineer from the auto industry where he specialized in CFD and aerodynamics. Figure 32. Streamlines in the Rocket Wake 23 Article Submission Guidelines Issue 644 / January 28th, 2025 SUBMITTING ARTICLES TO APOGEE We are always looking for quality articles to publish in the Peak-of-Flight newsletter. Please submit the “idea” first before you write your article. It will need to be approved first. When you have an idea for an article you'd like to submit, please use our contact form at https://www.apogeerockets. com/Contact. After review, we will be able to tell you if your article idea will be appropriate for our publication. Always include your name, address, and contact information with all submissions. Including best contact information allows us to conduct correspondence faster. If you have questions about the current disposition of a submission, contact the editor via email or phone. CONTENT WE ARE LOOKING FOR We prefer articles that have at least one photo or diagram for every 500 words of text. Total article length should be between 2000-4000 words and no shorter than 1750 words. Articles of a “how-to” nature are preferred (though other types of articles will be considered) and can be on any rocketry topic: design, construction, manufacture, decoration, contest organization, etc. Both model rocket and high-power rocket articles are accepted. CONTENT WE ARE NOT LOOKING FOR We don't publish articles like "launch reports." They are nice to read, but if you don't learn anything new from them, then they can get boring pretty quick... Example: "Bob flew a blue rocket on a H120 motor for his certification flight." As mentioned above, we’re looking for articles that have an educational component to them, which is why we like “how-to” articles. You can see what articles and topics we’ve published before at: https://www.apogeerockets.com/Peak-of-Flight?pof_ list=archives&m=education. You might use this list to give you an idea or two for your topic. Here are some of the common articles that we reject all the time, because we’ve published on these topics before: ● How to get a L1, L2, or L3 Cert ● Building cheap rockets and equipment (pads & controllers) ● How to 3D print parts, or a Rocket Kit ● How to Build a cheap Rocket Kit ● Getting Back Into Rocketry After a Long Hiatus 24 www.ApogeeRockets.com ARTICLE & IMAGES SUBMISSION Articles may be submitted by emailing them to the editor. Article text can be provided in any standard word processor format, or as plain-text. Graphics should be sent in either a vector format (Adobe Illustrator, SVG, etc.) or a raster format (such as jpg or png) with a width of at least 600 pixels for single column images or 1200 pixels for two-column images. It is preferable for images to be simple enough to be readable in a two-column layout, but special layouts can be used. Send the images separately via email as well as show where they go by placing them in the word processor document. ACCEPTANCE Submitted articles will be evaluated against a rubric (available here on our website). All articles will be evaluated and the results will be sent to the author. In the evaluation process, our goal is to ensure the quality of the content in Peak-of-Flight, but we want to publish your article! Resubmission of articles that do not meet the required standard are heavily encouraged. ORIGINALITY All articles submitted to Peak-of-Flight must not run in another publication before inclusion in the POF newsletter, but it may be based on another work such as a prior article, R&D report, etc. After we have published and paid for an article, you are free to submit them to other publications. RATES Apogee Components offers $300 for a quality-written article over 2,000 words in length. Payment is pro-rated for shorter articles. WHERE WILL IT APPEAR? These articles will mainly be published in our free newsletter, Peak-of-Flight. Occasionally some of the higher-quality articles could potentially appear in one of Tim Van Milligan's books that he publishes from time to time. Article Submission Guidelines Issue 644 / January 28th, 2025 www.ApogeeRockets.com 25 Apogee Components, Inc. 4960 Northpark Dr. Colorado Springs, CO 80918 719-535-9335 Your Success Is Our Mission! www.ApogeeRockets.com