https://linen.dev logo
Your probably won't need it anymore (but I needed ...
# programming
f
Your probably won't need it anymore (but I needed it myself)
Copy code
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | foam-extend: Open Source CFD                    |
|  \\    /   O peration     | Version:     4.0                                |
|   \\  /    A nd           | Web:         http://www.foam-extend.org         |
|    \\/     M anipulation  | For copyright notice see file Copyright         |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      funkySetBoundaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

velocities
{
    field                 U;

    expressions
    (
        {
            target        value;
            patchName     "inlet";
            variables
            (
            "Uavg=0.042;"
            "xCoord=pos().x;"
            "yCoord=pos().y;"
            "xCoordMax=max(xCoord);"
            "yCoordMax=max(yCoord);"
            "CoordMax=max(xCoordMax, yCoordMax);"
            "r=sqrt(pow(xCoord, 2) + pow(yCoord, 2));"
            );
            expression "(1-pow(r / CoordMax, 2)) * 2 * Uavg * vector(0, 0, -1)";
        }

    );
}

// ************************************************************************* //
https://cdn.discordapp.com/attachments/814043123810304041/1409900953087508488/image.png?ex=68af1015&is=68adbe95&hm=3cae348eadcacd2fcbd115c7b6c15442c45cb6212d4f41bee626306dcee4432b&