|
[Sponsors] |
SimpleFoam crashes after restarting simulation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 26, 2016, 13:12 |
SimpleFoam crashes after restarting simulation
|
#1 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
Hello everyone, I'm having problems when restarting a SimpleFoam simulation.
I'm modelling the spiral case of a Kaplan Turbine with laminar simpleFoam. I stopped the simulation after 800 iterations to check the partial results, but when I restarted it, after a few iterations, it crashes. No matter from when I restart it (iteration number 500, 600 or 800), it crashes. I don't know what's happening, it doesn't make sense to me. Why can I simulate from 0 to 800 but can't from 700 to 800? I copy a the output from the restarted simulation. Thanks Time = 10 smoothSolver: Solving for Ux, Initial residual = 0.962422, Final residual = 0.048133, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.915385, Final residual = 0.0453896, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.710173, Final residual = 0.0365221, No Iterations 1 GAMG: Solving for p, Initial residual = 0.968003, Final residual = 0.00640378, No Iterations 1 time step continuity errors : sum local = 2.83562, global = -0.0113787, cumulative = -0.0488717 ExecutionTime = 79.84 s ClockTime = 88 s Time = 11 smoothSolver: Solving for Ux, Initial residual = 0.979397, Final residual = 0.0588178, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.98346, Final residual = 0.0547121, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.68809, Final residual = 0.028108, No Iterations 2 GAMG: Solving for p, Initial residual = 0.993474, Final residual = 0.0123613, No Iterations 1 time step continuity errors : sum local = 653.325, global = 1.09582, cumulative = 1.04695 ExecutionTime = 85.94 s ClockTime = 95 s Time = 12 smoothSolver: Solving for Ux, Initial residual = 0.15849, Final residual = 0.00511335, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.31582, Final residual = 0.0102091, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.160476, Final residual = 0.00346714, No Iterations 1 GAMG: Solving for p, Initial residual = 0.999085, Final residual = 0.000542365, No Iterations 1 time step continuity errors : sum local = 16443.1, global = 2.23306, cumulative = 3.28001 ExecutionTime = 92.54 s ClockTime = 102 s Time = 13 smoothSolver: Solving for Ux, Initial residual = 0.992432, Final residual = 0.0123749, No Iterations 6 smoothSolver: Solving for Uy, Initial residual = 0.981876, Final residual = 0.0226122, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 0.99753, Final residual = 0.0208188, No Iterations 6 GAMG: Solving for p, Initial residual = 0.999839, Final residual = 0.0847474, No Iterations 2 time step continuity errors : sum local = 7.33678e+11, global = -1.08603e+09, cumulative = -1.08603e+09 ExecutionTime = 101.25 s ClockTime = 111 s Time = 14 smoothSolver: Solving for Ux, Initial residual = 0.249819, Final residual = 0.010744, No Iterations 9 smoothSolver: Solving for Uy, Initial residual = 0.322246, Final residual = 0.0300892, No Iterations 9 smoothSolver: Solving for Uz, Initial residual = 0.262044, Final residual = 0.00209802, No Iterations 9 [2] #0 Foam::error:rintStack(Foam::Ostream&) at ??:? |
|
August 29, 2016, 08:23 |
|
#2 |
Senior Member
matej forman
Join Date: Mar 2009
Location: Brno, Czech Republic
Posts: 182
Rep Power: 17 |
Hi,
your continuity errors are way to high. Can you post last 3 iterations log from the first run - so close to those 600 or whatever? Are there any error or warning messages in the log file at the restart? To help you, we need more information |
|
August 30, 2016, 03:35 |
|
#3 | |
Member
Giovanni Caramia
Join Date: Mar 2009
Location: Bari, ITALY
Posts: 58
Rep Power: 17 |
I think this post could help, even if I do not understand why other software (i.e. fluent) do not have this problem.
Quote:
|
||
August 30, 2016, 08:46 |
|
#4 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
In my solver I took care of this by testing and restoring case and testing the flux construction. I save all the relevant data that is needed for flux computation. I also did lots of testing around it. In ccm, Milovan Peric commented that fluxes are saved. (I cant confirm but quite possible). I guess fluent also does that. |
||
August 31, 2016, 06:33 |
|
#5 |
Member
Giovanni Caramia
Join Date: Mar 2009
Location: Bari, ITALY
Posts: 58
Rep Power: 17 |
Can you detail how you saved all the relevant data needed for flux computation?
|
|
August 31, 2016, 09:29 |
|
#6 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
||
August 31, 2016, 09:37 |
|
#7 |
Senior Member
matej forman
Join Date: Mar 2009
Location: Brno, Czech Republic
Posts: 182
Rep Power: 17 |
fluxes are stored in OpenFOAM automatically into a file called phi and it is saved every time the results (variable fields) are written, based on your settings in controlDict.
|
|
September 1, 2016, 18:42 |
|
#8 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
Thank you everyone for your replies.
OF saves U, p, phi, k, omega, nut, and information about the time (I'm also trying to simulate with k-omega sst and still having the same problems). Here i post the the last 3 iterations of the 1st simulation. Time = 818 smoothSolver: Solving for Ux, Initial residual = 0.000320485, Final residual = 1.05181e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000564055, Final residual = 1.81788e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.000376765, Final residual = 1.23029e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0115165, Final residual = 0.00101956, No Iterations 1 time step continuity errors : sum local = 0.000211661, global = 4.46972e-06, cumulative = -0.00551074 ExecutionTime = 5382.01 s ClockTime = 5780 s Time = 819 smoothSolver: Solving for Ux, Initial residual = 0.000320814, Final residual = 1.0521e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000564596, Final residual = 1.81531e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.00037613, Final residual = 1.22764e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0115504, Final residual = 0.00101698, No Iterations 1 time step continuity errors : sum local = 0.000211067, global = 3.58251e-06, cumulative = -0.00550716 ExecutionTime = 5388.67 s ClockTime = 5787 s Time = 820 smoothSolver: Solving for Ux, Initial residual = 0.000321059, Final residual = 1.05238e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000564844, Final residual = 1.81341e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.000375526, Final residual = 1.2257e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0115567, Final residual = 0.00100844, No Iterations 1 time step continuity errors : sum local = 0.000209301, global = 2.91079e-06, cumulative = -0.00550425 ExecutionTime = 5395.31 s ClockTime = 5794 s End Finalising parallel run As you can see, after 820 simulations everything goes ok, until I restart it from there, and then it crashes. This is what I get after restarting it Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model Newtonian Selecting turbulence model type RAS Selecting RAS turbulence model kOmegaSST Selecting patchDistMethod meshWave kOmegaSSTCoeffs { alphaK1 0.85; alphaK2 1; alphaOmega1 0.5; alphaOmega2 0.856; gamma1 0.555556; gamma2 0.44; beta1 0.075; beta2 0.0828; betaStar 0.09; a1 0.31; b1 1; c1 10; F3 false; } No MRF models present No finite volume options present Starting time loop Time = 801 smoothSolver: Solving for Ux, Initial residual = 0.000790055, Final residual = 2.05318e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000984961, Final residual = 2.61955e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.000884717, Final residual = 2.30055e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0698154, Final residual = 0.00365017, No Iterations 1 time step continuity errors : sum local = 0.000832692, global = 1.91372e-05, cumulative = 1.91372e-05 ExecutionTime = 12.81 s ClockTime = 19 s Time = 802 smoothSolver: Solving for Ux, Initial residual = 0.000688422, Final residual = 1.86906e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000882222, Final residual = 2.441e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.000765998, Final residual = 2.07898e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.07493, Final residual = 0.00453133, No Iterations 1 time step continuity errors : sum local = 0.00102426, global = 2.26965e-05, cumulative = 4.18337e-05 ExecutionTime = 18.52 s ClockTime = 26 s Time = 803 smoothSolver: Solving for Ux, Initial residual = 0.000705414, Final residual = 1.83616e-05, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.000825338, Final residual = 2.39412e-05, No Iterations 1 smoothSolver: Solving for Uz, Initial residual = 0.000720684, Final residual = 1.99926e-05, No Iterations 1 GAMG: Solving for p, Initial residual = 0.0739444, Final residual = 0.00479078, No Iterations 1 time step continuity errors : sum local = 0.00108424, global = 2.5133e-05, cumulative = 6.69667e-05 ExecutionTime = 25.15 s ClockTime = 33 s .... .... .... Time = 808 smoothSolver: Solving for Ux, Initial residual = 0.345719, Final residual = 0.00366349, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.305441, Final residual = 0.00244467, No Iterations 2 smoothSolver: Solving for Uz, Initial residual = 0.20039, Final residual = 0.00564311, No Iterations 2 GAMG: Solving for p, Initial residual = 0.966631, Final residual = 0.00113559, No Iterations 1 time step continuity errors : sum local = 0.204525, global = 0.000103407, cumulative = 0.000276406 ExecutionTime = 57.07 s ClockTime = 69 s Time = 809 smoothSolver: Solving for Ux, Initial residual = 0.382023, Final residual = 0.034568, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 0.649371, Final residual = 0.00312891, No Iterations 3 smoothSolver: Solving for Uz, Initial residual = 0.181243, Final residual = 0.00775396, No Iterations 1 GAMG: Solving for p, Initial residual = 0.993609, Final residual = 0.0498776, No Iterations 1 time step continuity errors : sum local = 31.2167, global = -0.0310831, cumulative = -0.0308067 ExecutionTime = 63.88 s ClockTime = 76 s Time = 810 smoothSolver: Solving for Ux, Initial residual = 0.21656, Final residual = 0.00203398, No Iterations 4 smoothSolver: Solving for Uy, Initial residual = 0.194797, Final residual = 0.000722102, No Iterations 4 smoothSolver: Solving for Uz, Initial residual = 0.209902, Final residual = 0.00722279, No Iterations 4 GAMG: Solving for p, Initial residual = 0.980103, Final residual = 0.0850555, No Iterations 1 time step continuity errors : sum local = 262749, global = -6.0681, cumulative = -6.0989 ExecutionTime = 71.64 s ClockTime = 84 s ... And then it crashes. Any idea OF experts? Thanks |
|
September 1, 2016, 18:59 |
|
#9 |
Senior Member
matej forman
Join Date: Mar 2009
Location: Brno, Czech Republic
Posts: 182
Rep Power: 17 |
Now the first think I can see is that you are solving the flow with the k-omega model, it is in the log file written, but the lines for omega and k are not in the output from the solver so it looks like output from laminar flow solution.
Otherwise, the residuals look really nice ofter the first run. How are the values? Reasonable flow-field? It is very hard to judge with these info. I never met behaviour like this. Just out of interest, what version of OF are you using? Do you have any probes or other monitoring with function objects to get more information? |
|
September 1, 2016, 22:25 |
|
#10 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
If we assume that fluxes are stored and retrieved then the turbulent viscosity is second suspect. Other than that there is nothing in momentum equation that should make residual go up as everything else is computed during iteration. |
||
September 2, 2016, 06:22 |
|
#11 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
This calculation is saved after 100 iterations and restarted then to convergence.
This is how residuals should look upon restart if things are properly restored. There are two plots, one with laminar and one with k omega model. In the second case Omega shows a bit of jump in residuals but rest are okay. Omega residuals only jumps a bit and not 2 or 3 times. NOTE: This is not openFOAM |
|
September 2, 2016, 10:52 |
|
#12 |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
Dear Matej, OF (3.0) isn't calculating k and omega because I turned turbulence off in constant/turbulenceProperties. The simulation has a reasonable result, moreover, if I let it run without stopping it, it converges with residuals smaller than e-4.
This behavior is quite annoying, because when I use a finer mesh and want to use mapFields, it works like it's starting from an older simulation and diverges. Also never happened to me before with other solvers. |
|
September 2, 2016, 11:56 |
|
#13 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
The best way to handle this situation where a simulation is started from mapped field is that an intialization iteration should take place. In this only pressure is corrected and velocities are made divergence free. Then on this pressure field and velocity field other variables should go through 1 iteration that adjust their values for given velocity and pressure field. After this iterations should start. I feel in openFOAM initialization is not given enough time in both development and testing. Initialization is quite important aspect. It can make or break an simulation. |
||
September 2, 2016, 15:44 |
|
#14 | |
Member
Federico Zabaleta
Join Date: May 2016
Posts: 47
Rep Power: 10 |
Quote:
I've never heard about this technique before. How do you do that? Setting tolerance of U,k and omega to 1 in fvSolution and doing 1 iteration, and then setting tolerance of p to 1 and doing another iteration? Thank you |
||
September 2, 2016, 22:03 |
|
#15 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
In starccm+ there is something called continuity initialization that is an example of this what I wrote. In openFOAM, if your calculation starting from very first iteration then try very very small momentum under-relaxation for first 1 or 2 iterations. That would make sure that velocities are not changed due to momentum solve and continuity solve only touches them. |
||
September 3, 2016, 10:26 |
|
#16 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Have you tried using the binary file format for storing the results? This might help.
|
|
September 3, 2016, 11:34 |
|
#17 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
||
September 4, 2016, 09:02 |
|
#18 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
It is set in controlDict:
http://cfd.direct/openfoam/user-guide/controldict/ writeFormat Specifies the format of the data files.
|
|
September 4, 2016, 09:59 |
|
#19 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,290
Rep Power: 34 |
Quote:
writePrecision 6; is too low. It would be interesting to see how binary behaves. |
||
Tags |
restart, simplefoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
simpleFoam crashes (CFDSupport port of OpenFOAM for Windows) | mqsim | OpenFOAM Running, Solving & CFD | 5 | June 30, 2016 03:31 |
Simulation of Radial Fan with simpleFoam MRF | nash | OpenFOAM Running, Solving & CFD | 2 | November 5, 2015 11:12 |
Simulation seems to converge but crashes suddenly | xxxx | OpenFOAM | 16 | September 12, 2014 09:07 |
Temperature linearly rising after restarting a simulation | Gennaro | OpenFOAM Programming & Development | 2 | September 2, 2014 08:58 |
Problem restarting a simulation from an intermediate point. | sergiorbrett | CFX | 2 | April 21, 2010 18:11 |