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   November 10, 2011, 11:01
Default
  #21
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
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
The flux phi was locally re-declared inside the main function. This made the local value accessible to the all the instructions explicitly present in the main function. However an inconsistent value was provided to the turbulence model, whose autoPtr is declared in createFields.H, outside the main().

Other problem that was going to happen: the stored "phi" was the one declared in createFields. The one locally re-declared in main was not stored at all, since its IOobject write option is not set to AUTO_WRITE.
This would have led to an inconsistent value of phi at restart, which was causing the problem.

Best,
__________________
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 10, 2011, 11:02
Default
  #22
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
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
Instructions on how to use the git repository are available on the OpenFOAM website:

http://www.openfoam.org/git.php
__________________
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 10, 2011, 11:04
Default
  #23
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
Quote:
Originally Posted by praveen View Post
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.
This is more C++ and programming than CFD :-)
Phi is passed to the turbulence model using via the autoPtr. The two fluxes phiUp and phiEp are not required outside the main() function, so it is perfectly fine not to declare them outside of it.
vkrastev likes this.
__________________
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 10, 2011, 11:18
Default
  #24
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 alberto View Post
This is more C++ and programming than CFD :-)
Phi is passed to the turbulence model using via the autoPtr. The two fluxes phiUp and phiEp are not required outside the main() function, so it is perfectly fine not to declare them outside of it.
Thanks. I was still looking at 1.7 and hence did not see that phi is used in the turbulence model in 2.0
praveen is offline   Reply With Quote

Old   November 10, 2011, 11:22
Default
  #25
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
Quote:
Originally Posted by praveen View Post
Thanks. I was still looking at 1.7 and hence did not see that phi is used in the turbulence model in 2.0
OK. Just keep in mind that also in 1.7, if you re-declare phi, the stored (to disk) value is not correct.

Best,
__________________
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 19, 2013, 02:05
Default
  #26
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
Hello Mr. Vesselin Krastev,

I went through your post and I was wondering where should in make chnages as outlined by you regarding the bug.

Reagrds,
Rahul

Originally Posted by vkrastev
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.
srahul is offline   Reply With Quote

Old   November 19, 2013, 08:34
Default
  #27
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 srahul View Post
Hello Mr. Vesselin Krastev,

I went through your post and I was wondering where should in make chnages as outlined by you regarding the bug.

Reagrds,
Rahul

Originally Posted by vkrastev
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.
Hi Rahul,

if you are using a recent OpenFOAM release (any release from 2.0.x till the present 2.2.2/2.2.x) the problem is already fixed and you don't need to do anything. Otherwise, follow the link which points to the Mantis bug tracker discussion about this issue and you will see how to fix it.

Regards

V.
vkrastev is offline   Reply With Quote

Old   November 19, 2013, 12:04
Default
  #28
New Member
 
Rahul Soni
Join Date: Feb 2013
Location: IIT Kanpur
Posts: 13
Rep Power: 13
srahul is on a distinguished road
Hi, Mr. Vesselin,

Many thanks for your reply I am using the latest version that means the bug is already fixed, once again thank you for you prompt reply.

Regards,
Rahul
srahul 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 17:48.