Glutton for punishment, trying to install an operational CfdOF workbench for FreeCAD on MacOS

Are you trying to use your GPU to accelerate the computations? Maybe one of the scripts is trying to but not finding one.

I fooled around with an SFM program, with the idea that it could be the start of a cheap 3D scanner. The image analysis burns a lot of CPU cycles so one of the options is to use your GPU to speed things up....but everything has to be configured correctly. It can depend on what version of GPU you've got, among other things. I ended up with a cloud of points that sorta-kinda replicated the objects but that's as far as I got.

Point is, you may be dealing with some hardware-specific issues.
 
As far as I know, neither FreeCAD nor the CfdOF programs use any GPU computational acceleration. To do that requires some pretty fancy programming and rearchitecting the code to exploit parallelism. OpenMP and OpenMPI are typically CPU based parallel processing, at least they were back in 2010 when I was doing it. As I recall it was easy to parallelize, but hard to get the correct answer. Sometimes the threads don't occur when you expect and they stomp on your results! FreeCAD will run on underpowered hardware like an RPI4, haven't tried it yet on an RPI5.

But I do agree it could be some HW specific thing that's the issue. All I know is this is a first thing in the morning type of problem to work on, rather than a night time issue. Maybe I can get a little further along tomorrow morning, with a decent cup of coffee to encourage me.

Compiling cfmesh shows a lot of warnings, don't know if significant, lots of not being able to find a file. But no errors. Something is wrong at the top level though, segfaults just shouldn't happen.
 
Hmm. This morning worked on this. Started FreeCAD from the console, rather than the GUI, hoping the console would survive the program faulting. I found that the macro I downloaded from the github site had an error in it. I reran the Test Workbench for CfdOF which told me that the project should be ok. I then copied the source file and macros from the same path (used in the Test Workbench output) into my work area. I was able to get the individual and top level macros to run correctly. Previously there was an error. One problem down.

In my delusional state, I thought all I needed to do at that point, was to run the simulation. So I wrote the test case (to file) and ran the mesher. It ran a while, and generated a bunch of warnings, but it was running and doing the meshing thing. After about 46 seconds, it finished "surfacemesh.vtk". Then the script ./Allrun started running and shortly thereafter was rewarded with another Segmentation fault: 11. The GUI vanished and an Apple popup happened, telling me all about the grievous problem. However, the console text window was still intact, preserving some of what had just happened. So better than last time at least. Zipped the console output and posted it for the developer to see. Maybe he can offer a clue.
 
Something is working, despite my blunders and segfaults. The behavior isn't intuitive to me, so can't tell if it is a fluke or not, but the simulation is running. This is a supersonic rocket like object traveling in air. I have 4 cores running now doing the solver. With some luck maybe I will see a bow and stern shock wave in the results. Here are some of the simulation residuals.
Screenshot 2024-05-01 at 2.50.27 PM.png
Only just over a third done with the sim. The fans on my MacBookPro have come on, the sim is making it work. You can see some of the parameters are not reducing in error and have flat lined.
 
Screenshot 2024-05-01 at 4.06.22 PM.png
About 55 minutes to simulate with 4 cores. Still need to play with displaying results. I'd like more contrast. I was playing around some and managed to get Paraview to become non-responsive. Pity, since, it was a nice picture at that point. Oh well, this is the second rendering. You can see the bow wave and the wave off the leading edge of the fins. Pretty neat. High speed turbulent flow model.
 
Well sometime about May 5th or so, I broke my installation. :confused: Not sure what broke it, but there were some strange things that happened, including the Paraview crash mentioned above, so I'm not surprised. The past week, I have been trying to recover, with no success until today. Or, at least it said it installed, and FreeCAD recognized it. Really was floundering at this, and finally I remembered that I had created a thread on this, showing what I had done. So I went back to page 2 out of an 8 page thread and re-read it carefully. Repeated the steps (verbatim) and bingo, it seemed to work. Maybe I will get to work on a modified version of the above model this week, just to see that I can take my first baby steps using CfdOF. This is all new stuff to me, so it's not coming easy to me at all. I have no background in this stuff whatsoever.

From the last run (May 1) I re-rendered the data using a different color map, which was interesting. Paraview is not an easy tool to use (for me) but it is extremely capable. Here's the same simulation, but a different color map. You can see the sections that are less than atmospheric pressure (100 KPa) in blue in the tail area, and the above atmospheric pressure at the nose, and fins.
Screenshot 2024-05-01 at 4.34.35 PM.png
 
Got it working again. The add on modules are very particular about their installation technique. Had something curious happen though. Reran sim using 5 cores rather than 4, and experienced my external monitor blanking for about 2 seconds a couple of times. Was weird. Killed the job. Then ran the sim with 6 cores (and half the number of sims, just as a test). Was expecting to finish a little sooner, which it did. But some process (or hardware) turned off my external monitor during the sim. I was using 6 out of 10 performance cores. The fans, as might be expected were at a higher volume than with 4 or 5 cores. But they didn't scream or anything. They just were pumping air and flushing heat away. Now my laptop is normally closed and sitting in a stand, so this was an inconvenience!

Everything seemed to be still running, I just had a blank screen. I opened the laptop and saw the screen, but not the main one. After some fiddling around I switched them. The simulation finished. At that point, I disconnected the Thunderbolt cable from the laptop and plugged it in again, and my monitor was working again.

Now, I'm wondering if this phenomena is a limitation of the platform, or a fault of some sort of my computer. I did a chat with Apple, which took awhile for the level 1 support to understand the nature of the problem. They thought I was concerned about the fans, I wasn't. I just mentioned them, since multicore simulations make more heat. I want to know if I have a soldering or similar manufacturing fault, or if this is a limitation of a 2023 MacBookPro design. Finally, I got passed off to a different level of support. Need to make that call right after lunch. Hoping I can run a cpu stress test of some sort for extended periods of time (30 minutes) to see if there's a thermal problem on my laptop, or to rule that out. It could be the CFD software itself. Think I'm one of the few in the world who is adventurous enough to try this on a new MacBookPro. Will post once I find something out. I'd be flabbergasted for them to admit it, but maybe this laptop wasn't designed for this use case and this is unwritten but "normal" behavior. A CPU stress test should reveal if there's a thermal issue though.

Tried some apps on the App store, and they seem to be junk. They don't even make the fans go on with "load". I'm trying stress-ng now.
Code:
% stress-ng --matrix 6 --matrix-size 64  -t 20m
Do six instances of matrix multiplication for 20 minutes. We'll see if the CPU gets loaded and warm. The turbulent solver had 6 cores with 2 threads per core. So far I don't know how to load similarly. I'm only getting 1 thread to run per core, but at 100% load.
 
The fans come on around 15 minutes in, but nowhere near the same level as the real simulation. It's not an equivalent loading. I will need to put in more stressors.
 
Back
Top