Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by techGuy »

I love using CfdOF in FreeCAD.

Some of my OpenFOAM meshes and simulations take a long time to run. I'm running FreeCAD on my modestly powered (AMD Ryzen 7) workstation. However, I have a more powerful computer (AMD EPYC) sitting beside my desk that I would like to run my meshes and simulations on. For a variety of reasons, I like to have separate computers for these tasks. - CAD and everyday work on my workstation and run simulations and meshes on my EPYC machine.

Ideally I'd do all the CAD and generate the mesh and simulation cases on my workstation, as I currently am. Then I'd press a button whereby the cases would be copied over to the remote machine and run there. Ideally the output and report functions from the remote process would still appear on my workstation FreeCAD session while they are running.

When the mesh and/or simulation is done on the remote machine, ideally everything would be copied back to my workstation as if it ran locally there.

I presently manually run OpenFOAM simulations on the remote machine. I do this by manually copying over the case files and running them on the remote machine. It's a pain doing this. It would be nice if this process were automated.

Is it presently possible to run meshing and/or simulations on a remote machine in a (semi) automated fashion using CfdOF ? By leveraging docker ?

If I was going to implement such functionality either in or out of CfdOF, how would you suggest I go about doing it ?

Without looking at CfdOF code, my best guess would be to open an ssh session for FreeCAD to use, copy the case material over and then run the same command in the ssh session that used to be run locally. That way one could pipe the results of the run to FreeCAD to display as it is doing now.

Any and all ideas and advice on this topic will be gratefully received.

Thanks
User avatar
adrianinsaval
Veteran
Posts: 5544
Joined: Thu Apr 05, 2018 5:15 pm

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by adrianinsaval »

probably doable using ssh, nowadays I think even windows ships with ssh so it might even be possible to do this multi-platform
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by techGuy »

Thanks for the reply.

As I said, I'm doing this manually with rsync (to move/mirror the files) and ssh (to run and watch the process) right now. But it is a pain.

I'm sure I'm not the only one that wants to mesh and run OF remotely. It would be really, really nice to integrate this into CfdOF.
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by techGuy »

What if... CfdOF configuration had a "Remote Host" field that would take the hostname of the remote machine to run things on. When it runs things, it would have to ask for permission for a user to do anything on it.

What if... CfdOF had a "Copy Case Files to Remote Host" button that would transfer the mesh or simulation files over to the remote host.

The CfdOF mesh and simulate process screens could then have 2 run buttons. The first to run things locally, ie the current Run button. The second button would be a "Run Remotely" button to run things on the remote machine. At the end of a remote run, the process would copy the results back to the workstation machine. And optionally leave the results on the remote machine.

Thoughts ?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by Kunda1 »

Perhaps x-posting to the Python and macro scripting subforum to create a macro for this?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
thschrader
Veteran
Posts: 3155
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by thschrader »

I have installed the complete openFOAM/FreeCAD pacckage on my (fast) remote laptop too.
After constructing the case on my (slow) laptop, I copy the FC-file to the remote station
and run meshing/simulation. I can see the simulation by simply activating the remote window.
Works ok for me.
techGuy
Posts: 126
Joined: Sat Jun 18, 2022 12:48 am

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by techGuy »

thschrader wrote: Fri Dec 30, 2022 11:04 am I have installed the complete openFOAM/FreeCAD pacckage on my (fast) remote laptop too.
What OS are you using on each ?
After constructing the case on my (slow) laptop, I copy the FC-file to the remote station
and run meshing/simulation. I can see the simulation by simply activating the remote window.
You have FreeCAD installed on both machines. How are you copying the FC files to the remote machine ? What remote window are you speaking of ?
thschrader
Veteran
Posts: 3155
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: Feature discussion - meshing and running OpenFOAM on a remote maching (from within CfdOF)

Post by thschrader »

I run Windows 10 pro on both machines (laptops are from my company).

For connection I use
https://support.microsoft.com/en-us/win ... e636865e8c

When the connection is enabled, the remote machine works like an additional harddrive.
You simply copy your FreeCAD CAD-file to the remote machine, then do the work there.
Post Reply