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

Strange rhoCentralFoam behavior after restart...

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   October 31, 2011, 10:55
Question Strange rhoCentralFoam behavior after restart...
  #1
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 46 views)
vkrastev is offline   Reply With Quote

Old   October 31, 2011, 11:11
Default
  #2
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
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, 11:49
Default
  #3
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 11:58
Default
  #4
Senior Member
 
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 386
Rep Power: 15
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, 13:34
Default
  #5
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 18:46
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
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 live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   November 2, 2011, 05:25
Default
  #7
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 14:48
Default
  #8
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 36 views)
vkrastev is offline   Reply With Quote

Old   November 2, 2011, 15:06
Default
  #9
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
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 live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   November 2, 2011, 18:30
Default
  #10
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 14:06
Default Bug fixed
  #11
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 15:15
Default
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,894
Rep Power: 26
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 live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   November 8, 2011, 17:00
Default
  #13
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 22:15
Default
  #14
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 249
Blog Entries: 6
Rep Power: 9
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, 05:02
Default
  #15
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 03:43
Default
  #16
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 6
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, 03:54
Default
  #17
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 249
Blog Entries: 6
Rep Power: 9
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, 08:40
Default
  #18
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 08:41
Default
  #19
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
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, 09:52
Default
  #20
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 249
Blog Entries: 6
Rep Power: 9
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

Thread Tools
Display Modes

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 On
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 11: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 CD-adapco 3 February 2, 2009 23:51
Restart of FSI simulation V. Kumar CFX 3 July 20, 2006 13:23


All times are GMT -4. The time now is 09:01.