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   November 10, 2011, 11:01
Default
  #21
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
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

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.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
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,880
Rep Power: 25
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

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.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
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,880
Rep Power: 25
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

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.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   November 10, 2011, 11:18
Default
  #24
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 239
Blog Entries: 6
Rep Power: 8
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,880
Rep Power: 25
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

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.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
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: 12
Rep Power: 3
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: 361
Rep Power: 9
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: 12
Rep Power: 3
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

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 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 CD-adapco 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 15:55.