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/)
-   -   How to run in transient the airFoil2D (simpleFoam) tutorial case? (https://www.cfd-online.com/Forums/openfoam-solving/189387-how-run-transient-airfoil2d-simplefoam-tutorial-case.html)

csacska June 19, 2017 04:38

How to run in transient the airFoil2D (simpleFoam) tutorial case?
 
I am a beginner OpenFOAM user but it is clear that the simpleFoam solver is a steady one and the pimpleFoam or pisoFoam has to be used for incompressible transients simulations. I would like to run the airFoil2D case in transient and I need some help for it. I tried to modificate the controlDict, fvSchemes, fvSolution files in accordance with the pitzDaily pimpleFoam version with no success. Is there anyone who could explain what to modificate in this case exactly?

Kina June 19, 2017 04:58

Hi and welcome!
How did you modify the files and what error does OpenFOAM give you?
Can you post your files as code?

Cheers
Alex

csacska June 19, 2017 05:38

No error message
.:confused:
/Allrun
then commander says that "Running pimpleFoam on ..."
then it returns after some seconds, no solution files

controlDict:
application pimpleFoam (from simpleFoam)
and
i added the following row to the end: maxCo 5;

fvschemes:
here i changed the ddtSchemes to Euler

fvsolution:
here i changed Simple to Pimple method

My codes:
controlDict:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application pimpleFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 500;

deltaT 1;

writeControl timeStep;

writeInterval 50;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

adjustTimeStep yes;

maxCo 5;


// ************************************************** *********************** //


fvschemes:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind grad(U);
div(phi,nuTilda) bounded Gauss linearUpwind grad(nuTilda);
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

wallDist
{
method meshWave;
}


// ************************************************** *********************** //

fvsolution:
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
p
{
solver GAMG;
tolerance 1e-06;
relTol 0.1;
smoother GaussSeidel;
}

U
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-08;
relTol 0.1;
}

nuTilda
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-08;
relTol 0.1;
}
}

PIMPLE
{
nNonOrthogonalCorrectors 0;
nCorrectors 2;
}


// ************************************************** *********************** //

Kina June 19, 2017 06:49

You didn't define a pRefCell and a pRefValue for PIMPLE, which is sometimes needed when running with freestreamPressure BCs. I modified your fvSolution a little so you can see a better converged solution.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance      1e-06;
        relTol          0.1;
        smoother        GaussSeidel;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps        2;
        tolerance      1e-08;
        relTol          0.1;
    }

    nuTilda
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps        2;
        tolerance      1e-08;
        relTol          0.1;
    }
   
    pFinal
    {
        $p;
        relTol    0;
    }
    UFinal
    {
        $U;
        relTol    0;
    }
    nuTildaFinal
    {
        $nuTilda;
        relTol    0;
    }
   
}

PIMPLE
{
    nNonOrthogonalCorrectors 0;
    nCorrectors 2;
    nOuterCorrectors        50;
    pRefCell        0;
    pRefValue      0;
   
    residualControl
    {
        p
        {
            relTol          0;
            tolerance      0.0001;
        }
       
        U
        {
            relTol          0;
            tolerance      0.0001;
        }
    }
   
}

relaxationFactors
{
    fields
    {
        p              0.3;
    }
    equations
    {
        U              0.7;
        nuTilda        0.7;
    }
}


// ************************************************************************* //


csacska June 19, 2017 08:08

Thank you very much, it works. There is weird thing that I obtain results at random time steps such as 1.23234, 2.324234, 3.3159923, 4.25559, 5.157234...and so on

Meanwhile :
deltaT is 1
and writeInterval is every 50th timestep

Kina June 19, 2017 08:45

Yeah, this is because you initially set deltaT to 1 but then limit the whole thing by the MaxCo. This means that the initial time step will be 1, but then it gets much lower because of the Courant number. As you output the results not by information of time but timesteps, you get weird output times.
Put in your controlDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  dev                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    pimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        1;

deltaT          0.025;

writeControl    adjustableRunTime;

writeInterval  0.025;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo          5;

// ************************************************************************* //



All times are GMT -4. The time now is 16:28.