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/)
-   -   Courant Number become bigger and bigger!!! (https://www.cfd-online.com/Forums/openfoam-solving/62994-courant-number-become-bigger-bigger.html)

mihir1310 September 11, 2009 15:48

Quote:

Originally Posted by Julian K. (Post 229224)
.

Mihir, could you also post your fvSchemes? I'd be very interested. Maybe also you rBC setup for P U and T. Thanks.


you mean Bcs of sonicFoam case ?????

As far as schemes are concerned , i used Minmod perfectly , ,However for rhoCentralFoam im not sure, as it is a completely different ballgame ..

Julian K. September 16, 2009 08:24

Quote:

Originally Posted by mihir1310 (Post 229295)
you mean Bcs of sonicFoam case ?????

As far as schemes are concerned , i used Minmod perfectly , ,However for rhoCentralFoam im not sure, as it is a completely different ballgame ..

Hi Mihir,

It would be very interesting for me to see your 0/p, 0/U, 0/T files, as well as the system/fvSchemes and maybe also the system/fvSolution dictionary. Perhaps, there is something in, I don't already know.

mihir1310 September 16, 2009 10:41

Quote:

Originally Posted by Julian K. (Post 229674)
Hi Mihir,

It would be very interesting for me to see your 0/p, 0/U, 0/T files, as well as the system/fvSchemes and maybe also the system/fvSolution dictionary. Perhaps, there is something in, I don't already know.

Ma
Code:

type            waveTransmissive;
internalField  uniform 1;

boundaryField
{
    inlet
    {
        type            calculated;
        value          uniform 1;
    }
    outlet
    {
        type            calculated;
        //        value          uniform 3;
    }
   
    }

P:
Code:

boundaryField
{
    inlet         
    {
        /*type totalPressure;
          p0 uniform 1.0135e5;
        U U;
          phi phi;
          rho none;
          psi none;
          gamma 1.4; */
          type fixedValue;
          value uniform 54000;   
    }

    outlet         
    {
      type zeroGradient;
        /* type            waveTransmissive;
        value          uniform 8800;
        field          U;
        gamma          1.4;
        phi            phi;
        rho            rho;
        psi            psi;
        lInf            0.01;
        fieldInf        8800; */
       
       
    }

T:
Code:

internalField  uniform 281;

boundaryField
{
    inlet         
    {
        type            fixedValue;
        value          uniform 273;
    }

    outlet         
    {
        type            zeroGradient;
    }

U:
HTML Code:

[CODE]internalField  uniform (260.39 0 0);

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

    outlet         
    {
                type            inletOutlet;
        inletValue      uniform (10 0 0);
        value          uniform (10 0 0);
       

//type            zeroGradient;
        /*type            waveTransmissive;
        value          uniform (10 0 0 );
        field          U;
        gamma          1.4;
        phi            phi;
        rho            rho;
        psi            psi;
        lInf            0.01;
        fieldInf        (10 0 0 ); */
[/CODE]


mihir1310 September 16, 2009 10:55

Code:

solvers
{
    rho  diagonal {};
    rhoU diagonal {};
    rhoE diagonal {};

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

    h smoothSolver
    {
        smoother        GaussSeidel;
        nSweeps          2;
        tolerance        1e-10
        relTol          0;
    };
}

Code:

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;
    div(tauMC) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

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

}

snGradSchemes
{
    default        corrected;
}


Julian K. September 16, 2009 11:33

Thanks Mihir!

However, I am a little bit confused, because you said that you use Minmod for the discretization of the divergent terms and backward for the convective terms.

By the way, are you simulating a CD nozzle, as well?

mihir1310 September 16, 2009 11:35

Quote:

Originally Posted by Julian K. (Post 229697)
Thanks Mihir!

However, I am a little bit confused, because you said that you use Minmod for the discretization of the divergent terms and backward for the convective terms.

By the way, are you simulating a CD nozzle, as well?

ohh i meant you wanted my rhoCenrtalFoam case [which did not work ]

heres for sonicFoam
Code:

ddtSchemes
{
    default backward;         
}

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

divSchemes
{
    default        none;
    div(phi,U)      Gauss Minmod;
    div(phid,p)    Gauss Minmod;
    div(phi,e)      Gauss Minmod;
}

laplacianSchemes
{
    default        none;
    laplacian(mu,U) Gauss linear corrected;
    laplacian(mu,e) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p;

Im simulating outfield of the nozzle . So my inlet is the "nozzle outlet" ..

Julian K. September 16, 2009 11:54

Okay, thanks. I think I'll try your settings. Let's see what it produce.

By the way:
With rhoCentralFoam I noticed that a change of the lInf value (of the waveTransmissive BC) from 0.01, over 0.05, 0.5, 5, 50, 500 and finally 5000 does not have any effect on the result of my simulation. Which is, that the pressure waves are not transmitted across the outlet. Thus, I assume that rhoCentralFoam is (by any reason) not capable to apply the waveTransmissive BC. However, sonicFoam does apply the waveTransmissive BC, and changes of lInf resulted in very different behaviours.

Does anyone know, why a certain BC does not work with a certain solver?

bephi April 21, 2010 05:08

hi at all!
i read all the comments concerning the growing courant nr. problem because mine is the same :)

i set up a case with the icoFoam solver to achieve a first solution which i can improve later with other solver that display the reality better. i took the controlDict, fvSchemes and fvSolutions from the "icoFoam cavity tutorial".
unfortunately not even this simplified calculation works because after round about 8 to 10 time steps the courant nr. is increased to something over e+100 (well i'd say this is a bit more than 1 :) )

first i tried to decrease the time step to 3.5e-6 and change the writeControl to "adjustableRunTime"... but when looked at the runlogs, the timestep didn't change and remained constant.

then i tried to limit the courant number with "maxCo 1", but i read that it doesn't work for "icoFoam", because its a simple solver. is this correct?

do you have any idea, what i can do to achieve a solution that doesn't abort?

joern April 21, 2010 05:25

hi bephi,

try to use bounded schemes like "upwind" or a TVD-Scheme for the div-schemes.

i think the convective terms produce an unbounded solution so you have to limit them.
icofoam solves the NS-Eqs. I haven't testet this solver but i tested simplefoam and there its nearly the same problem.


Joern

bephi April 21, 2010 05:52

hi joern!
thanks a lot for the quick reply!
so you say I should change this:

Code:

ddtSchemes
{
    default        Euler;
}

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

divSchemes
{
    default        none;
    div(phi,U)      Gauss linear;                            // change into "Gauss upwind"
}
laplacianSchemes
{
    default        none;
    laplacian(nu,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
}
interpolationSchemes
{
    default        linear;
    interpolate(HbyA) linear;
}
snGradSchemes
{
    default        corrected;
}
fluxRequired
{
    default        no;
    p;
}

EDIT: i changed it and first my max.Co-Nr. doesn't get over 7! but unfortunately the Co-Nr. increases again after round about 20 timesteps until the calculation ends... an improvement was achieved but what can be changed too?

would it be okay when the mean value of the co-nr. is <1 or should the max Co-Nr <1 as well?


if also needed, here are my files:
p and U starting files:
Code:

dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.000000;
boundaryField
{
symmetry
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform 452.38;
}
outlet
{
type zeroGradient;
}

dimensions [0 1 -1 0 0 0 0];
internalField uniform ( 0.000000 0.000000 -1.000000 );
boundaryField
{
symmetry
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform ( 0.000000 0.000000 -1.000000 );
}
outlet
{
type zeroGradient;
}

controlDict
Code:

application icoFoam;
startFrom      startTime;
startTime      0;
stopAt          endTime;
endTime        1e-3;
deltaT          3.5e-6;
writeControl    adjustableRunTime;
writeInterval  10;
purgeWrite      0;
writeFormat    ascii;
writePrecision  6;
writeCompression uncompressed;
timeFormat      general;
timePrecision  6;
runTimeModifiable yes;
adjustTimeStep    yes;
maxCo        1.0;

fvSchemes
Code:

ddtSchemes
{
    default        Euler;
}
gradSchemes
{
    default        Gauss linear;
    grad(p)        Gauss linear;
}
divSchemes
{
    default        none;
    div(phi,U)      Gauss upwind;
}
laplacianSchemes
{
    default        none;
    laplacian(nu,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
}
interpolationSchemes
{
    default        linear;
    interpolate(U) linear;
}
snGradSchemes
{
    default        corrected;
}
fluxRequired
{
    default        no;
    p;
}

fvSolver
Code:

solvers
{
    p PCG
    {
        preconditioner  DIC;
        tolerance        1e-06;
        relTol          0;
    };
    U PBiCG
    {
        preconditioner  DILU;
        tolerance        1e-05;
        relTol          0;
    };
}
PISO
{
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;
}


joern April 21, 2010 09:16

the max-conum should not be much larger than 1 because the discretisation of OF ist just semi implicit.
the decoupling in OF causes explicit factors.

In my test cases (for my diploma thesis) the solver simplefoam was only stable with maxCoNum<1.5.

Try maxCoNum<1. 7 is too much for OF, i think. That would just work with a full implicit solver.


Add:
If you use "Gauss linear" for all discretisations you get an central that is instable for ALL Delta t.

alberto April 22, 2010 00:53

Quote:

Add:
If you use "Gauss linear" for all discretisations you get an central that is instable for ALL Delta t.
A bit too broad as statement. Central schemes, largely used in LES also for the convective term, are unstable only if the local Péclet number is larger than 2.

Best,

mohsenkh599 April 22, 2010 00:54

help
 
hi everyone
I have a new solver for two-phase modeling. but there is a problem while running any case (dam break for instance). when in ControlDict I put the write interval one second the solution diverge quickly but if I put it .05 second the solution converges. I could not understand how the write interval affects the convergence of the system.
please help as soon as possible

alberto April 22, 2010 00:59

Quote:

Originally Posted by bephi (Post 255596)
if also needed, here are my files:
p and U starting files:
Code:

dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.000000;
boundaryField
{
symmetry
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform 452.38;
}
outlet
{
type zeroGradient;
}

dimensions [0 1 -1 0 0 0 0];
internalField uniform ( 0.000000 0.000000 -1.000000 );
boundaryField
{
symmetry
{
type symmetryPlane;
}
inlet
{
type fixedValue;
value uniform ( 0.000000 0.000000 -1.000000 );
}
outlet
{
type zeroGradient;
}


You are fixing both velocity and pressure and velocity at the inlet for an incompressible flow (you use icoFoam). Let the inlet as is, but fix the pressure at the outlet, and set it to zeroGradient at the inlet.

Best,

alberto April 22, 2010 01:02

Quote:

Originally Posted by mohsenkh599 (Post 255784)
hi everyone
I have a new solver for two-phase modeling. but there is a problem while running any case (dam break for instance). when in ControlDict I put the write interval one second the solution diverge quickly but if I put it .05 second the solution converges. I could not understand how the write interval affects the convergence of the system.
please help as soon as possible

It doesn't :-)

Please open a new thread, and provide more information to increase the chances someone can help.

Best,

bephi April 22, 2010 01:58

Quote:

Originally Posted by alberto (Post 255786)
You are fixing both velocity and pressure and velocity at the inlet for an incompressible flow (you use icoFoam). Let the inlet as is, but fix the pressure at the outlet, and set it to zeroGradient at the inlet.

Best,

hello alberto! thanks for your hint!

you are right that it doesn't make sense to fix pressure and velocity at the inlet! i changed it but now my max. Co-No is increasing again to around about 7... is this a problem?

greets!

joern April 22, 2010 03:38

Quote:

Originally Posted by alberto (Post 255783)
A bit too broad as statement. Central schemes, largely used in LES also for the convective term, are unstable only if the local Péclet number is larger than 2.

Best,

ok, you'r right. but for icoFoam (like simplefoam) a use of Central Schemes lead to da central method.

@bephi:
a maxconum of 7 is now problem as long as your solution is ok ^^
take a look at the results (paraview) if they look physical ok.
or try to calculate a bit longer to look if the solver stays stable.

have you tried smaller timesteps to see if the maxconum stays smaller?

bephi April 22, 2010 05:31

hi!
at the moment my problem is the following:
i calculated a time step of 3.5e-6 s because my highest velocity is 26.83 m/s² and the smalest element lenght is 0.0001m
the fluid needs round about 0.3 to 0.5 s to flow through the model so it would take 100000 steps which is too much in my in opinion.. so i increased the timestep to 0.0003 and after that to 0.00003 but then the co-number increases again until the calculation crashes...

i didn't thought that a simple laminar calculation would be so difficult?! :(

joern April 22, 2010 08:30

if it takes to many steps, try a coarser mesh.
but if your mesh is too fine you need smaller timesteps, thats normal.

are you sure about your max. velocity?
i dont know the eigenvalues of the NS-eqs but for the euler-equations the max. velocity isnt just the max. u, its max.(u+c) with the speed of sound c.

my tip:
try smaller timesteps, you will see if the solver stays stable.


btw: how many cells does your testcase have?

bephi April 22, 2010 08:48

now a calculation with 100 timesteps was successful...i think i'll set up 100 additional steps and look what happens...
when do i know that the solution is converged?

my model has 116112 trias, 622697 tetras and 198870 pentas


All times are GMT -4. The time now is 13:09.