Second OpenFoam (or other software) assignment

Next week there is no teaching due to h?stferie. However, you can still work and I have an additional assignment for you:-)

Compute the regularized lid driven cavity problem. This problem is defined for a square domain [-1, 1]x[-1, 1] and sets the x-velocity of the top lid to (1-x)**2*(1+x)**2. As such there is no discontinuity in the two upper corners. See, e.g., "A study of the regularized lid-driven cavity’s progression to chaos": https://www.sciencedirect.com/science/article/pii/S1007570418303575

Find the location of the center of the main vortex in the flow for Re=250, where the viscosity is calculated as 2/Re. The first that can tell me the location to within 5 digits of accuracy wins a special price:-) (I already know the answer.)

OpenFoam hint: The center of the vortex is located at the same place as the minimum value of the stream function, and you can compute stream functions using the postProcess tool. Also, you can set nonuniform boundary conditions using the 'codedFixedValue' option. Since this is difficult to find information about online, the solution is given here. Put this in U instead of the regular movingWall:

movingWall
    {
    type            codedFixedValue;
    value           uniform (1 0 0);
    name            regularized;

    code
    #{
        const vectorField& Cf = patch().Cf();
        vectorField& field = *this;

        forAll(Cf, faceI)
        {
            const scalar x = Cf[faceI][0];
            field[faceI] = vector((1-x)*(1-x)*(1+x)*(1+x),0,0);
        }
    #};
    }

Published Oct. 1, 2021 3:36 PM - Last modified Oct. 1, 2021 3:36 PM