CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

Strange rhoCentralFoam behavior after restart...

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2011, 09:55
Question Strange rhoCentralFoam behavior after restart...
  #1
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Hi all,
well I don't know if this can be considered a real bug, but I've noticed a really strange (and highly undesirable) behavior of the rhoCentralFoam solver when a simulation is stopped and then restarted from the stop point...A brief description of my case: I'm trying to get some aerodynamic torque evaluations on a 2D simple throttle valve geometry; the flow is pressure driven (fixed pressures at inlet and outlet of the duct containing the valve) and till now I'm getting good overall results (except for some strange little pressure/velocity oscillations, which seem to be peculiar of the rhoCentralFoam solver). The fact is that being the runs quite long (it tooks about 2 days to simulate 0.1 s of physical time), I need sometimes to stop-and-restart the simulations at some point, but... when I first restarted a simulation and took a look on the torque plot from the forces function I got a very sharp discontinuity! I mean, If run the case from t=0 to, let's say, t=0.1 s I get some torque plot; otherwise, if I stop the original run at, let's say t=0.05 s, and then restart it, the plot re-starts from a completely different point and thus the final torque value (at t=0.1 s) is also very different! I'm sure that is not a problem of the forces function, because I've also checked the pressure distribution around the valve and there is indeed a sudden change immediately after the restart!
Any opinion about this matter? Is this a problem encountered also by someone else?
For more clearness a picture of a torque plot with two different restarts is attached below

Regards

V.
Attached Images
File Type: png plot_torque.png (5.7 KB, 86 views)
vkrastev is offline   Reply With Quote

Old   October 31, 2011, 10:11
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Since this run is transient, I would imagine that there's an "old-time" value that is required in the computation, but isn't written out to disk. Usually, fields, etc tend to be initialized with the current value if an old-time value was not found. You might want to check on that...
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   October 31, 2011, 10:49
Default
  #3
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by deepsterblue View Post
Since this run is transient, I would imagine that there's an "old-time" value that is required in the computation, but isn't written out to disk. Usually, fields, etc tend to be initialized with the current value if an old-time value was not found. You might want to check on that...
Hi Sandeep, and thanks for the reply. Sorry for my persistence, but could you clarify what do you mean with "old" and "current" values?

V.
vkrastev is offline   Reply With Quote

Old   October 31, 2011, 10:58
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25
deepsterblue will become famous soon enough
Old - when referring to the state of the field in the previous time-step.
Current - when referring to the state of the field in the current time-step.

If you're dealing with fields, that is. I might be wrong too, since I would expect torque to be instantaneous, and wouldn't normally associate it with an old-time value...

It's just that when I see restart issues like this, the first thing to check would be whether old-time values are being stored / retrieved appropriately from disk..
__________________
Sandeep Menon
University of Massachusetts Amherst
https://github.com/smenon
deepsterblue is offline   Reply With Quote

Old   October 31, 2011, 12:34
Default
  #5
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by deepsterblue View Post
Old - when referring to the state of the field in the previous time-step.
Current - when referring to the state of the field in the current time-step.

If you're dealing with fields, that is. I might be wrong too, since I would expect torque to be instantaneous, and wouldn't normally associate it with an old-time value...

It's just that when I see restart issues like this, the first thing to check would be whether old-time values are being stored / retrieved appropriately from disk..
Ok, thanks once again. Actually you made me think about a possible explanation for this behavior: the problem could be localized not in the old-values reading, but in the data storage precision (the torque values here are pretty small, thus prone to fluctuations with very small pressure variations over the valve surface). I'm doing some tests now increasing a lot the write precision, so let's see what happens...

V.
vkrastev is offline   Reply With Quote

Old   November 1, 2011, 17:46
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Store data in binary format to see if it makes a difference.

ASCII format makes it easier to edit the case, but binary is recommended not to lose information. Additionally, you can convert from one into the other.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   November 2, 2011, 04:25
Default
  #7
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by alberto View Post
Store data in binary format to see if it makes a difference.

ASCII format makes it easier to edit the case, but binary is recommended not to lose information. Additionally, you can convert from one into the other.
Thanks, I'll try it.

V.
vkrastev is offline   Reply With Quote

Old   November 2, 2011, 13:48
Default
  #8
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Well, I'm starting to worry seriously about this restart matter...I've selected binary as output and increased the write precision a lot, but the result is absolutely not encouraging (see the image attached below)...Could this be reported as a bug of the rhoCentralFoam solver or I'm missing something else? Any help/idea would be really appreciated

Regards

V.
Attached Images
File Type: png plot_torque.png (4.7 KB, 52 views)
vkrastev is offline   Reply With Quote

Old   November 2, 2011, 14:06
Default
  #9
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
I would report
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   November 2, 2011, 17:30
Default
  #10
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by alberto View Post
I would report
Reported! (let's see what happens)
vkrastev is offline   Reply With Quote

Old   November 8, 2011, 13:06
Default Bug fixed
  #11
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Hi all,
there was actually a problem in the updating of the flux phi, which has been fixed today with the following OF-2.0.x commit

commit dc17e722ab2a9539775eec59650e6dc0e7eb9360

The bug is present both in OF-1.7.x and OF-2.0.x families, and can be fixed in the same way also for 1.7.x. I think it is important to know for all users that if not fixed, that bug can lead to significantly erroneous results using rhoCentralFoam, as an error seems to propagate through time because of the incorrect phi update (see this page for more details http://www.openfoam.com/mantisbt/view.php?id=332 )

Best

V.
vkrastev is offline   Reply With Quote

Old   November 8, 2011, 14:15
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Thanks for the update!
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   November 8, 2011, 16:00
Default
  #13
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by alberto View Post
Thanks for the update!
You are welcome!
vkrastev is offline   Reply With Quote

Old   November 8, 2011, 21:15
Default
  #14
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 342
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Quote:
Originally Posted by vkrastev View Post
Hi all,
there was actually a problem in the updating of the flux phi, which has been fixed today with the following OF-2.0.x commit

commit dc17e722ab2a9539775eec59650e6dc0e7eb9360

The bug is present both in OF-1.7.x and OF-2.0.x families, and can be fixed in the same way also for 1.7.x. I think it is important to know for all users that if not fixed, that bug can lead to significantly erroneous results using rhoCentralFoam, as an error seems to propagate through time because of the incorrect phi update (see this page for more details http://www.openfoam.com/mantisbt/view.php?id=332 )

Best

V.
But what was the bug ? Looking at the changes

https://github.com/OpenFOAM/OpenFOAM...oCentralFoam.C

I fail to understand what the bug was ?
praveen is offline   Reply With Quote

Old   November 9, 2011, 04:02
Default
  #15
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
I think (but I'm not sure of it) that the problem was a redundance in the phi declaration between the createFields.H and the rhoCentralFoam.C files

Regards

V.
vkrastev is offline   Reply With Quote

Old   November 10, 2011, 02:43
Default
  #16
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 14
laurensvd is on a distinguished road
A beginners question (but googling for commit doesnt seem to work ), how do you 'commit' such an update? Is it related to svn (my it-administrator doesnt allow this)? If its just the rhoCentralFoam.C or rhoCentralFoam.H that is changed, could someone post this change so I can manually fix it if commit is no option? If the only change is the deletion of this one line of code for phi and adding the other as mentioned above, forget I asked something
laurensvd is offline   Reply With Quote

Old   November 10, 2011, 02:54
Default
  #17
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 342
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Though there was a redundancy, I dont think phi was the problem. Time step does not seem to have been properly set for restarted cases. The below fix is also required for the same bug that vkrastev reported

https://github.com/OpenFOAM/OpenFOAM...99a8dbd3dbf211
praveen is offline   Reply With Quote

Old   November 10, 2011, 07:40
Default
  #18
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by praveen View Post
Though there was a redundancy, I dont think phi was the problem. Time step does not seem to have been properly set for restarted cases. The below fix is also required for the same bug that vkrastev reported

https://github.com/OpenFOAM/OpenFOAM...99a8dbd3dbf211
No, the problem was actually phi: the time step initialization fixing does not have any effect on the restarting problem

V.
vkrastev is offline   Reply With Quote

Old   November 10, 2011, 07:41
Default
  #19
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 368
Rep Power: 20
vkrastev is on a distinguished road
Quote:
Originally Posted by laurensvd View Post
A beginners question (but googling for commit doesnt seem to work ), how do you 'commit' such an update? Is it related to svn (my it-administrator doesnt allow this)? If its just the rhoCentralFoam.C or rhoCentralFoam.H that is changed, could someone post this change so I can manually fix it if commit is no option? If the only change is the deletion of this one line of code for phi and adding the other as mentioned above, forget I asked something
Search for github OpenFOAM 2.0.x and see the latest commits

V.
vkrastev is offline   Reply With Quote

Old   November 10, 2011, 08:52
Default
  #20
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 342
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Quote:
Originally Posted by vkrastev View Post
No, the problem was actually phi: the time step initialization fixing does not have any effect on the restarting problem

V.
OK. Is phi used for some other purpose ? Why aren't the other fluxes phiUp and phiEp similarly declared in createFields.H ? Would like to understand this since I have modified rhoCentralFoam for my own needs.
praveen 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
Problem with multiframe restart of two-way fsi coupled problem Dimone CFX 26 December 20, 2011 10:10
Restart for solidification atulverma FLOW-3D 2 May 15, 2009 06:25
Restart for Solidification atulverma FLOW-3D 3 May 6, 2009 17:40
v4 restart bug optima prime Siemens 3 February 2, 2009 22:51
Restart of FSI simulation V. Kumar CFX 3 July 20, 2006 13:23


All times are GMT -4. The time now is 07:11.