The Idea
Finite element analysis software makes it relatively easy to try several iterations of one design.
However, a license often costs quite a bit. As a hobbyist, I cannot find an excuse to pay so much for a license.
There are several open-source alternatives. OpenFOAM is one for CFD. However, they have a sharp learning curve and a user interface that is not very friendly.
To use OpenFOAM, you must change case files in text format. With an interface it becomes much easier to use. This is what first inspired me to make the Mechanical Simulation Workbench. It started as a CFD interface for OpenFOAM. Then it grew into other simulation areas like heat transfer, vibration and static structural analysis.
Then I tried to match use cases, so that verifying and validating the results becomes easier.
Verifying the Numbers
I have also added a mesh independence study. You can run the same case with different mesh sizes and see how the result changes. If it does not change, you have a good mesh. The comparison runs through a single button.
Residuals are also shown for each iteration to verify that the solution converges.
Validating the Numbers
To check the numbers, I used empirical methods. I tested each case against the result I expect from theory.
- Vibration: a cantilever beam gives 410.2 Hz in the workbench and 408.3 Hz from beam theory
- Heat: a vertical heated plate in still air gives 61.8 °C from CFD and 63.6 °C from the Churchill-Chu correlation
- Propeller: I measured the thrust from the simulation and compared it with the thrust I expect to get
Vibration
I compared the natural frequencies of beams with beam theory. Euler-Bernoulli theory ignores shear deformation. Timoshenko theory includes it, so I compared with both.
| Beam and mode | Euler-Bernoulli [Hz] | Timoshenko [Hz] | Workbench [Hz] |
|---|---|---|---|
| Cantilever, thin direction, bending 1 | 61.2 | 61.19 | 61.63 |
| Cantilever, wide direction, bending 1 | 408 | 404.8 | 405.6 |
| Cantilever, wide direction, bending 3 | 7160 | 6380 | 6399 |
| Cantilever, first axial mode | 6314 | - | 6326 |
| Free-free bar, bending 1 | 1298 | 1286 | 1287 |
| Free-free bar, bending 3 | 7015 | 6684 | 6690 |
Heat
The test is steady conduction in a 100 x 20 x 20 mm aluminium bar. The answer is known from a hand calculation.
| Case | Result | Hand calculation | Workbench |
|---|---|---|---|
| Ends at 100 and 20 °C | Heat flow | 53.440 W | 53.440 W |
| One end at 100 °C, convection at the other end | Heat flow | 12.313 W | 12.310 W |
| Same case | Temperature of the convective end | 81.57 °C | 81.57 °C |
| 20 W generated in the bar, ends at 20 °C | Maximum temperature | 23.743 °C | 23.74 °C |
Where the exact answer is a straight line, the solver gives it to rounding error. Heat in equals heat out. With heat generation the exact answer is a parabola. A linear element cannot give a parabola exactly. The error is 0.19 % of the temperature rise on a 4 mm mesh, and it falls on a finer mesh.
A Real Case: Drone Frame
I also ran a vibration study on a drone frame. The motors turn at 8500 rpm and the propellers have three blades. The blade passing frequency is 425 Hz. If a natural frequency of the frame is close to it, the frame can resonate.
| Case | Mode 1 [Hz] | Mode 2 [Hz] |
|---|---|---|
| Motors 62 g, battery 300 g (baseline) | 400 | 428 |
| Motors 40 g | 446 | 476 |
| Motors 90 g | 356 | 384 |
| Frame only, no added mass | 583 | 627 |
The first two modes are arm bending. In the baseline case they are at 400 Hz and 428 Hz, close to the blade passing frequency. This is a resonance risk to check on the real frame.
The motor and battery masses are my assumptions, and the table shows how much they change the result. The carbon fibre is modelled as an isotropic material. The CAD frame is solid and heavier than a real frame, and the model has no joints. The real frequencies are probably lower. I used a half model, so only the modes that are symmetric across the cut plane are shown.
What It Can Do Now
Right now it has several different parts.
- Heat transfer in solids, with natural convection and radiation
- Static structural: stress, deflection and safety factor
- Vibration: natural frequencies and mode shapes
- Electronics cooling with OpenFOAM, with a fan (forced convection) or without one
- External aerodynamics with OpenFOAM, including moving and sliding meshes (for example, propellers)
The solid studies use built-in FEM solvers. On Windows the workbench downloads OpenFOAM into its own folder the first time it starts, so you install nothing. You can also use Claude to help you set up the simulation. The panel on the side gives Claude access to your project, and it can set up the case as you ask.
Testing It on a Propeller
To test the CFD interface I simulated a propeller on a drone. I could give a few reasons for this case, but mostly it was because it looked cool.
The propeller was simulated as a sliding mesh with a set speed of 24000 rpm. The drone was also moving through the air at 10 m/s.
Meshing
I added a few different meshing techniques to make the best use of the computer. If the cells are small everywhere, the run takes too long. These are the tools I use to control the cell size.
- A global size, from a coarse preset to a fine one
- A smaller size on one face or one part
- Refinement boxes and cylinders, for example in the wake behind the propeller
- Thin layers of cells on the walls, for the air next to the surface
The sliding mesh was the difficult one. My first runs failed within one or two degrees of rotation, because the two sides of the sliding interface shared points. A parallel run also crashed the MPI library. The fix was to keep each interface on one processor.
Assumptions and Limitations
The meshes are tetrahedra only. Drag and heat transfer from a coarse mesh are only a rough indication. The flow solver is incompressible, so a propeller with tips near the speed of sound is outside its range. Vibration analysis is linear and has no damping.
Where It Is Now
Version 0.3.0 is out now. Feedback, bug reports and contributions are very welcome.