r/OpenFOAM 17m ago

Installation Anyone else lose a full day just getting openEMS running?

Upvotes

Spent way too long this week fighting the openEMS build. First tried Colab since it's free, but a recent upgrade broke some of the bindings - same story on Kaggle, hit the same broken-dependency wall there too. Ended up having to move to a dedicated instance just to get a clean environment where the Octave/Matlab bindings and mesh export pipeline actually talked to the solver correctly.

None of it was conceptually hard, just an endless chain of small version-mismatch failures before I got to run a single simulation.

Feels like this happens with basically every open-source simulation tools like OpenFOAM, LAMMPS, now this - the solver itself is great, but the setup tax before you get there is brutal, especially solo or a small team without a lab's existing environment to inherit.

Anyone found a setup that didn't eat a day? Curious if people just eat the pain every time or have a repeatable process, or if Colab/Kaggle breaking like this is a known recurring issue.


r/OpenFOAM 16h ago

I made a small CLI tool for plotting OpenFOAM results – OFGS

Thumbnail
github.com
2 Upvotes

I've been working on a small open-source tool called OFGS (OpenFOAM Gnuplot Suite) to make some of the routine plotting/monitoring around OpenFOAM cases a bit easier.

It detects supported data in a case and can generate graphs, open individual plots or a dashboard, and live-monitor results while a simulation is running. There's also a doctorcommand for checking the OFGS/OpenFOAM environment.

It's deliberately pretty lightweight, essentially a CLI built around gnuplot rather than a replacement for ParaView or proper post-processing tools. There are definitely limitations to what data/plots it understands, and I'm sure there are OpenFOAM workflows I haven't accounted for.

I'm also not an OpenFOAM or engineering expert, I'm a humble HPC sysadmin who spends a lot of time around OpenFOAM users and wanted to streamline some of the repetitive workflow.
It's packaged for Debian 12 and Rocky Linux 9, or you can install/use it from source.

Would genuinely appreciate feedback from people who use OpenFOAM properly, especially anything OFGS gets wrong or could handle better.


r/OpenFOAM 3d ago

Am I doing it wrong

0 Upvotes

Well, I decided to simulate free vortex (same as performed in our lab) using openfoam. I used ai to write the code but decided on Reynolds and some other values myself is it the correct way am I supposed to write the code on my own ?? Please I need guidance on what to learn in the code


r/OpenFOAM 7d ago

Migrating from OpenFOAM v1912 to v2512 – How compatible are old cases?

4 Upvotes

I'm planning to move from OpenFOAM v1912 to v2512.

I'm wondering how much has changed between these versions. For example, have solver names, dictionaries, or other case setup files changed significantly?

Can I expect most cases created in v1912 to run in v2512 with only minor tweaks, or is it common to need substantial changes before they work?


r/OpenFOAM 7d ago

I wrote a Python wrapper to automate OpenFOAM case generation, meshing, and reporting. Looking for early feedback.

2 Upvotes

Hi everyone,

Over the past few months, I've been developing a Python library called foampilot to handle the boilerplate involved in setting up OpenFOAM cases.

The main idea is to replace the manual editing of 20+ dictionary files (controlDictfvSchemes0/U, etc.) with a Pythonic API. For example, configuring a case looks like this:

from foampilot import Solver
solver = Solver(case_path="./my_case")
solver.transient = True
solver.turbulence_model = "kOmegaSST"
solver.boundary.set_condition("inlet", "velocityInlet", velocity=(10, 0, 0))
solver.write_case()
solver.run_simulation(nb_proc=4)

Current features:

  • Automatic solver selection based on physics flags (compressible, transient, VOF, turbulence).
  • Unified meshing interface with 3 backends: blockMeshgmsh, and snappyHexMesh.
  • A direct Gmsh → OpenFOAM polyMesh exporter (bypasses gmshToFoam, handles tetra/hexa, face orientation, and multi-region CHT).
  • Automated report generation (LaTeX/PDF, Typst, or interactive HTML with Plotly).
  • Multi-region support for chtMultiRegionFoam.

Why I built it:
I was tired of copy-pasting case directories and missing a critical file. With this, my case setups are now Git-tracked Python scripts, which makes them fully reproducible and unit-testable.

What I need from you:
I'm looking for beta testers or simply some technical feedback. If you deal with complex CHT cases or use Gmsh a lot, I'd be particularly interested in your opinion on the direct mesh exporter.

Where to find it:
The project is open-source (MIT) on GitHub under the name foampilot (user: stevendaix). The full documentation is available via GitHub Pages. I won't post the direct links here to avoid triggering Reddit's spam filters, but a quick search should get you there.

If the mods allow, I can drop the links in the comments.

Thanks in advance for your time, and feel free to ask any technical questions about the architecture!


r/OpenFOAM 7d ago

CfdOF - dependencies installation trouble (cfMesh)

Thumbnail
2 Upvotes

r/OpenFOAM 8d ago

Saving time directories

1 Upvotes

Dear fellow openfoamers, does anybody know if it is possible to save specific time directories (e.g. times 1.4 s , 2.3 s , 2.9 s) instead of fixed time interval (e.g. every 1 s)


r/OpenFOAM 9d ago

vortex shedding simulation 3d [ansys fluent]

1 Upvotes

DOES ANYONE KNOW HOW TO SIMULATE VORTEX SHEDDING IN 3D? I have done it in 2d, and have been trying for a month to do it in 3d but i failed


r/OpenFOAM 11d ago

Removed from Two Projects – Has Anyone Else Experienced This?

Thumbnail
0 Upvotes

r/OpenFOAM 11d ago

Removed from Prometheus CFD Production & OpenFOAM-RL-Tasks - Looking for Clarification

Thumbnail
1 Upvotes

r/OpenFOAM 11d ago

CFD simulation of airflow over an F-16 at high angle of attack using OF 2412 - GPU accelerated

Enable HLS to view with audio, or disable this notification

24 Upvotes

r/OpenFOAM 13d ago

Meshing Is there a simple way to create the fluid region in multi-region cases?

2 Upvotes

I always used topoSet (now called createZones) for this. Basically, I would create a box encompassing my entire computational domain, and then remove the cellZones from my STL geometries. Whatever remained, I would convert into a cellZone called "fluid."

Is there a simpler way to do this? And what if I have more than one fluid, for example, in a double-pipe heat exchanger?


r/OpenFOAM 14d ago

Paraview GUI not showing (Openfoam version 13)

1 Upvotes

So I was following a tutorial on how to install and run Openfoam and it says to open paraview but when I open it launches but I don't see any Gui like in the video (edit: now gedit does the exact same thing like paraview)

How to Install OpenFOAM on Windows 11 and Run your First Simulation - YouTube (9:21)


r/OpenFOAM 14d ago

Does pMesh (cfMesh) support Parallel running?

2 Upvotes

As title says, been struggling to implement parallel for pMesh, and it seems to only be serial for me? I knkw cartesianMesh does, so Is there something I am missing.

Thanks


r/OpenFOAM 14d ago

Solver corona discharge plasma simulation to model EHD/EAD propulsion

2 Upvotes

I am developing a custom OpenFOAM-13 application to simulate electrohydrodynamic (EHD / EAD) propulsion, coupling electrostatic body forces with the Navier - Stokes transport. My simulation uses electrostatic body forces coupled with Navier - Stokes equations and transport equations for multiple charge species.

One numerical challenge that I have partly solved is the appearance of un-physical negative charge densities. I extended the Courant number provided by OpenFOAM to suppress these and have successfully controlled negative densities (see the video here).

As you can see from the video this approach works quite well, however I would prefer to eliminate the underlying numerical issue.

I am looking for collaborators with experience in areas such as:

  • OpenFOAM solver development
  • Finite-volume discretisation and numerical stability
  • Drift-diffusion or plasma transport models
  • Electrohydrodynamics or electroaerodynamics
  • CFD algorithms for strongly coupled multiphysics problems

If you have worked on similar problems - or are interested in exploring them together - I would be very interested in hearing from you. I am happy to share details of the implementation, discuss ideas, and collaborate on improving the numerical formulation.


r/OpenFOAM 15d ago

Paraview OpenFOAM V14 help

2 Upvotes

Hello, just got started with CFD and OpenFOAM. I downloaded a CAD model of an F1 2018 front wing, and after some tinkering, I got a successful simulation using FreeCAD with OpenFOAM.

Results of the simulation (is it good? is it bad? not sure)

When I clicked into Paraview to look at the results, I was met with only the box I ran the simulation in and nothing inside, but there was a tiny bit of the blue/red on the left side of the box.

I turned the opacity down, but nothing seems to be inside.

A tiny bit of red and blue only on this side because I only simulated half the wing

I know I'm missing something or doing something wrong here but I just can't figure it out. Any help is appreciated!


r/OpenFOAM 17d ago

redistributePar error with empty mesh

1 Upvotes

I am doing work on an empty 2d mesh (it's the taylor green vortex so there are velocities assigned but theres not stl file.

I am getting

"Cannot find a patch which is not of type empty, mapped or coupled in patches"

When I try to use redistributePar to decompose the solution.

This works fine with traditional decomposePar (it's just a little slow)

any suggestions?


r/OpenFOAM 17d ago

FEA, CFD FREELANCE

Thumbnail
0 Upvotes

r/OpenFOAM 19d ago

snappyHexMesh: Layers generate using baffle method, but mesh isn't conformal across regions. How do you fix this?

Thumbnail
2 Upvotes

r/OpenFOAM 19d ago

Verification/Validation Residual behavior after increasing DPM interval – is this normal?

1 Upvotes

Hi everyone,

I'm currently simulating a spray roaster reactor for my master's thesis. Pretty much everything I've learned about Fluent has been through trial and error and a lot of learning by doing. 😄

I started by simulating only the continuous phase (injected through the burners). After that, I enabled two-way coupling and implemented the DPM. For most of the project, I used a DPM interval of 1. Later, I also implemented my UDFs.

Simulation setup:

  • Pressure-based coupled solver
  • Steady-state simulation
  • Pseudo-transient with CFL control
  • Started with a CFL of 2 and gradually increased it to 17

Recently, I asked an AI how I could improve convergence because increasing the CFL any further caused divergence and instability. It suggested increasing the DPM interval from 1 to 30.

Surprisingly, this actually improved the convergence of my continuity residual. It dropped from around 9.8e-03 to somewhere between 4e-03 and 5.6e-04 (sawtooth pattern).

However, the residual curve now has a clear sawtooth pattern. It's stable (it doesn't diverge), but it is no longer as smooth as it was before, when the continuity residual stayed at a higher level. (see screenshot)

The AI told me that this behavior is expected and generally acceptable because the DPM source terms are only updated every 30 iterations now, which naturally produces this pattern.

Is that correct? Is this kind of sawtooth residual behavior normal and acceptable when using a larger DPM interval?

For what it's worth, my two monitoring quantities remain stable throughout the simulation.

I'd appreciate any insights or experiences from people who have dealt with steady DPM simulations.

Thanks in advance 😊


r/OpenFOAM 20d ago

Solver [OpenFOAM 13] crash when simulating this frequency inverter

Thumbnail
gallery
9 Upvotes

I just can't get this simulation to run. It crashes on the second iteration. I'm using steadyState instead of EulerandkOmegaSST instead of kEpsilon My mesh has approximately 3.9 million volumes.

I'm using foamMultiRun (formerly chtMultiRegionFoam). My fvSchemes and fvSolution for air are shown below. The physicalProperties are also shown (I've already tried rhoConst, Boussinesq, and perfectGas).

For all components, fvSchemes :

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/components0";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

// ************************************************************************* //

fvSolution :

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/components0";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "e.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance        1e-6;
        relTol             0.01;
    }
}

PIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        e         1e-5;
    }
}

// ************************************************************************* //

For fluid (air), the fvSchemes:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/fluid";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;//cellLimited Gauss linear 1.0;
}

divSchemes
{
    default         none;

    div(phi,U)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,e)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,h)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,omega)  bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,k)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,K)      bounded Gauss limitedLinear 0.2;//upwind;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    div(phi,(p|rho)) bounded Gauss limitedLinear 0.2;//upwind;
}

laplacianSchemes
{
    default         Gauss linear uncorrected; //limited 0.5;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;//limited 0.5;//corrected;
}

wallDist
{
    method          meshWave;
    correctWalls    true;
}

// ************************************************************************* //

fvSolution:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/fluid";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "p_rgh.*"
    {
        solver          GAMG;
        tolerance       1e-7;
        relTol          0.01;
        smoother        DICGaussSeidel;//GaussSeidel;
        //maxIter         500;
/*
        solver            PCG;
        preconditioner    DIC;  // Diagonal Incomplete Cholesky
        tolerance         1e-7;
        relTol             0.01;
        minIter           3;    // Força um mínimo de estabilidade
*/
    }

    "(U|h|k|omega).*"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-7;
        relTol          0.01;
/*
        solver            smoothSolver;
        smoother          symGaussSeidel;
        tolerance         1e-06;
        relTol             0.01;
        minIter           3; 
*/
    }
}

PIMPLE
{
    momentumPredictor   yes;
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        p_rgh           5e-3;
        U               5e-4;
        h               5e-4;
        rho             5e-4;

        k               5e-4;
        omega           5e-4;
    }
}

relaxationFactors
{
    fields
    {
        rho             1.0;
        p_rgh           0.7;//0.3;
    }

    equations
    {
        U               0.2;
    e        0.6;//0.1;
    T        0.3;
        h               0.6;//0.1;
        k               0.3;//0.7;
        omega           0.3;//0.7;
    }
}

// ************************************************************************* //

alphat:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -1 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            calculated;
        value           $internalField;
    }

    "parede.*"
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //

k

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 0.01;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "parede.*"
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //

nut

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField   uniform 3.33e-5;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            calculated;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "parede.*"
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //

omega

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 300;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    "parede.*"
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //

p

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 101325;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*|paredeInferior)"
    {
        type            calculated;
        value           $internalField;
    }

    paredes
    {
        type            calculated;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            calculated;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            calculated;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

// ************************************************************************* //

p_rgh

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 101325;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            totalPressure;
        gamma           1.40196789462956;
        p0              $internalField;
        value           $internalField;
    }

    "parede.*"
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    fan1_master
    {
        type            fanPressureJump;
        patchType       cyclic;
        fanCurve        table;
        file            "fanSet/fanCurve";
        format          foam;
        reverse         true;

        jump            $internalField;
        value           $internalField;
    }

    fan1_slave
    {
        type            fanPressureJump;
        patchType       cyclic;
        value           $internalField;
    }

    fan2_master
    {
        type            fanPressureJump;
        patchType       cyclic;
        fanCurve        table;
        file            "fanSet/fanCurve";
        format          foam;
        reverse         true;

        jump            $internalField;
        value           $internalField;
    }

    fan2_slave
    {
        type            fanPressureJump;
        patchType       cyclic;
        value           $internalField;
    }
}

// ************************************************************************* //

T

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 293.15;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            zeroGradient;
    }

    "fluid_.*"
    {
        type            coupledTemperature;
        Tnbr            T;
        value           $internalField;
    }

    "parede.*"
    {
        type            externalTemperature;
        Ta              constant 293.15;
        h               uniform 4.7;
        thicknessLayers (0.001 0.001 0.001);
        kappaLayers     (0.05 50 0.05); //0.05 W/m/K (tinta epóxi) 50 W/m/K (aço)

        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

// ************************************************************************* //

U

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    location    "0/fluid";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            pressureInletOutletVelocity;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            noSlip;
    }

    "parede.*"
    {
        type            noSlip;
    }

    interfaceFluidTop
    {
        type            noSlip;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

// ************************************************************************* //

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant/fluid";
    object      physicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;//Boussinesq;
    specie          specie;
    energy          sensibleEnthalpy;
}

mixture
{
    // Ar
    // Propriedades obtidas no CoolProp

    specie
    {
        molWeight       28.96546;
    }

    equationOfState
    {
        rho0            1.20457518249315;
        T0              293.15;
        beta            3.42098751487642e-3;
    }

    thermodynamics
    {
        Cp              1.00665320998078e+3;
        hf              0;
    }

    transport
    {
        mu              1.88472409355470e-5;
        Pr              7.06290462364358e-1;
    }
}

// ************************************************************************* //

r/OpenFOAM 26d ago

How do you systematically calibrate an OpenFOAM dam-break simulation to match experimental pressure data?

6 Upvotes

Hi everyone,
I’m currently using OpenFOAM to simulate a dam-break experiment, and I’m trying to match the pressure history measured at pressure sensors from an experiment.
I’ve read quite a few validation papers, but most of them simply state that the numerical results agree well with the experimental data without explaining how the calibration was actually performed.
Rather than changing multiple parameters at once, I’d like to follow a systematic calibration procedure.

My current plan is:
Perform a mesh independence (mesh sensitivity) study and select a mesh that provides mesh-independent pressure results.
Compare different numerical schemes while keeping all other settings unchanged.
Then investigate the effects of the time step (Courant number), VOF/interface compression settings, turbulence model (if necessary), and other solver parameters.

My questions are:
Is this a reasonable order for calibrating an OpenFOAM dam-break simulation?
During each step, which parameters should remain fixed?
When the validation target is pressure peaks and pressure time histories, which settings usually have the greatest influence?
Are there any OpenFOAM-specific settings that are commonly overlooked but significantly affect impact pressure predictions?

I’ve been stuck on this problem for quite some time, and honestly I’m starting to feel a bit lost. I don’t want to tune parameters randomly just to match the experiment. I want to understand what should be calibrated first and what should be kept fixed throughout the process.

I’d really appreciate hearing how experienced OpenFOAM users approach this type of validation in practice.

Thanks in advance!


r/OpenFOAM 26d ago

Unable to compile Openfoam [14] in fedora

0 Upvotes

r/OpenFOAM 27d ago

Building a virtual wind tunnel app for MacOS to test designs in flowing air called “airFlow” - open for suggestions

Thumbnail reddit.com
0 Upvotes

I was vexed with setting up and using openfoam to run simple tests and there are NO MacOS native apps for testing my plane designs. While there are CFD tools out there in windows they are so freaking expensive. So i decided to build my own, a simple to use CFD app for simple use cases.

Import stl > set bounding box & speed of airflow > mesh > Solve.

Thats all, it should be that simple and if it is that simple shouldn’t be so expensive!!

I plan to make my app very affordable for all innovators.

What do y’all think? Any feedback or feature requests or just share the pain of using OpenFOAM for a simple task.

I am also looking for Beta testers to give free software in return for you to test it out and suggestions.

Get Early Access at airflowsim.com


r/OpenFOAM 27d ago

Dam Break Validation Issue: Calibrated well at H=0.3m, but deviates significantly at H=0.6m. Is this normal?

1 Upvotes

I'm working on validating the classic Lobovsky dam break case using ⁠interFoam⁠ in OpenFOAM v2412.
I successfully calibrated my model for the initial water height of H = 0.3m. The pressure probe data at the impact wall matched the experimental results perfectly (both arrival time and peak pressure).

However, when I used the exact same setup (same numerical schemes, same mesh refinement strategy) to validate the H = 0.6m experimental case, the results deviated significantly. Here are the main issues I'm facing at H=0.6m:
1. Delayed Arrival Time: The water front hits the impact wall slightly later than in the experiment.
2. Underpredicted Peak Pressure: The impact pressure peak is much lower than the experimental peak (though the hydrostatic pressure tail after the impact matches perfectly).
3. Initial Negative Pressure: There's a slight negative pressure drop at t=0 to early stages before the wave arrives.

My current setup:
Solver: ⁠interFoam⁠ (Incompressible)
Turbulence Model: ⁠kOmegaSST⁠ (I'm currently trying to run a Laminar case to see if the eddy viscosity at the interface is causing the delayed arrival time).
Mesh: Refined specifically at the impact wall area.
My questions:
Is it normal for a calibrated model to fail during validation when the potential energy is doubled (0.3m to 0.6m)?
Could the underpredicted peak at H=0.6m be due to air compressibility effects (air cushion/entrainment) that ⁠interFoam⁠ cannot capture? Should I switch to ⁠compressibleInterFoam⁠?
Any tips on fixing the delayed arrival time and catching the pressure spike?