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/)
-   -   Time step continuity (https://www.cfd-online.com/Forums/openfoam-solving/58297-time-step-continuity.html)

anja January 18, 2006 09:05

Hi, does someone know how t
 
Hi,

does someone know how to solve "time step continuity errors" ??


Thanks a lot,
Anja

hjasak January 18, 2006 09:23

How big are they? They are rel
 
How big are they? They are related to the pressure solver tolerance and you should be able to squeeze them by converging the pressure more tightly. If this doesn't work, you've probably messed up the boundary conditions.

Hrv

anja January 18, 2006 09:36

For example: time step contin
 
For example:
time step continuity errors :
sum local = 1.05535e-08, global = 1.65393e-14, cumulative = -9.944e-11

What exactly do you mean by converging the pressure more tightly?

Anja

hjasak January 18, 2006 09:41

This does not worry me at all:
 
This does not worry me at all: it says your global continuity error is 1e-14, which is the double precision round-off error, the sum local tells me that in the line above your pressure solver has converged to about 1e-8; in other words, all is well.

Nothing to worry about here.

Hrv

anja January 18, 2006 09:49

Okay then. I was searching
 
Okay then.

I was searching a reason for the very long duration time of the calculation, which I have just launched. Every single time step takes around 10 minutes and before I didn't get an error message for this case.
I try to calculate an incompressible, laminar flow through a s-shaped tube.

Anja

hjasak January 19, 2006 04:22

Hi Anja, It sounds to me as
 
Hi Anja,

It sounds to me as if you need to tune the solver. For a steady-state laminar flow, I would use simpleFoam with the "laminar" turbulence model. You can then play around with under-relaxation factors, convergence parameters and discretisation to get a decent result. 10 mins per iteration is massively too much, unless you're trying to do a couple of million cells of a single-CPU machine.

Is your mesh hexahedral or tetrahedral or mixed? How many cells, any problems reported by checkMesh? Do you have some fancy boundary conditions? Which solver are you using? Can you post the output from a single iteration (the one that takes 10 mins) - I'll have a look and see if there's somethign obvious I can suggest.

Hrv

anja January 20, 2006 06:59

The mesh consists of 386106 he
 
The mesh consists of 386106 hexahedral cells.
Not one problem was reported by checkMesh.

The boundary conditions are:
wall; physicalType wall; p=zeroGradient; U=0 0 0
inlet;physicalType inlet; p=zeroGradient; U=4 0 0
outlet;physicalType outlet; p=0; U=zeroGradient

I used icoFoam.

Time = 0.0002

Mean and max Courant Numbers = 0.0186142 0.789515
BICCG: Solving for Ux, Initial residual = 0.403172, Final residual = 1.85342e-06, No Iterations 3
BICCG: Solving for Uy, Initial residual = 0.334868, Final residual = 5.72366e-07, No Iterations 3
BICCG: Solving for Uz, Initial residual = 0.30369, Final residual = 1.64811e-06, No Iterations 3
ICCG: Solving for p, Initial residual = 0.0138496, Final residual = 9.63037e-07, No Iterations 851
ICCG: Solving for p, Initial residual = 0.128861, Final residual = 9.18745e-07, No Iterations 858
ICCG: Solving for p, Initial residual = 0.0693657, Final residual = 9.58556e-07, No Iterations 849
time step continuity errors : sum local = 1.16673e-07, global = 1.2324e-10, cumulative = -8.26334e-11
ICCG: Solving for p, Initial residual = 0.0237425, Final residual = 8.75212e-07, No Iterations 855
ICCG: Solving for p, Initial residual = 0.164026, Final residual = 8.78886e-07, No Iterations 856
ICCG: Solving for p, Initial residual = 0.0716675, Final residual = 9.91469e-07, No Iterations 850
time step continuity errors : sum local = 2.52566e-08, global = 1.38281e-12, cumulative = -8.12506e-11
ExecutionTime = 641.55 s

It would be really great, if you could help me.
Anja

hjasak January 20, 2006 07:23

Hehe, a perfect candidate :-)
 
Hehe, a perfect candidate :-)

The time of simulation is all spent in the pressure solver, which is doing way too many iterations (6 times 800). Secondly, it looks like the non-orthogonal pressure correctors are not converging and PISO is not too happy either.

Try the following:
- use the AMG solver on the pressure
- try changing the discretisation of the pressure laplacian from Gauss linear corrected to Gauss linear limited
- reduce the number of non-orthogonal correctors to 1
- run checkMesh and report the non-orthogonality problems it reports (is the mesh really that bad?).

This should be relatively easy to fix.

Hrv

anja January 20, 2006 08:10

I can't find a tutorial using
 
I can't find a tutorial using the AMG solver.
What about: AMG 1e-06 0 0 ??

And for the laplacian scheme:
Gauss linear limited 1 ??

Concerning the checkMesh:
Mesh non-orthogonality Max: 39.6288 average: 8.72216
Non-orthogonality check OK.

hjasak January 20, 2006 08:24

Try: Gauss linear limited 1
 
Try:

Gauss linear limited 1;

p AMG 1e-06 0 100;

(the last number is the number of equations on the top level)

The mesh is good, looks like the CG is struggling a bit. I am really interested, please let me know if the AMG helps. Are you running on one CPU or in parallel?

Hrv

anja January 20, 2006 08:38

Gauss linear limited 1; s
 
Gauss linear limited 1;

solvers
p AMG 1e-06 0 100;
U BICCG 1e-05 0;

PISO
//momentumPredictor yes;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
//pRefCell 0;
//pRefValue 0;
//fluxGradp yes;
(These // I also had before, but now it's only nCorrectors; nNonOrthogonalCorrectors)


Here some excerpts:
Time = 0.0003; ExecutionTime = 258.17 s
Time = 0.0005; ExecutionTime = 378.72 s
Time = 0.0008; ExecutionTime = 547.68 s

What do you think?

hjasak January 20, 2006 13:16

Better, huh? :-) How much w
 
Better, huh? :-)

How much work does the AMG do? I think you're in business now...

Good luck,

Hrv

newbee May 11, 2006 07:50

Hello! I have had the same
 
Hello!

I have had the same problem as mentioned above, with many pressure itterations, but have had higher sum local and global values (about e-4). The print out looks like the following for a time step:

Time = 0.1

BICCG: Solving for Ux, Initial residual = 1, Final residual = 0.0164738, No Iterations 1
BICCG: Solving for Uy, Initial residual = 1, Final residual = 0.0138657, No Iterations 1
BICCG: Solving for Uz, Initial residual = 1, Final residual = 0.00943703, No Iterations 1
ICCG: Solving for p, Initial residual = 1, Final residual = 0.0871697, No Iterations 2223
time step continuity errors : sum local = 0.000278016, global = -1.48514e-06, cumulative = -1.48514e-06
BICCG: Solving for epsilon, Initial residual = 1, Final residual = 0.0117474, No Iterations 1
BICCG: Solving for k, Initial residual = 1, Final residual = 0.000467489, No Iterations 1
Creating alphaEff.
BICCG: Solving for T, Initial residual = 1, Final residual = 0.0442807, No Iterations 43
ExecutionTime = 65.31 s

Then I tried to modify it like it is said above and get the following print out (i.e. higher sum local and global values):

Time = 0.1

BICCG: Solving for Ux, Initial residual = 1, Final residual = 0.0164738, No Iterations 1
BICCG: Solving for Uy, Initial residual = 1, Final residual = 0.0138657, No Iterations 1
BICCG: Solving for Uz, Initial residual = 1, Final residual = 0.00943703, No Iterations 1
AMG: Solving for p, Initial residual = 1, Final residual = 2.66915, No Iterations 501
AMG: Solving for p, Initial residual = 0.416487, Final residual = 0.342388, No Iterations 501
time step continuity errors : sum local = 0.0087574, global = -8.70409e-05, cumulative = -8.70409e-05
BICCG: Solving for epsilon, Initial residual = 1, Final residual = 0.011749, No Iterations 1
BICCG: Solving for k, Initial residual = 1, Final residual = 0.000470466, No Iterations 1
Creating alphaEff.
BICCG: Solving for T, Initial residual = 1, Final residual = 0.0710206, No Iterations 43
BICCG: Solving for T, Initial residual = 0.0572284, Final residual = 0.00546826, No Iterations 29
ExecutionTime = 101.47 s

I have also checked the mesh and the only thing wrong with it was that trere were 4 points that wasn't in use and put into an according file. But stil I have to many itterations for the pressure.

Thankfull for help
/Erik

holger March 7, 2007 07:37

Hello. I also have a problem
 
Hello.
I also have a problem with these continuity errors. I am running a modified simpleFoam case, where a liquid is streaming through a small cylinder into a bigger one, driven by the bodyforce and an inlet-velocity. The time step continuity errors are rising, and after 10 iterations they are about 10^11. When I run the same case without the small inlet-cylinder, everything is fine and the error is about 10^-9. also when I take the mesh with the small cylinder, but set g=0m/sē the error stays small. I have allready tried a lot of combinations for solvers, bc and relaxation factors.
my mesh has about 1.2million cells.
do you have any suggestions?
hoping for your help,

http://www.cfd-online.com/OpenFOAM_D...ges/1/3950.jpg

hjasak March 7, 2007 07:45

Yes. Check your boundary cond
 
Yes. Check your boundary condition on that additional inlet. My guess is that you have specified both the pressure and the velocity at the boundary, which will give you a continuity error.

Let me know,

Hrv

holger March 7, 2007 08:07

Thank you for your quick reply
 
Thank you for your quick reply.
I have checked, but at the inlet (there is only one at the top of the smaller cylinder) I have only specified the velocity with 0.1m/s. pressure is fixed gradient because the bc is only inlet.
Maybe there is a missunderstanding on my side.

greetings, Holger

hjasak March 7, 2007 08:13

Yup. Put zero gradient on the
 
Yup. Put zero gradient on the pressure and the continuity error will go away. The fixed gradient b.c. gives you additional flux which is not accounted for in the continuity equation.

Hrv

holger March 7, 2007 08:36

I'm sorry. I meant zero gradie
 
I'm sorry. I meant zero gradient. the top of the small cylinder has p zero gradient.
what I am really wondering about is that everything works when I take away the small one and take the top of the big cylinder as an inlet. I have simulated several other geometries with this modified simpleFoam solver, but this is the only one where I get an error.

holger March 8, 2007 02:54

I now created a inlet on the
 
I now created a inlet on the top of the big cylinder and took the small cylinder away. But these big continuity errors stay. and now, after the 6 iteration the simulation just stops. there is no error-message, its just doing nothing. is there any connection between the number of cells included in the inlet and the continuity error?

Error-Log:

Create mesh for time = 0


Reading environmentalProperties
Reading field p

Reading field U

Reading transportProperties

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model laminar

Starting time loop

Time = 1

BICCG: Solving for Ux, Initial residual = 1, Final residual = 0.0191738, No Ite rations 2
BICCG: Solving for Uy, Initial residual = 1, Final residual = 0.0230878, No Ite rations 2
BICCG: Solving for Uz, Initial residual = 1, Final residual = 0.0119195, No Ite rations 2
AMG: Solving for p, Initial residual = 1, Final residual = 0.0210672, No Iterat ions 5
AMG: Solving for p, Initial residual = 0.151581, Final residual = 0.00186491, N o Iterations 2
AMG: Solving for p, Initial residual = 0.0159399, Final residual = 0.000486127, No Iterations 2
AMG: Solving for p, Initial residual = 0.00352732, Final residual = 0.000146953, No Iterations 2
time step continuity errors : sum local = 0.235539, global = -0.0450524, cumulative = -0.0450524
ExecutionTime = 78.6 s ClockTime = 78 s
.
.
.
.
Time = 5

BICCG: Solving for Ux, Initial residual = 0.327544, Final residual = 0.00769073
BICCG: Solving for Uy, Initial residual = 0.378132, Final residual = 0.0157606,
BICCG: Solving for Uz, Initial residual = 0.330114, Final residual = 0.0149679,
AMG: Solving for p, Initial residual = 0.479773, Final residual = 0.0159471, No
AMG: Solving for p, Initial residual = 0.846998, Final residual = 0.00354764, N
AMG: Solving for p, Initial residual = 0.137398, Final residual = 0.00187623, N
AMG: Solving for p, Initial residual = 0.0499261, Final residual = 0.00105473,
time step continuity errors : sum local = 9.61023, global = 3.38102, cumulative
ExecutionTime = 390.55 s ClockTime = 391 s

Time = 6

BICCG: Solving for Ux, Initial residual = 0.284414, Final residual = 0.0203337,
BICCG: Solving for Uy, Initial residual = 0.318962, Final residual = 0.0192187,
BICCG: Solving for Uz, Initial residual = 0.315278, Final residual = 0.0149193,

New Geometry http://www.cfd-online.com/OpenFOAM_D...ges/1/3961.jpg


greetings,
Holger

cedric_duprat July 10, 2007 14:17

hi all, a the title said ....
 
hi all,
a the title said .... I've got also a time step continuity errors ...following with

--> FOAM FATAL IO ERROR : IOstream::check(const char* operation) : error in IOstream
for operation Ostream& operator<<(Ostream&, const Scalar&)
From function IOstream::check(const char* operation) const
in file db/IOstreams/IOstreams/IOcheck.C at line 54.


well ... Foam is very talkative this evening.
So, I checked my mesh, Non-orthogonality check OK.
I changed my solver on the pressure to AMG (with same caracteristic as upper message)
and then, ...It hasn't changed anything:
Mean and max Courant Numbers = 0 0.0488421
Updating boundary gradient of U::outlet by Euler and normal schemes
Saving old-time boundary values of U::outlet
Boundary gradient of U::outlet has already been updated
Boundary gradient of U::outlet has already been updated
BICCG: Solving for Ux, Initial residual = 1, Final residual = 2.872e-07, No Iterations 1
BICCG: Solving for Uy, Initial residual = 1, Final residual = 2.87335e-07, No Iterations 1
BICCG: Solving for Uz, Initial residual = 1, Final residual = 5.11098e-07, No Iterations 1
AMG: Solving for p, Initial residual = 1, Final residual = 0.502698, No Iterations 501
time step continuity errors : sum local = 7.44298e-06, global = -1.76024e-08, cumulative = -1.76024e-08
Updating boundary gradient of U::outlet by Euler and normal schemes
AMG: Solving for p, Initial residual = 0.000116257, Final residual = 6.94937e-05, No Iterations 501
time step continuity errors : sum local = 8.05415e-06, global = 1.43586e-11, cumulative = -1.7588e-08
Updating boundary gradient of U::outlet by Euler and normal schemes


PS: I created my mesh with BlockMesh, using only hexa and, CheckMesh found 4 tetra mesh, it's quite strange, isn't ?

any ideas of what else I can check to solve this ...very small problem?
thanks,

Cedric


All times are GMT -4. The time now is 06:38.