CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SimpleFoam Converge too fast? (https://www.cfd-online.com/Forums/openfoam-solving/127814-simplefoam-converge-too-fast.html)

Alfalfa December 21, 2013 16:09

SimpleFoam Converge too fast?
 
Hi, I am running a simulation of a rearwing (3 elements) in free flow at 20m/s using SimpleFoam. The goal of this is to compare with the values of Star-CCM+. I successfully managed to get a converging solution with simpleFoam and the k-epsilon turbulence model, but the values for lift are way off the ones I get from Star-CCM+ (340N in OpenFOAM and 500 in Star-CCM+). Also, I get convergence (tolerence 1e-5) with only 127 iterations, which seems to be fairly low. I will put my cases files here if someone want to take a look. I am fairly new to OpenFoam and if someone would tell me if my case is set up correctly, it would help me.


0/U
Code:

internalField  uniform (20 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value        uniform (20 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    wall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    wing_patch0
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

}

0/p
Code:

boundaryField
{
    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
    value        uniform 0;
    }

    wall
    {
        type            zeroGradient;
    }
    wing_patch0
    {
        type            zeroGradient;
    }

}

0/k
Code:

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 0.375;
    }
    outlet
    {
        type            zeroGradient;
    }
    wall
    {
        type            kqRWallFunction;
        value          uniform 0.375;
    }
    wing_patch0
    {
        type            kqRWallFunction;
        value          uniform 0.375;
    }

}

0/epsilon
Code:

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 0.14;
    }
    outlet
    {
        type            zeroGradient;
    }
    wall
    {
        type            epsilonWallFunction;
        value          uniform 0.14;
    }
    wing_patch0
    {
        type            epsilonWallFunction;
        value          uniform 0.14;
    }

}

forces
Code:

functions
{
forces2
{
type forces;
functionObjectLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;
patches (wing_patch0);
pName p;
UName U;
rhoName rhoInf;
rhoInf 1; // Reference density, fluid
CofR ( 0 0 0 );
}
forces
{
type forceCoeffs;
functionObjectLibs ( "libforces.so" );
outputControl timeStep;
outputInterval 1;

patches ( wing_patch0 );
pName p;
UName U;
rhoName rhoInf;
log true;
rhoInf 1;
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 1);
magUInf 5;
lRef 0.6;
Aref 0.54;
}
}

schemes
Code:

ddtSchemes
{
    default        steadyState;
}

gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
    grad(U)        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      bounded Gauss upwind;
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(phi,R)      bounded Gauss upwind;
    div(R)          Gauss linear;
    div(phi,nuTilda) bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        none;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
    interpolate(U)  linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}

solution
Code:

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-05;
        relTol          0.001;
    }

    U
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }

    k
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }

    epsilon
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }

    R
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }

    nuTilda
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;

    residualControl
    {
        p              1e-2;
        U              1e-3;
        "(k|epsilon|omega)" 1e-3;
    }
}

relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        U              0.5;
        k              0.5;
        epsilon        0.5;
        R              0.5;
        nuTilda        0.5;
    }
}

post-processing forces
Code:

# Time    forces(pressure, viscous) moment(pressure, viscous)
125    ((141.343 -340.987 0.392246),(3.10142 0.809334 -0.00135019)) ((-212.161 -87.7299 85.3783),(0.506275 -1.93118 -0.553894))
126    ((141.337 -341.417 0.393058),(3.10202 0.808603 -0.00137183)) ((-212.43 -87.7248 85.5695),(0.505819 -1.9315 -0.553189))
127    ((141.332 -341.844 0.393627),(3.10264 0.807873 -0.0013929)) ((-212.698 -87.7208 85.7586),(0.505364 -1.93184 -0.552492))

My meshing is fine (according to checkMesh). The only thing is that I am not able (yet) to include boundary layers without ruining the mesh, so maybe that is what is causing the innacuracy between Star and OpenFOAM.

Thank you

fumiya December 23, 2013 04:31

Hi,

I think the result will change if you add the boundary layer mesh as you wrote.

1. What is the value of y+?
If you use the standard k-epsilon model, the y+ should be greater than about 30.
2. Is the density value rhoInf=1 is the same as that used in Star-CCM+?

Best regards,
Fumiya

Bernhard December 23, 2013 05:18

You can only compare both methods if you use the same mesh. It does not make much sense to compare the output of both tools if you also change the mesh. Also, you say the results are way of with the ones from Star-CCM. But which, if any, of them is correct?

Alfalfa December 23, 2013 13:36

Hi, thank you for the answer. I guess you are right, it doesn't make much sense comparing both with different meshes. Other than that, I use all the same values for density and everything.

My y-plus for openFOAM is min: 18.1881 max: 210.765 average: 92.1105 but I don't have boundary layers.

Now I plan to try both meshes in both tools and compare the results. We might have access to a wind tunnel so we can confirm our results later. For now, I just want to get more familiar with OpenFOAM.

But now I have a problem with boundary layers with sHM. When I run my case without them, it runs ok and the solution converge to realistic values. But when I have boundary layers, the solution (laminar first) oscillates like crazy and blow up. When I look at the solution on Paraview, I can see that there is clearly something wrong since the is a really small high pressure zone (surrealistically high) near the trailing edge of the second element. I have around 1000 highly skewed (max: 9) faces in the mesh when I add layers, and I haven't find a way to get rid of them yet. I looked in Paraview to see where they are because I thought that maybe it was the problem, but they are upstream and nowhere near the wing, so I don't think they are the problem.

I understand that I should use the same mesh for both software, but the thing is, if I cannot reproduce the same results independently of the other software (whichever gives the right values), is one of them better than the other? If both of them are good, I should be able to get close to the actual value of lift and drag with both software regardless of the path taken to get there.

Thank you


All times are GMT -4. The time now is 21:34.