|
[Sponsors] |
March 8, 2021, 14:56 |
Crash between two Info statements
|
#1 |
New Member
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8 |
Hi all,
I have been struggling with an error for a few days and I don't know what to check anymore. In my createFields.H, I have 2 lines: Code:
Info << "Correcting model " << nl; Info << "test1" << nl; Code:
Correcting model ... Thanks in advance for your answers. Last edited by Roxxor91; March 8, 2021 at 16:30. |
|
March 8, 2021, 15:56 |
|
#2 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Umm, I am puzzled as well ... your first Info line prints "Correcting model", which is not the same as the line that you say it gets to ("Creating constitutive model") ... perhaps it is crashing elsewhere?
|
|
March 8, 2021, 16:30 |
|
#3 | |
New Member
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8 |
Quote:
I corrected in my post, and what I said remains valid though. |
||
March 8, 2021, 16:36 |
|
#4 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
Okay - that is strange then. It might be helpful to see what comes before after the two lines that you included. There is surely no memory problem with printing lines to Info, so I wonder whether the second line is buffered for output, but didn't get printed before the run stopped. Are you running this serial or parallel?
You could always try putting an exit(0) line after the second line & recompile, to force the code to stop and flush the buffer - that will tell you if it made it past the second line or not. Otherwise, there must be something else that is causing the problem. |
|
March 8, 2021, 17:22 |
|
#5 | |
New Member
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8 |
Quote:
I have changed some lines in the code, and now I am able to run the simulation a bit further. Although I cannot confirm at 100% there was no division by 0, if there actually was then the crash would not occur between two Info statements.. So a bit of an update: I am able to run the simulation up to a certain point. With my fine mesh and a CFL of 0.3, it crashes at Code:
Time Step =26 deltaT = 6.495373218822619e-05 s Time = 0.001688669040940589 s Simulation completed = 84.433% - Clock = 14s Post Processing ... L2errorLM = 0.03768430191941113 L2errorP_ = 0.0218538063768106 Time Step =27 deltaT = 6.49543441287486e-05 s Time = 0.001753623385069337 s Code:
Time Step =26 deltaT = 4.329966609208541e-05 s Time = 0.001125754647590129 s Simulation completed = 56.288% - Clock = 14s Post Processing ... L2errorLM = 0.02622370505848511 L2errorP_ = 0.007653927455782624 Time Step =27 deltaT = 4.32998451625767e-05 s Time = 0.001169054492752705 s Code:
Time Step =26 deltaT = 2.164901948667259e-05 s Time = 0.0005628702820208933 s Simulation completed = 28.144% - Clock = 13s Time Step =27 deltaT = 2.164904018477349e-05 s Time = 0.0005845193222056668 s The folllowing is the code snippet where it crashes, including the time loop: Code:
while (runTime.loop()) { if (timeStepping == "variable") { stretch = mech.stretch(); scalar minStretch = GREAT; forAll(stretch, n) { if (stretch[n] < minStretch) { minStretch = stretch[n]; } } deltaT = (cfl*h)/(model.Up()/minStretch); runTime.setDeltaT(deltaT); //Info << "minimum stretch: " << minStretch << nl; } t += deltaT; tstep++; Info << "\nTime Step =" << tstep << "\n deltaT = " << deltaT.value() << " s" << "\n Time = " << t.value() << " s" << endl; x.oldTime(); xw.oldTime(); You can notice that I crash always at the same iteration, how weird is this ? |
||
March 9, 2021, 17:35 |
|
#6 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
||
March 14, 2021, 11:25 |
|
#7 |
New Member
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8 |
||
March 14, 2021, 12:18 |
|
#8 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14 |
... and it always crashes on iteration 27? Are you storing in memory data from each iteration? I am wondering whether one of your arrays is going out of bounds ... otherwise, difficult to comment further without seeing all the code.
If you have the patience, you could compile it with debugging, and run a debugger to see exactly what is happening. Not a quick task, but it might provide a way out ... again, good luck. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] gmshToFoam generates patches with 0 faces and 0 points | Simurgh | OpenFOAM Meshing & Mesh Conversion | 4 | August 25, 2023 08:58 |
[Gmsh] 3D coil mesh: can't create the volume? | RomainBou | OpenFOAM Meshing & Mesh Conversion | 3 | July 18, 2016 06:09 |
[Gmsh] Cgns support for gmsh | robyTKD | OpenFOAM Meshing & Mesh Conversion | 1 | July 13, 2016 12:27 |
[Gmsh] Vertex numbering is dense | KateEisenhower | OpenFOAM Meshing & Mesh Conversion | 7 | August 3, 2015 11:49 |
OpenFOAM with Cygwin | kitchener | OpenFOAM Installation | 6 | April 25, 2006 00:09 |