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

calculation of phi

Register Blogs Community New Posts Updated Threads Search

Like Tree11Likes
  • 1 Post By l_r_mcglashan
  • 10 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 21, 2009, 09:44
Post calculation of phi
  #1
New Member
 
Wolfgang Betz
Join Date: Mar 2009
Posts: 6
Rep Power: 17
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, 06:16
Default
  #2
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
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.
allanZHONG likes this.
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   August 22, 2009, 07:02
Default
  #3
New Member
 
Wolfgang Betz
Join Date: Mar 2009
Posts: 6
Rep Power: 17
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, 07:35
Default
  #4
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 23
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, 10:21
Default
  #5
New Member
 
ghuang
Join Date: Oct 2014
Posts: 3
Rep Power: 11
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, 01:16
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi 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, lth, nishant.kumar and 7 others like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   November 14, 2018, 05:06
Default
  #7
New Member
 
ghuang
Join Date: Oct 2014
Posts: 3
Rep Power: 11
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

Old   May 28, 2019, 20:04
Default
  #8
Senior Member
 
Brett
Join Date: May 2013
Posts: 212
Rep Power: 13
Bdew8556 is on a distinguished road
Hey guys.

I know it's meant to be poor form, but this is directly relevant.
Any thoughts??

Flow rate and phi not matching??
Bdew8556 is offline   Reply With Quote

Old   December 29, 2020, 05:52
Default
  #9
Member
 
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 9
Diro7 is on a distinguished road
Hello guys,

thanks for the brilliant material.
I have a related question:

Suppose that I have to solve an additional transport equation for a velocity field V (which is not the standard velocity field U, but may depend on it).
I understand that I have to define a new flux field (no problem to create it), but how should I ensure a correct treatment of flux and velocity provided that they don't need to satisfy a coupled pressure equation?

Things should be necessarily easier than in the standard U-p coupling, but I don't understand clearly what bits should I retain from a standard (S,P)IMPLE solver.

For reference, the transport equation for V reads like

\frac{\partial (c V_i)}{\partial t} + \frac{\partial (c V_i V_k)}{\partial x_k} = c F_i

where repeated index summation notation is assumed and c is a "concentration or density" field which satisfies a transport equation of the form

\frac{\partial c}{\partial t} + \frac{\partial (c V_k)}{\partial x_k} = \frac{\partial}{\partial x_k} \left( D \frac{\partial c}{\partial x_k} \right)

The two equations can be implemented rather straightforwardly provided that a new correct flux \phi_c is used. Upon creation it can be defined by interpolation like in a compressible solver, but how should I ensure the correct update of \phi_c like it is done in a pEqn.H?

Thanks in advance to everyone who has some advice
Diro7 is offline   Reply With Quote

Reply

Tags
interfoam, phi


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


All times are GMT -4. The time now is 04:43.