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/)
-   -   why pisoFoam take such a long time to converge? (https://www.cfd-online.com/Forums/openfoam-solving/124845-why-pisofoam-take-such-long-time-converge.html)

izna October 14, 2013 12:38

why pisoFoam take such a long time to converge?
 
Hello

I have a PC with 4GB RAM 2 processors..
Ihave run a simulation with pisoFOam and today is 48 hours since i last start.. and still convergence not acheived..!!

Can anyone give me a better way to acheive convergence easier with pisoFoam?

I am attaching my fv solution just so that you may know what i did..

Quote:


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

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}

pFinal
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
}

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

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

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

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

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

PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}

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


// ************************************************** *********************** //
and my control dict
Quote:

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

application pisoFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 10;

deltaT 0.0005;

writeControl timeStep;

writeInterval 100;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;


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

ngj October 14, 2013 14:50

Good evening,

pisoFoam is intended for transient simulations, which does not necessarily have a steady state solution. Also, to my knowledge, the pisoFoam does not check for the residualControls, which you have in your fvSolution file.

For steady state simulations you would probable want to look into e.g. simpleFoam.

Kind regards,

Niels

izna October 14, 2013 23:56

hi..

simpleFoam is not working at all for the case that running... hence am running with pisoFoam, and its working with pisoFoam.. but taking such a long time!!!!

RodriguezFatz October 15, 2013 04:35

Is this a transient simulation or steady state?

izna October 15, 2013 04:47

steady state..

Quote:


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

ddtSchemes
{
default Euler;
}

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

divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,k) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
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 ;
}


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




RodriguezFatz October 15, 2013 04:55

You are using the wrong solver. You solve for a transient simulation, time-scheme is Euler and your time-step is 0.5ms.
This is not steady-state.

1) Use simpleFoam! Why do you say "simpleFoam is not working at all for the case that running"? SimpleFoam is a steady state solver.
2) Use GAMG solver for pressure.
3) "Linear" discretization doesn't converge very well. You can try some more dissipative scheme (upwind, linearUpwind,...).

izna October 15, 2013 04:59

i already did all that with simpleFoam.. But after 300 timestep my solution crash.. and when i check in paraView, i see my domain as a blueeee one.. ie no velocity has enter... hence why i was soo desperate...:(

RodriguezFatz October 15, 2013 05:01

Then you did it wrong :cool:
Post your simple solver settings and then the residuals.

haakon October 15, 2013 05:03

You have specified Euler to be used as time integrator, hence your simulation is transient. Period.

Anyways, as others have mentioned, pisoFoam will not obey the residual limits you have specified. It will run until it reaches endTime, no matter how steady the simulation are.

If you want a steady-state result then simpleFoam is the one and only solver to use. However, some cases will not converge to a steady state, simply because they are transient by nature. For such cases steady solutions are difficult to obtain, and if you can get one, you are almost certain that it is non-physical. If your case involves geometries and flow conditions leading to for example vortex shedding, that forces you to use a transient solver if you want physical results. That is just how nature works.

(BTW: You can probably get almost any case to converge in steady state by using 1st order upwind schemes (=extreme diffusivity), heavy relaxation and other "stabilizing tricks", but will give you unusable results, so in practice it is not possible...)

izna October 15, 2013 05:04

simple Solver settings..:

Quote:

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

solvers
{
p
{
solver GAMG;
tolerance 1e-7;
relTol 0.1;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}

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

k
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}

epsilon
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 0;
}

potentialFlow
{
nNonOrthogonalCorrectors 10;
}

relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
k 0.7;
omega 0.7;
}
}

cache
{
grad(U);
}

// ************************************************** *********************** //
Quote:

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

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

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

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}

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

izna October 15, 2013 05:07

Quote:

Originally Posted by haakon (Post 457005)
You have specified Euler to be used as time integrator, hence your simulation is transient. Period.

(BTW: You can probably get almost any case to converge in steady state by using 1st order upwind schemes (=extreme diffusivity), heavy relaxation and other "stabilizing tricks", but will give you unusable results, so in practice it is not possible...)

HI

Can you please give me an example where the upwind scheme is 1strorder? me i am simulating 10 shapes in a domain..that is all and its in 2D.. so i guess it should converge normally right??

for 12 days i am with this problem..and with pisoFoam its nto crashing..but today is my 3rd day where simulation is running.. so am a bit desperate now...:(

haakon October 15, 2013 05:16

I guess that probably is just the "upwind" scheme, but I have never used it, as it produces just crap.

Why are you using zero non-orthogonal correctors? Have you tried increasing this value? Why are you only using relaxation for the pressure and not the velocities when running simpleFoam?

I would lie to emphasize a few things:
  1. If your flow is transient, you might never obtain a physical steady-state solution.
  2. Flows are very often transient by nature, even flow around streamlined bodies.
  3. If the simulation crash, the mesh is often sub-optimal, and improving the mesh will give you both increased stability and better results.
If simpleFoam crash, I guess your flow is either transient by nature or you have a bad mesh.

izna October 15, 2013 05:24

my mesh is fine..:(

From the errors it say..
Quote:

Time = 33

--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/izna/Desktop/try/system/fvSchemes.divSchemes.div(phi,U)" at line 30
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam221/etc/controlDict"
smoothSolver: Solving for Ux, Initial residual = 0.0141504, Final residual = 0.000528872, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.00978783, Final residual = 0.000321816, No Iterations 2
GAMG: Solving for p, Initial residual = 0.0065193, Final residual = 0.00049538, No Iterations 2
time step continuity errors : sum local = 6.55324e+42, global = -3.32349e+37, cumulative = -3.32349e+37
--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/izna/Desktop/try/system/fvSchemes.divSchemes.div(phi,epsilon)" at line 32
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam221/etc/controlDict"
smoothSolver: Solving for epsilon, Initial residual = 1, Final residual = 0.982312, No Iterations 1000
bounding epsilon, min: -1.00779e+95 max: 4.55336e+109 average: 2.7097e+104
--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/izna/Desktop/try/system/fvSchemes.divSchemes.div(phi,k)" at line 31
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam221/etc/controlDict"
smoothSolver: Solving for k, Initial residual = 1.94401e-15, Final residual = 1.94401e-15, No Iterations 0
ExecutionTime = 289.79 s ClockTime = 290 s

Time = 34

--> FOAM Warning :
From function gaussConvectionScheme
in file finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H at line 123
Reading "/home/izna/Desktop/try/system/fvSchemes.divSchemes.div(phi,U)" at line 30
Unbounded 'Gauss' div scheme used in steady-state solver, use 'bounded Gauss' to ensure boundedness.
To remove this warning switch off 'boundedGauss' in "/opt/openfoam221/etc/controlDict"
smoothSolver: Solving for Ux, Initial residual = 0.533739, Final residual = 0.0426003, No Iterations 2
smoothSolver: Solving for Uy, Initial residual = 0.492054, Final residual = 0.0310399, No Iterations 4
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::GAMGSolver::scale(Foam::Field<double>&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::FieldField<Foam::Field, double> const&, Foam::UPtrList<Foam::lduInterfaceField const> const&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 Foam::GAMGSolver::Vcycle(Foam::PtrList<Foam::lduMa trix::smoother> const&, Foam::Field<double>&, Foam::Field<double> const&, Foam::Field<double>&, Foam::Field<double>&, Foam::Field<double>&, Foam::PtrList<Foam::Field<double> >&, Foam::PtrList<Foam::Field<double> >&, unsigned char) const in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#5 Foam::GAMGSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#6 Foam::fvMatrix<double>::solveSegregated(Foam::dict ionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#7 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#8
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
#9 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#10
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/simpleFoam"
Floating point exception (core dumped)
izna@izna-System-Product-Name:~/Desktop/try$



RodriguezFatz October 15, 2013 05:26

Can you post the residual plot?
1) What happens, if you set "relTol" for the pressure to 1.0e-3? Do the residuals change?
2) What happens, if you use some gradient limiter? Such as
Code:


gradSchemes
{
    default            faceLimited edgeCellsLeastSquares 1;
}

3) Write "bounded" at each div(phi,xxx)
Code:


...
div(phi,k)      bounded Gauss upwind;


izna October 15, 2013 15:12

am sorry for late reply.. but for each of the above mentioned points. My solution crash..
Now am worried....:(

RodriguezFatz October 16, 2013 04:23

Can you send the whole log-output? So we can try to find the spot...

izna October 17, 2013 13:59

hi..afte changing the fv solution and fv schemes.. I obtain a good simulation which i checked..

.. when arriving at 1760 iteration the solution crashed.. and when i checked in paraView.. I obtain a blue domain..
Why such a nice simulation suddenly crash ?

RodriguezFatz October 18, 2013 02:05

You have to share all relevant data, otherwise no one will be able to help you.

1) log output
2) boundary condition files
3) screenshot of your domain with grid.

Additionally: It seems you use the k-epsilon model. In your fvSolution file you set relaxation factors, but not for k-epsilon but for k-omega. This could be the reason.

DaSh October 18, 2013 03:26

Hi all,

I have a question which is close to the topic. Niels said above, that pisoFoam does not check for residualControls.

Does that mean, that when running a transient turbulent simulation on pisoFoam, the residual output does not indicate the state of convergence of my simulation?

I have the problem at the moment with my simulation. The residual is not dropping anymore, so I have no convergence. (It is LES of Taylor Couette Flow). I use backward time scheme and gauß upwind for U divscheme. My schemes should be fine.

After reading this thread I am just worrying, that the solver is not able to produce what I want.

Can anybody comment on this?

Thx!
Danesh

haakon October 18, 2013 03:38

You are correct. pisoFoam does not obey the residual controls. This is because the solution is time-accurate, i.e. every step is a valid solution of the transient problem. Hence, each step is solved until the specified tolerance level in fvSolution, and not further. Then the time is advances and a new solution is found. The value of the time step is hence important, as the PISO-algorithm cannot handle large time steps.

Remember my earlier comments on fluid flows that generally are transient by nature. I do not feel that you have clearly out-ruled this issue yet.


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