https://linen.dev logo
Join Discord
Powered by
# function-objects
  • m

    Moose

    07/10/2025, 9:13 AM
    I mean, they release a lot, but I assume they play on retrocompatibility not to need too much new documentation ?
  • o

    otaolafr

    07/10/2025, 9:14 AM
    oh I meant 'how the F. you find them' ahahah but for sure it is nice!
  • y

    Yann

    07/10/2025, 9:16 AM
    the thing is, this doc is only partial, and some part are just wrong / not up to date
  • y

    Yann

    07/10/2025, 9:17 AM
    Yeah, you can see in in the solver.C file, eg for ``simpleFoam``:
    Copy code
    #include "fvCFD.H"
    #include "dynamicFvMesh.H"
    #include "singlePhaseTransportModel.H"
    #include "turbulentTransportModel.H"
    #include "simpleControl.H"
    #include "fvOptions.H"
    https://develop.openfoam.com/Development/openfoam/-/blob/master/applications/solvers/incompressible/simpleFoam/simpleFoam.C
  • y

    Yann

    07/10/2025, 9:20 AM
    And it also shows up in the equations, for instance in ``UEqn.H``:
    Copy code
    tmp<fvVectorMatrix> tUEqn
        (
            fvm::div(phi, U)
          + MRF.DDt(U)
          + turbulence->divDevReff(U)
         ==
            fvOptions(U)
        );
  • m

    Moose

    07/10/2025, 9:28 AM
    Thanks a lot, that is exactly what I was searching for ! Now I will put this in interCondensatingEvaporatingFoam ✨
  • y

    Yann

    07/10/2025, 9:32 AM
    it already supports fvOptions, so you just need to use the model you want, or code your own if nothing suits your need
  • k

    Kringel

    07/23/2025, 10:46 AM
    I want to be able to track the velocity of my "particles" (volume fraction) in a VoF solver with a function object. With time, preferably the velocity of the center of mass of my volume fraction field. Is there a function object that does this already, or what would be an appropriate starting point to make it myself?
  • j

    June

    07/25/2025, 5:58 AM
    You can try below one as the starting point and keep the outputs you need: https://github.com/tmaric/TwoPhaseFlow/blob/feature/density-ratio/run/rhoVoF/translatingDropletInQuiescentFluid3D/NewU-templateCase/system/FObubbleProcessing
  • a

    aeroBoi

    08/07/2025, 10:39 PM
    so im trying to get cut planes to visualize flow but for some reason it is not saving the vtk files in the postprocessing file. is there something wrong with the way i have it set up
    Copy code
    functions
    {
        myCutPlane
        {
            type            surfaces;
            libs            ("libsampling.so");
            writeControl    writeTime;
            surfaceFormat   vtk;
            writeFormat     binary;
            fields          (p U); 
            interpolationScheme cellPoint;
    
            surfaces
            {
                myCutPlane
                {
                    type            cutPlane;
                    planeType       pointAndNormal;
                    point           (0 0 0);
                    normal          (0 0 1);
                    interpolate     true;
                }
            }
        }
    }
    or does it pop up after i do
    Copy code
    foamToVTK
  • a

    aeroBoi

    08/07/2025, 10:40 PM
    i am using decomposePar as weel, wondering if that is causing the issue
  • y

    Yann

    08/08/2025, 7:19 AM
    the function is supposed to write the vtk files while the solver is running, no need for foamToVTK
  • y

    Yann

    08/08/2025, 7:22 AM
    and the files should be written every time the solver write to disk
  • y

    Yann

    08/08/2025, 7:22 AM
    what OpenFOAM version are you using?
  • a

    aeroBoi

    08/08/2025, 9:34 AM
    OpenFOAM -13
  • a

    aeroBoi

    08/08/2025, 9:40 AM
    The postProcessing/myCutPlane/0/ is always empty
  • a

    aeroBoi

    08/08/2025, 9:42 AM
    Wait
  • a

    aeroBoi

    08/08/2025, 9:43 AM
    I think I might be dumb, I'm running a 2d sim so the cut plane might not work for that
  • y

    Yann

    08/08/2025, 9:56 AM
    well, the function definition looks fine so my next question would be "are you sure about your point and normal values"
  • a

    aeroBoi

    08/08/2025, 10:23 AM
    Point not so sure, but the plane is a xy plane so the normal will be the zplane
  • m

    Moose

    09/02/2025, 9:30 AM
    what was the script to link the path of a custom solver in the control dict again ? I cannot remember :/
  • m

    Moose

    09/02/2025, 10:14 AM
    Nvm, here is the solution 😉 solver compressibleLeeVoF; libs ( "libcompressibleLeeVoF.so" // your solver module (in $FOAM_USER_LIBBIN) // add any extra model libs you need too // "libLeeBoilingModels.so" );
  • t

    Tengii

    10/08/2025, 7:59 PM
    Hey guys, I've been trying to figure this out for 3h and can't get it to work. I want to write .obj files of only the alphawater surface in openFoam v2406. I think the function doesn't even load. This is in my controldict:
    Copy code
    functions
    {
        alphaIso_asOBJ
        {
            type            surfaces;                 
            libs            ("libsampling.so");
    
            fields          ();
            
            isoSurfaces
            (
                (alpha.water 0.5)
            );      
    
            surfaceFormat   obj;
            writePrecision  6;
            parallelOutput  yes;                     
            writeControl    timeStep;                 
            writeInterval   10;                       
        }
    }
    Any help would be appreciated 🙂
  • y

    Yann

    10/09/2025, 8:57 AM
    According to the tutorials, syntax should look like this in v2406:
    Copy code
    surfaces
    {
        type            surfaces;
        libs            (sampling);
        writeControl    writeTime;
    
        surfaceFormat   vtk;
        fields          (Q);
    
        surfaces
        {
            isoQ
            {
                type            isoSurface;
                isoField        Q;
                isoValue        1000;
                interpolate     true;
            }
        }
    }
  • t

    Tengii

    10/09/2025, 11:26 AM
    Thank you very much, I'll try that. Where did you look this up? I'm new to openFoam and I didn't find good sources/documentation yet. (I'm a programmer, so a technical doc is fine)
  • t

    Tengii

    10/09/2025, 12:37 PM
    Update: This is what worked for my case. Thank you @User!
    Copy code
    functions
    {
        waterSurface
        {
            type            surfaces;
            libs            (sampling);
            writeControl    timeStep;
            writeInterval   10;  
            
            surfaceFormat   obj;
            
            fields          (alpha.water);
            
            interpolationScheme cellPoint;
            
            surfaces
            {
                waterIso
                {
                    type            isoSurface;
                    isoField        alpha.water;
                    isoValue        0.5; 
                    interpolate     true;
                    regularise      true; 
    
                }
            };
        }
    }
  • f

    finn

    10/09/2025, 12:40 PM
    Yann the goat
  • y

    Yann

    10/09/2025, 3:09 PM
    I just grepped the tutorials to see if there was an example somewhere:
    Copy code
    grep -r "isoSurface" $FOAM_TUTORIALS
  • y

    Yann

    10/09/2025, 3:11 PM
    Online doc can help too (but it's not complete nor up-to-date): https://doc.openfoam.com/2306/tools/post-processing/function-objects/sampling/surfaces/isoSurface/
  • y

    Yann

    10/09/2025, 3:12 PM
    grepping ``$FOAM_SRC`` can help too, but I always find the sampling lib painful to explore