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

about phi in fvm::div(phi,U)

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes
  • 3 Post By longyun000
  • 6 Post By agustinvo
  • 4 Post By Tobi
  • 3 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2016, 07:37
Smile about phi in fvm::div(phi,U)
  #1
New Member
 
longyun wang
Join Date: Dec 2016
Posts: 6
Rep Power: 10
longyun000 is on a distinguished road
hi,
I am new in openfoam. When reading codes, I can't understand the phi in fvm::div(phi, U). It stands for △ˇ(UU), why don't we write as fvm::div(U, U) and what does phi means exactly.
thanks a lot
dickcruz, anhkenyt and lpz456 like this.
longyun000 is offline   Reply With Quote

Old   December 19, 2016, 09:23
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hi,
phi is actually the flux through the cells (so it is not a volVectorField, but a surfaceScalarField). For incompressible solver phi=U, but in case of compressible flows, phi=rho*U. This is why phi is used, you only change its definition in createFields.
agustinvo is offline   Reply With Quote

Old   December 21, 2016, 03:34
Default
  #3
New Member
 
longyun wang
Join Date: Dec 2016
Posts: 6
Rep Power: 10
longyun000 is on a distinguished road
thx very much~~
longyun000 is offline   Reply With Quote

Old   December 21, 2016, 08:50
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
By the way, your equation is wrong. Be careful with laplacian and nabla!

@agustinvo, you missed the face area!
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 6, 2022, 15:58
Default
  #5
Member
 
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6
openfoam_aero is on a distinguished road
Quote:
Originally Posted by longyun000 View Post
hi,
I am new in openfoam. When reading codes, I can't understand the phi in fvm::div(phi, U). It stands for △ˇ(UU), why don't we write as fvm::div(U, U) and what does phi means exactly.
thanks a lot
Just to add to the answers- the reason why we don’t write \Nabla.(U U) is simply because it is a non-linear equation. OpenFOAM deals with non linearity by using the value of flux from the previous iteration. If you see createFields.H, you will notice that at the end of the code is createPhi.H. This will be called first and the flux will be created. When the iteration loop begins, it will use this flux and calculate the unknown velocity. For the next iteration, the previous iterations flux will be used to calculate the velocity of the current iteration.
openfoam_aero is offline   Reply With Quote

Old   June 6, 2022, 16:16
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
Not 100 % or you did not write it carefully.


First of all, the fluxes are different compared to the velocities as its on the surface and not in the cell center. You are right, the fluxes are created (firstly) by the actual velocities, after constructing the velocity matrix (momentum predictor is not needed), we solve the pressure equation which gives us the correction of the fluxes. These correction are used to recalculate the new velocity field.

The flux calculation might be repeated even though, the velocity matrix is not re-built (updated) only the velocities. See, A and H operator. We repeat until the solution is satisfied and the continuity is fine.

This is mainly PISO + non-Ortho correctors.
In PIMPLE we also update the velocity matrix.

Cheers.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 6, 2022, 16:27
Default
  #7
Member
 
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6
openfoam_aero is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Not 100 % or you did not write it carefully.


First of all, the fluxes are different compared to the velocities as its on the surface and not in the cell center. You are right, the fluxes are created (firstly) by the actual velocities, after constructing the velocity matrix (momentum predictor is not needed), we solve the pressure equation which gives us the correction of the fluxes. These correction are used to recalculate the new velocity field.

The flux calculation might be repeated even though, the velocity matrix is not re-built (updated) only the velocities. See, A and H operator. We repeat until the solution is satisfied and the continuity is fine.

This is mainly PISO + non-Ortho correctors.
In PIMPLE we also update the velocity matrix.

Cheers.
Thanks for correcting Tobi! Agree on the clarity of the matter. But I had one question
Suppose we have an equation which is not non-linear. In that case, would it be incorrect to calculate the flux before the momentum predictor step? Say it is a linear PDE (coupled, similar to NSE). I would assume that we do not need the flux calculation before momentum predictor since there is no requirement to handle non-linearity. By making this flux calculation from existing velocity, the flux Correction after the pressure equation solution will be applied to the previous iteration flux, not the current one. In such a case, would it be correct to add the flux calculation AFTER momentum predictor step?
openfoam_aero is offline   Reply With Quote

Reply

Tags
fvmatrix, 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
[OpenFOAM.org] OpenFOAM build on Intel Xeon Phi asaijo OpenFOAM Installation 31 July 26, 2017 11:35
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 10:34
Summing phi over all faces in patch NewtoFOAM OpenFOAM Programming & Development 2 May 8, 2013 06:37
Recreation of phi file, icoFoam Madeleine P. Vincent OpenFOAM Running, Solving & CFD 0 May 7, 2012 12:17
Turbulence Model phi vs phi_ doug OpenFOAM Running, Solving & CFD 4 November 10, 2009 05:33


All times are GMT -4. The time now is 15:46.