CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Crash between two Info statements

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 8, 2021, 14:56
Default Crash between two Info statements
  #1
New Member
 
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8
Roxxor91 is on a distinguished road
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;
When running my code, it stops at

Code:
Correcting model ...
I am puzzled to see that the first Info statement is passed but not the second. Is it a problem of memory ? This occurs whether there is a high memory usage or not.

Thanks in advance for your answers.

Last edited by Roxxor91; March 8, 2021 at 16:30.
Roxxor91 is offline   Reply With Quote

Old   March 8, 2021, 15:56
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
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?
Tobermory is offline   Reply With Quote

Old   March 8, 2021, 16:30
Default
  #3
New Member
 
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8
Roxxor91 is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
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?
Hey, thanks for that remark, I copied the wrong line from my terminal..
I corrected in my post, and what I said remains valid though.
Roxxor91 is offline   Reply With Quote

Old   March 8, 2021, 16:36
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
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.
Tobermory is offline   Reply With Quote

Old   March 8, 2021, 17:22
Default
  #5
New Member
 
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8
Roxxor91 is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
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.
I have to tell you that it's a solver of my own that has very little to do with classic OpenFOAM solvers. And it's serial at the moment.

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
If I change the CFL to 0.2, this is where it crashes:

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
If I change the CFL to 0.1, this is where it crashes:
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 ?
Roxxor91 is offline   Reply With Quote

Old   March 9, 2021, 17:35
Default
  #6
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by Roxxor91 View Post
You can notice that I crash always at the same iteration, how weird is this ?
Thomas, I think you have entered the twilight zone ...
Tobermory is offline   Reply With Quote

Old   March 14, 2021, 11:25
Default
  #7
New Member
 
Thomas
Join Date: Jul 2018
Posts: 16
Rep Power: 8
Roxxor91 is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
Thomas, I think you have entered the twilight zone ...
Guide me to the light, great wizard !


On a serious note, I just tried again today and still the problems persists. I can run other cases, with more elements, and more complex physics, and it will work.
Roxxor91 is offline   Reply With Quote

Old   March 14, 2021, 12:18
Default
  #8
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 747
Rep Power: 14
Tobermory will become famous soon enough
... 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.
Tobermory is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 00:03.