Forum Navigation
You need to log in to create posts and topics.

How to replicate BaramFlow using NextFoam from the command line

Hello everybody,

I face a similar problem with my previous post about meshing (https://baramcfd.org/en/forum-2/topic/how-to-replicate-barammesh-results-using-nextfoam-openfoam-from-the-command-line/).

This time, I want to run a simulation using nextFoam in Ubuntu. I created a case in BaramFlow, and copied it so I can run it with the exact same files (0, fvSchemes, controlDict, etc..). When I run the nextFoam code, calling the nextFoam fork I already installed in my pc (source /opt/OpenFOAM/nextfoam-cfd/NextFOAM-2606/etc/bashrc), I get slightly different results. For your reference, I attach a comparison of the two solvers' predictions on Cd (y-axis) over the iterations (x-axis) graph. With blue is the BaramFlow postprocessing results, and with orange the nextFoam results.

A possible reason for that is that the build called is different for BaramFlow and nextFoam (see attached images):

  1. baramFoam: fd134f9d-20260427 OPENFOAM=2412 version=v2412
  2. nextFoam: 2606 OPENFOAM version=2606

Any ideas what is going on? Do nextFoam and BaramFlow use different solvers or settings?

Or any suggestions on how to run the same build solvers?

I want to automate the process by running the same solver for different meshes I have created. Is there any way to do this for different meshes (I have all the polymesh files), to automate the solver process?

Thank you in advance,

Christoforos

 

Uploaded files:
  • baram_vs_nextfoam.jpg
  • baramFlow.png
  • nextFoam.png

What are your running environments?

Is BARAM running in Windows or Ubuntu Linux? If you run the BARAM in Linux, Do you use BARAM solvers by download through https://d3c6e16xufx1gb.cloudfront.net/solvers/solvers_linux_26.2.0_20260507.tar.xz ?

Otherwise, after building NEXTFOAM-cfd using source, did you copy solvers in /opt/OpenFOAM/nextfoam-cfd/NextFOAM-2606/platforms/linux64GccDPInt32Opt/bin/ to baram/solvers/openfoam/bin ?

Hi Christoforos,

This is Jake from NEXTFOAM.

First, this is my understanding of current situation.
Please correct me if anything wrong.

  1. You runs BARAM on Windows
  2. You runs "nextFoam" on Ubuntu (This package might be built on the Ubuntu machine by yourself)
  3. Resulting "Cd" values are slightly different.

And here are my questions.

  1. It seems that you have modified something since the build string is different from that of usual nextFoam build. Could you tell me about the modification?
    "Build  :  2606 OPENFOAM version=2606"
  2. Could you share the project case so that we can start on the same page?
    Or you may share a simpler case that can show your issue if the case is confidential.

Thank you.

Best regards,
Jake

Hello,

Let me clarify some things about my case:

  1. I run BaramFlow on Windows.
  2. I run nextFoam on Linux Windows Subsystem (Ubuntu LTS)

Following advice on this thread, I have since switched to using the official BARAM Linux solver tarball (solvers_linux_26.2.0_20260507.tar.xz). After setting the environment manually, interFoam now correctly reports Build: fd134f9d-20260427 OPENFOAM=2412 version=v2412 — matching the Windows BaramFlow binary exactly. However, I still get slightly different Cd results compared to BaramFlow, so the version mismatch alone was not the full explanation.

The case is based on the JBC (Japan Bulk Carrier) benchmark.

I uploaded the new screenshots of the runs on nextFoam and BaramFlow, indicating the same build.

I also uploaded the case (template_case_4.zip), which I run in Linux WSL with baram's interFoam. Due to size limitation, please find it here (https://www.transfernow.net/dl/20260625nY0o4FdF)

If anything else is needed, please let me know,

Thank you for the replies,

Best regards,

Christoforos

Uploaded files:
  • baramFlow_new.jpg
  • nextFoam_new.jpg

Oh, you seem to have shared an OpenFOAM case folder.
Could you share the BARAM project folder, which is the parent folder of the shared folder?

Dear Jake,

Please find here (https://www.transfernow.net/dl/20260625in3ZBzPI) the baramFlow case,

Thanks,

Christoforos

Dear Christoforos,

We have successfully replicated your case and have started investigating it. However, it may take some time for us to identify the root cause. I will get back to you as soon as I have more details.

Thank you for your patience.

Quote from Jake on June 30, 2026, 3:36 pm

Dear Christoforos,

We have successfully replicated your case and have started investigating it. However, it may take some time for us to identify the root cause. I will get back to you as soon as I have more details.

Thank you for your patience.

Dear Jake,

 

Thank you,

I am looking forward to hearing back from you,

Best regards,

Christoforos

Dear Christoforos,

The difference comes from the differences in underlying libraries on Windows and on Linux.

Lots of complex mathematical operations are used in calculation especially in turbulence calculation.

The difference is not seen if you change turbulence model to "laminar" because the calculation is relatively simple in that model.

In general, the values will finally reach the same value though they can be somewhat different during the calculation.

Best regards,
Jake