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/)
-   -   Struggling with convergence inviscid rhoCentralFoam (https://www.cfd-online.com/Forums/openfoam-solving/238023-struggling-convergence-inviscid-rhocentralfoam.html)

a_bassolillo August 18, 2021 11:33

Struggling with convergence inviscid rhoCentralFoam
 
Dear all,

I am writing to ask for help in a problem I am facing regarding the inviscid transonic simulation of the flow around a RAE2822.
I am here attaching the files that could be useful to understand what I'm talking about. Since the solution of each time step is explicit, convergence cannot be assessed looking at the residuals, since their values is always equal to zero.

Since I am studying the steady 2D behaviour of an airfoil I would like to stop the simulation when the drag coefficient arrives at steady state, but this condition seems to be impossible to reach, I have tried to set a total pressure inlet bc to improve stability, but while the flowfield obtained (after a quite low number of iterations) seems reasonable with the shock in the correct position (given by NASA literature), the aerodynamic coefficient values calculated by rhoCentralFoam show a significant oscillation. This oscillation does not allow me to consider this solution at convergence. Even increasing a lot the number of iterations, this problem remains unsolved.

As mesh I am using a structured C-grid, produced with the curiosityfluids tool. I tried several combination of the values, ranging from 30.000 to 120.000 elements.

I am now attaching the files describing my configuration.
CONTROLDICT
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    rhoCentralFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        0.1;

deltaT          3e-6;

writeControl    adjustableRunTime;

writeInterval  0.005;

purgeWrite      0;

writeFormat    ascii;

writePrecision  8;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

functions
{
    #includeFunc MachNo
    #includeFunc residuals
    forces
    {
        type            forceCoeffs;
        libs            ("libforces.so");
        writeControl  timeStep;
        writeControl  timeStep;
        writeInterval  1;


        pName      p;
        UName      U;
        log        true;
        patches
        (
            airfoil
        );

        rhoInf      0.5966;

        CofR        (0 0 0);
        liftDir    (-0.0403 0.9992 0);
        dragDir    (0.9992 0.0403 0);
        pitchAxis  (0 0 1);
        magUInf    233.6216;
        lRef        1;
        Aref        1;
    }
}

FVSCHEMES
Code:

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

fluxScheme      Kurganov;

ddtSchemes
{
    default        CrankNicolson 0;
}

gradSchemes
{
    default        cellLimited Gauss linear 1;
    grad(U)        cellLimited Gauss linear 1;
}

divSchemes
{
    default                                        none;
    div(tauMC)                              Gauss linearUpwind;
    div(phi,U)                        Gauss linearUpwindV grad(U);
    div(phi,omega)                Gauss linearUpwind default;
    div(phi,k)                        Gauss linearUpwind default;
    div((nuEff*dev(T(grad(U)))))        Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear limited 1;
}

interpolationSchemes
{
    default        linear;
    reconstruct(rho) vanLeer;
    reconstruct(U)  vanLeerV;
    reconstruct(T)  vanLeer;
}

snGradSchemes
{
    default        limited 1;
}


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

FVSOLUTION
Code:

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

solvers
{
    "(rho|rhoU|rhoE)"
    {
        solver          diagonal;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps        2;
        tolerance      1e-09;
        relTol          0.01;
    }

    h
    {
        $U;
        tolerance      1e-10;
        relTol          0;
    }
}


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

Folder 0/

U
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Uinlet          (233.4317 9.4164  0);

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform $Uinlet;

boundaryField
{
    farfield
    {
        type            freestreamVelocity;
        freestreamValue uniform $Uinlet;
        value          uniform $Uinlet;
    }
    airfoil
    {
        type            slip;
    }

    frontAndBack
    {
        type            empty;
    }
    #includeEtc "caseDicts/setConstraintTypes"
}

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

0/p

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pOut            43765;

dimensions      [1 -1 -2 0 0 0 0];

internalField  uniform $pOut;

boundaryField
{
    farfield
    {
        type            fixedValue;
        value                uniform  43765;
    }

    airfoil
    {
        type            zeroGradient;
    }
   
    frontAndBack
    {
            type                empty;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

// ************************************************************************* //[

0/T
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Tinlet          255.6;

dimensions      [0 0 0 1 0 0 0];

internalField  uniform $Tinlet;

boundaryField
{
    farfield
    {
        type            inletOutlet;
        inletValue      uniform $Tinlet;
        value          $inletValue;
    }
   
    airfoil
    {
        type            zeroGradient;
    }
   
    frontAndBack
    {
            type                empty;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

0/Ma
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  8
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      Ma;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0.72783363;

boundaryField
{
    frontAndBack
    {
        type            empty;
    }
    farfield
    {
        type            calculated;
        value          uniform 0.72783363;
    }
    airfoil
    {
        type            calculated;
        value          nonuniform List<scalar>
279
(
0.72740526
0.72752391
0.72761278
0.72766195
0.72771781
0.72775799
0.72778947
0.72781218
0.72782649
0.72783318
0.727832
0.72782342
0.72780736
0.7277846
0.72775494
0.72771814
0.72767549
0.72762621
0.72757024
0.72750946
0.72744064
0.72736365
0.72728327
0.72719184
0.72708834
0.72698236
0.72686371
0.72672977
0.72659307
0.7264429
0.72627441
0.7261006
0.72591512
0.72571171
0.72549896
0.72527643
0.72503863
0.72478542
0.72452486
0.72426033
0.72398111
0.72368902
0.72341188
0.7231371
0.72283693
0.72255611
0.7222897
0.72199419
0.72171452
0.72145535
0.72117104
0.72089257
0.72063089
0.7203475
0.72006694
0.71980525
0.71952567
0.71924316
0.71897711
0.71869341
0.71840618
0.71813767
0.71784821
0.71755899
0.71729721
0.71701509
0.71673143
0.71646763
0.71617573
0.71589664
0.71564041
0.71535298
0.71508676
0.71482636
0.71454156
0.714296
0.71403375
0.71376988
0.71352645
0.71325387
0.71300002
0.71272193
0.71245187
0.71219092
0.7119048
0.71162631
0.71131884
0.71103845
0.71072331
0.71041534
0.71007744
0.70974872
0.70940547
0.70904403
0.70864046
0.70820874
0.70774286
0.7072251
0.70662257
0.705761
0.23565479
0.4942156
0.59826104
0.64457367
0.66900423
0.68348314
0.69293235
0.69935912
0.70393791
0.7074516
0.71018572
0.71241376
0.71427102
0.71582701
0.71716696
0.71831201
0.71932129
0.72019588
0.72098398
0.72167496
0.72230022
0.72285529
0.72335789
0.72381848
0.72422938
0.72461596
0.72496114
0.72528173
0.72557749
0.7258414
0.72608386
0.72630135
0.7265018
0.72668429
0.7268477
0.7270059
0.72716456
0.72723694
0.72742998
0.17965274
0.44770176
0.55902032
0.61050174
0.63884281
0.65675539
0.66914382
0.67801468
0.68470207
0.69000323
0.69425982
0.69775999
0.70066501
0.70312516
0.70522971
0.70705389
0.70864756
0.71005481
0.71130708
0.71242375
0.71345661
0.71439189
0.71525418
0.7160654
0.71680183
0.71749099
0.71812299
0.71872075
0.71928069
0.71980124
0.7203073
0.72077423
0.72122663
0.72165914
0.72206146
0.72247329
0.72290992
0.72312281
0.72375472
0.72365608
0.72410646
0.72447562
0.72473033
0.72508004
0.72536245
0.7256733
0.72597073
0.72623476
0.72652519
0.72678023
0.72700686
0.72722766
0.72740724
0.72755624
0.72767969
0.72776523
0.72781595
0.72783362
0.72781788
0.72777134
0.7276973
0.72759238
0.72746584
0.72732627
0.72715831
0.72697731
0.72680135
0.7266035
0.72639446
0.72620772
0.72601521
0.72580284
0.72562499
0.72546319
0.725272
0.72511216
0.72497933
0.72481751
0.72468072
0.72457855
0.72445537
0.72434442
0.72426746
0.7241828
0.72409759
0.72404448
0.72399821
0.72393978
0.72391195
0.72390091
0.72387218
0.72387216
0.7238973
0.72390438
0.72393337
0.72398945
0.72403139
0.72408946
0.72417457
0.72424969
0.7243369
0.7244502
0.72455827
0.72467333
0.72480785
0.72494188
0.7250769
0.72521856
0.7253607
0.72550376
0.72564868
0.72579381
0.72594189
0.72609275
0.72624339
0.72639486
0.72654755
0.72669867
0.7268476
0.72699514
0.72713385
0.72726886
0.72739564
0.72751237
0.72761772
0.72770341
0.72777294
0.72781638
0.72783362
0.72781857
0.72776454
0.72766862
0.72751844
0.72729805
0.72701829
0.7266616
0.72623408
0.72574904
0.72520315
0.72461104
)
;
    }
}


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


Please feel free to ask for more information if you need them, as I am quite desperate :(

janibo August 19, 2021 06:22

Hi,

maybe try to limit your max. courant number in conrolDict and
set maxCo to 0.1.

a_bassolillo August 19, 2021 10:22

It is working quite fine, there still are a little bit of oscillations but I think I can accept those, thank you very much. May I ask why you suggested this solution? As far as I now, for explicit calculations the courant number should stay below one.

Thanks a lot again

janibo August 20, 2021 01:14

Hi aniello,

I'm glad it worked.
Generally speaking you are right.
But rhoCentralFoam seems to be an exception.
rhoCentralFoam or better speaking the central schemes used
have their stability limit at 0.5 or rather 0.2 and below,
as it is stated in the paper "Implementation of semi-discrete, non-staggered central schemes
in a colocated, polyhedral, finite volume framework, for highspeed viscous flows" by Greenshields et al.

In order to get rid of the remaining oscillation, you could further decrease the courant number, if you can spare the time.

a_bassolillo August 20, 2021 03:04

Thank you very much for the explanation. I was going crazy trying to fix this.

Have a nice day and see you again on this forum!


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