CFD with FreeCAD!

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Buckeye

Well-Known Member
TRF Supporter
Joined
Sep 5, 2009
Messages
3,538
Reaction score
1,675
I started looking for an OpenFOAM UI freeware a few months ago. FreeCAD with the CfdOF workbench seemed ideal. Coincidently, David Carter made a nice presentation at NARCON 2024 2 weeks ago on this very software.

I built up a simple test case of the Estes Fatboy design using the parametric Rocket workbench in FreeCAD plus a rear bulkhead to seal the fin can. Super easy.

geom1.png


From, there I built out a simulation with CfdOF. The seamless integration is fabulous!

There is a nice set of robust meshing and simulation options. I ran through about 20 mesh design iterations until I got something I liked. Meshing took about 1 minute on my Windows PC. 1-2 mm resolution on the rocket including boundary layers. The domain area is large enough such that blockage is less than 1%. Total cell count is about 2 million.

mesh4.pngmesh5.png
mesh1.pngmesh2.png

For the solver, I started out simple with steady, incompressible, turbulent RANS. I think this is a good model up to Mach 0.3. The solver took about 3 hours on 1 core. I couldn't get the MPI version working, but when I do, the solve time should drop to about 30 min on 8 cores. Here is the nice steady state convergence of forces. The drag results make sense.

convergence.png1707658947602.png

Some flow images. The isosurface of total pressure = 0 shows the base wake as well as some flow loss off the square edges of the fins.

cp1.pngisosurface.png
vel1.pngvel2.png

This is a game changer for hobbyists! Granted, I have a background in CFD, so the setup and analysis was very intuitive. Still, the workbenches in FreeCAD make it very easy. If you can CAD it, you can simulate it in minutes. Make design changes and everything in the workflow updates automatically. With some development of the CFD best practices and templates, I see this replacing Barrowman, RockSim, and OpenRocket for accurate aero analysis of any shape.

More to come in another post where I use this CFD model for center of pressure analysis.
 
Hrmm, wonder if anybody's been working on OpenRocket --> FreeCAD pipeline. I know several folks have made various exporters in the past.
 
I started looking for an OpenFOAM UI freeware a few months ago. FreeCAD with the CfdOF workbench seemed ideal. Coincidently, David Carter made a nice presentation at NARCON 2024 2 weeks ago on this very software.

I built up a simple test case of the Estes Fatboy design using the parametric Rocket workbench in FreeCAD plus a rear bulkhead to seal the fin can. Super easy.

View attachment 629880


From, there I built out a simulation with CfdOF. The seamless integration is fabulous!

There is a nice set of robust meshing and simulation options. I ran through about 20 mesh design iterations until I got something I liked. Meshing took about 1 minute on my Windows PC. 1-2 mm resolution on the rocket including boundary layers. The domain area is large enough such that blockage is less than 1%. Total cell count is about 2 million.

View attachment 629878View attachment 629879
View attachment 629876View attachment 629877

For the solver, I started out simple with steady, incompressible, turbulent RANS. I think this is a good model up to Mach 0.3. The solver took about 3 hours on 1 core. I couldn't get the MPI version working, but when I do, the solve time should drop to about 30 min on 8 cores. Here is the nice steady state convergence of forces. The drag results make sense.

View attachment 629882View attachment 629888

Some flow images. The isosurface of total pressure = 0 shows the base wake as well as some flow loss off the square edges of the fins.

View attachment 629883View attachment 629884
View attachment 629885View attachment 629886

This is a game changer for hobbyists! Granted, I have a background in CFD, so the setup and analysis was very intuitive. Still, the workbenches in FreeCAD make it very easy. If you can CAD it, you can simulate it in minutes. Make design changes and everything in the workflow updates automatically. With some development of the CFD best practices and templates, I see this replacing Barrowman, RockSim, and OpenRocket for accurate aero analysis of any shape.

More to come in another post where I use this CFD model for center of pressure analysis.

How will it "replace" RockSim, and OpenRocket?​
Will it give:​
  • Velocity Off The Rod,
  • Apogee,
  • Velocity At Deployment,
  • Optimum Delay,
  • Max. Velocity,
  • Max Acceleration,
  • Time to Apogee,
  • Flight Time,
  • Ground Hit Velocity
Sure it gives some useful information, but "replace"...​
 
Hrmm, wonder if anybody's been working on OpenRocket --> FreeCAD pipeline. I know several folks have made various exporters in the past.

In fact, I started with the .obj export from OR and read that into FreeCAD. Spent 2 evenings on it. Working with the faceted mesh is messy, but doable. It was far easier to design the rocket in CAD with solid entities.
 
How will it "replace" RockSim, and OpenRocket?​
Will it give:​
  • Velocity Off The Rod,
  • Apogee,
  • Velocity At Deployment,
  • Optimum Delay,
  • Max. Velocity,
  • Max Acceleration,
  • Time to Apogee,
  • Flight Time,
  • Ground Hit Velocity
Sure it gives some useful information, but "replace"...​
It can replace the aero modeling of CP and CD.

In time, the flight trajectory analysis can be added as well.
 
It can replace the aero modeling of CP and CD.

In time, the flight trajectory analysis can be added as well.
I just don't see it ever replacing OpenRocket or Rocksim. They are both useful tools.​
I found FreeCAD to be cumbersome to use and it takes a pretty powerful computer to run.​
 
I found FreeCAD to be cumbersome to use and it takes a pretty powerful computer to run.​

I have only built 3FNC rockets in FreeCAD, so I am not sure about more complex shapes. The way it operates is not the same way I learned CAD, so it does take a different way of thinking.

However, the CFD performance is impressive. My computer is nothing special, other than a low-end CAD (not gaming) graphics card.

OS Name Microsoft Windows 10 Home
Version 10.0.19045 Build 19045
Processor AMD Ryzen 3 PRO 4350G with Radeon Graphics, 3800 Mhz, 4 Core(s), 8 Logical Processor(s)
16 GB RAM
NVIDIA Quadro P400
 
Last edited:
This is a game changer for hobbyists! Granted, I have a background in CFD, so the setup and analysis was very intuitive. Still, the workbenches in FreeCAD make it very easy. If you can CAD it, you can simulate it in minutes. Make design changes and everything in the workflow updates automatically. With some development of the CFD best practices and templates, I see this replacing Barrowman, RockSim, and OpenRocket for accurate aero analysis of any shape.

More to come in another post where I use this CFD model for center of pressure analysis.
Any tutorials you have the time and energy to write would be invaluable.
 
The drag can be calculated for one Reynolds number, but you want the drag over an entire OR or Rocsim trajectory. Besides OR or Rocsim will be faster and take less computer memory. In addition they are calibrated by years of experience and empiricism.
 
The drag can be calculated for one Reynolds number, but you want the drag over an entire OR or Rocsim trajectory. Besides OR or Rocsim will be faster and take less computer memory. In addition they are calibrated by years of experience and empiricism.
For sure, that is true today. I am referring mainly to the rockets that don't look like rockets per the Barrowman and DATCOM models used now. RS and OR are not so good with those. A handful of CFD runs could build up a decent Cd vs. Mach curve for use in the trajectory analysis. Throw in some response surface methods/machine learning investment, and the outputs are limitless. It took 80 years to get where we are today with the current methods.
 
I just don't see it ever replacing OpenRocket or Rocksim. They are both useful tools.​
<<snip>>
Yes, OR provides a lot of additional functionality that would take a lot of effort to recreate elsewhere !

However a user here on OR ( @SpaceManMat ) posted a link to his OR PlugIn where one could import CD Data from external sources:

Changing Cd in OpenRocket

I can't locate him anymore in my TRF User-Picker ( Last Seen Jul 12, 2023 )

@SpaceManMat's Latest release of the plugin was on Post #43 and the instructions are back in Post #18 and Post #24.

I never got around to testing his OR PlugIn it but IMO, being able to import CD -vs- Velocity or even Drag -vs- Velocity from arbitrary sources into OR would be amazing.

Especially when you can import CD -vs- Velocity from actual flight data, like say from a Blue Raven :)

Anyhow ... $0.02 ...

-- kjh
 
I read that but apparently forgot it by the time I got to the bottom. I’m not the sharpest tool in the shed…:rolleyes::headspinning:

Ps I’m still wondering about the GPU thing.

Several commercial CFD codes can run on GPUs, but I don't think OpenFOAM is there yet. The CfdOF solver discussed here runs on the CPU.
 
I like the looks of the grid in post #1. I am more partial to trapezoidals than I am to tetrahedrons. The grid is finer towards the boundary, which one would expect. I am wondering if it is fine enough to include wall functions, but I have no way of knowing. Conceivably, one could make a finer grid and see if there is any change in the results. If the results don't change much, that is one way to know that the grid is fine enough.
 
Keep in mind that one can get different results in CFD depending on which buttons they push. About 15 years ago when I ran CFD (Fluent) in a previous life, I did a study on vortex shedding and pressure oscillations in the internal flow of a solid rocket motor. My first attempt was to use a two-equation turbulence model (probably k-epsilon) with unsteady RANS. I could not get vortex shedding to appear. I then incorporated my own forcing mechanism into the flow and sure enough the oscillations appeared after a long time of computer running. However, lo and behold, when I turned off the the forcing mechanism, the pressure oscillations disappeared completely. I could not get vortex shedding and pressure oscillations to appear in the internal solid rocket motor flow. I had a colleague suggest to me to use the LES turbulence model instead of unsteady RANS. Lo and behold, vortex shedding and pressure oscillations appeared immediately and naturally in the simulation without any forcing function and a whole new world opened up.
 
I like the looks of the grid in post #1. I am more partial to trapezoidals than I am to tetrahedrons. The grid is finer towards the boundary, which one would expect. I am wondering if it is fine enough to include wall functions, but I have no way of knowing. Conceivably, one could make a finer grid and see if there is any change in the results. If the results don't change much, that is one way to know that the grid is fine enough.

Thanks! I designed the grid. First cell height is 0.2 mm, for y+ of 30. There are 4 meshing schemes and multiple refinement options in CfdOF.
 
Keep in mind that one can get different results in CFD depending on which buttons they push. About 15 years ago when I ran CFD (Fluent) in a previous life, I did a study on vortex shedding and pressure oscillations in the internal flow of a solid rocket motor. My first attempt was to use a two-equation turbulence model (probably k-epsilon) with unsteady RANS. I could not get vortex shedding to appear. I then incorporated my own forcing mechanism into the flow and sure enough the oscillations appeared after a long time of computer running. However, lo and behold, when I turned off the the forcing mechanism, the pressure oscillations disappeared completely. I could not get vortex shedding and pressure oscillations to appear in the internal solid rocket motor flow. I had a colleague suggest to me to use the LES turbulence model instead of unsteady RANS. Lo and behold, vortex shedding and pressure oscillations appeared immediately and naturally in the simulation without any forcing function and a whole new world opened up.
Of course. As I mentioned in the CoP thread, this was just a start with CFD, not the final answer. I spent 30 years doing automotive CFD. I set up this model with methods used in industry. Yes, URANS sucks. DDES is a good choice for transient accuracy, while RKE and k-omega sst are good for steady-state. We would do a lot of what-if studies quickly in steady state, and then final confirmations with DDES.

While the Cfd workbench makes the setup easy, the user still needs to understand how to properly run a CFD model. I am just thrilled that this model meshed, ran, and converged without blowing up. On the first try.

Remember AeroCFD from the AeroRocket guy? That was limited to 2D, symmetric, Euler flows, I think. Other CFD discussions on the forum usually involved somebody messing around at their workplace with spendy commercial software. FreeCAD is full 3D Navier Stokes simulations that seemingly run robustly on a home computer. That puts a powerful tool within reach of hobbyists. See the readme for a list of capabilities:

https://github.com/jaheyns/CfdOF
 
Back
Top