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

calculation of phi

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

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Display Modes
Old   August 21, 2009, 10:44
Post calculation of phi
  #1
New Member
 
Wolfgang Betz
Join Date: Mar 2009
Posts: 6
Rep Power: 11
wbetz is on a distinguished road
Where do I have to look (in the source code), if I want to know how phi is calculated in interFoam?
wbetz is offline   Reply With Quote

Old   August 22, 2009, 07:16
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 17
l_r_mcglashan will become famous soon enough
In createFields.H, you'll see the line include "createPhi.H". You can find this in OpenFOAM-1.X/src/finiteVolume/cfdTools/incompressible

It is defined as:

phi = linearInterpolate(U) & mesh.Sf()

I think the best thing to do is to set up your IDE's code assistance, so that you can easily navigate through the source code.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   August 22, 2009, 08:02
Default
  #3
New Member
 
Wolfgang Betz
Join Date: Mar 2009
Posts: 6
Rep Power: 11
wbetz is on a distinguished road
If phi is calculated from U, what is the advantage of using boundary conditions like fluxCorrectedVelocity, pressureInletVelocity, pressureInletOutletVelocity - which calculate U form the flux(phi)?
wbetz is offline   Reply With Quote

Old   August 22, 2009, 08:35
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 17
l_r_mcglashan will become famous soon enough
I've had a quick look at fluxCorrectedVelocity.
It would be used when you know the pressure at a boundary and the flux through that boundary.
The BC is correcting the velocity component normal to the boundary, based on your knowledge of the flux through that boundary.
I can't think of when I would use it, maybe someone else has?

You could replace all instances of phi with linearInterpolate(U) & mesh.Sf(), but that would make the code messy.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   November 7, 2018, 11:21
Default
  #5
New Member
 
ghuang
Join Date: Oct 2014
Posts: 2
Rep Power: 0
belier1988 is on a distinguished road
Quote:
Originally Posted by wbetz View Post
If phi is calculated from U, what is the advantage of using boundary conditions like fluxCorrectedVelocity, pressureInletVelocity, pressureInletOutletVelocity - which calculate U form the flux(phi)?
This is a very interesting question. I'v wondered about it during the use of pimpleFoam with the BC types such as pressureInletVelocity. My guess is that at the boundary where pressure is known, phi is calculated from pressure and can be used to give a value to the velocity component normal to the path.
Can anyone provide a better answer to clear things up ?
belier1988 is offline   Reply With Quote

Old   November 8, 2018, 02:16
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,176
Blog Entries: 6
Rep Power: 37
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

this is an ancient thread, but I want to give some hints:
  1. The flux phi is estimated by the velocity rho*U (compressible) or U (incompressible)
  2. However, the flux itself is corrected using the pressure equation, and then, the new velocity is recalculated from the fluxes
  3. So you cannot say, phi is estimated from U, and after that, it is similar to estimate U from the flux phi because of the flux change during the pressure equation.

Lets consider the solver pimpleFoam
  1. At the beginning the flux field is created in createPhi.H while the values are calculated from U; this is an initialization guess (https://github.com/OpenFOAM/OpenFOAM...teFields.H#L29)
  2. Inside the pimple-loop we have several things that change the flux field such as moving meshes, multi-reference frame and so on (I donīt consider that now).
  3. Neglecting the modifications to the phi field based on the above-mentioned functionalities, we go into the UEqn.H (https://github.com/OpenFOAM/OpenFOAM...pleFoam/UEqn.H)
    Here we do not modify the flux field; we construct the momentum matrix, and if the momentum predictor is on, we estimate a new velocity field based on Navier Stokes equation (not required in general).
  4. After that we enter to the pEqn.H. Inside the pressure loop, we update the fluxes according to the new pressure field (https://github.com/OpenFOAM/OpenFOAM...oam/pEqn.H#L51)
    After the pressure is calculated, it is evident that the fluxes are different to the corresponding velocities field (still the old one), thatīs why we need to recalculate the new velocity field from the new fluxes (https://github.com/OpenFOAM/OpenFOAM...oam/pEqn.H#L60)
  5. After correcting the internal domain, we adjust the boundary conditions for U (https://github.com/OpenFOAM/OpenFOAM...oam/pEqn.H#L61)

Now it should be clear, that the flux-corrected boundary conditions are useful because the fluxes are changing during the pressure equation and we recalculate the velocity from the new fluxes.
snak likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 14, 2018, 06:06
Default
  #7
New Member
 
ghuang
Join Date: Oct 2014
Posts: 2
Rep Power: 0
belier1988 is on a distinguished road
Thanks Tobi, it's more clear for me now. Have a nice day.
belier1988 is offline   Reply With Quote

Reply

Tags
interfoam, phi

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
Turbulence Model phi vs phi_ doug OpenFOAM Running, Solving & CFD 4 November 10, 2009 05:33
Another phi question ehsan_vaghefi OpenFOAM Running, Solving & CFD 0 October 24, 2008 20:56
Calculation of phi if velocity field is known ankgupta8um OpenFOAM Running, Solving & CFD 5 October 15, 2006 04:46
Warning 097- AB Siemens 6 November 15, 2004 05:41
Heat Flux Calculation under REPORTS Alberto Schroth FLUENT 0 May 16, 2000 09:19


All times are GMT -4. The time now is 22:35.