https://linen.dev logo
Join Discord
Powered by
# function-objects
  • 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
  • o

    otaolafr

    12/18/2025, 9:05 AM
    hello, anyone has a function object to generate a field for the share stress? in the complete mesh? not only on the surface?
  • s

    slopezcastano

    12/18/2025, 4:36 PM
    You'll need a codedObject :/
  • s

    slopezcastano

    12/18/2025, 4:36 PM
    But it is not that difficult.
  • s

    slopezcastano

    12/18/2025, 4:38 PM
    The turbulenceModel class offers the "devReff()" method. That's your viscous + Reynolds shear stress tensor
  • s

    slopezcastano

    12/18/2025, 4:40 PM
    Copy code
    const incompressible::turbulenceModel& trbPtr =
        mesh().lookupObject<incompressible::turbulenceModel>
        (
          "turbulenceModel"
        );
    // Stress tensor
    tmp<volSymmTensorField> Reff_(trbPtr.devReff());
  • s

    slopezcastano

    12/18/2025, 4:41 PM
    You may, otherwise, modify your solver to call "devReff()" there
  • o

    otaolafr

    12/18/2025, 8:18 PM
    I m in a laminar simulation 🥲
  • z

    Zino

    12/18/2025, 9:56 PM
    Then don't you just need the velocity gradient?
  • z

    Zino

    12/18/2025, 9:57 PM
    and multiply by viscosity?
  • z

    Zino

    12/18/2025, 9:59 PM
    Well, it's a little more complicated than that, but the velocity gradient gives all the info you need from memory