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

difference between div(U) and div(phi)

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Astrodan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 11, 2014, 04:43
Default difference between div(U) and div(phi)
  #1
Senior Member
 
Join Date: Dec 2011
Posts: 121
Rep Power: 14
fshak92 is on a distinguished road
Hi

Does anybody know why using each of div(U) or div(phi) provides same results?
I'm confused because the first one is volVectorField, and the latter is surfaceScalarField.
(Both of them are computed at the same time step and I'm using this in the Poisson eq.(Laplacian(p')=div(U)) )

Tnx
fshak92 is offline   Reply With Quote

Old   August 11, 2014, 05:02
Default
  #2
Member
 
Timm Severin
Join Date: Mar 2014
Location: Munich
Posts: 63
Rep Power: 12
Astrodan is on a distinguished road
I don't know about the numerics, but as far as I understand a volField is stored in the center of the cell, while a surfaceField is stored on the faces. Thus both methods are just different ways of accessing the "same" data, and should ideally return the same results.

To convert them you can work with fvc::reconstruct (surface -> vol) or fvc::interpolate (vol -> surface).

A little attention should of course be paid where phi includes density (though I've seen it called rhoPhi for those cases), usually in compressible or multiphase problems.
fshak92 and adambarfi like this.
__________________
PhD Student at the Institute of Biochemical Engineering at TU München
Modelling of fluid dynamics in open photobioreactors.

System:
OpenFOAM 2.3.x, 64bit, 8 Core Xeon Workstation
Astrodan is offline   Reply With Quote

Old   August 15, 2014, 08:53
Default
  #3
Senior Member
 
Join Date: Dec 2011
Posts: 121
Rep Power: 14
fshak92 is on a distinguished road
Quote:
Originally Posted by Astrodan View Post
I don't know about the numerics, but as far as I understand a volField is stored in the center of the cell, while a surfaceField is stored on the faces. Thus both methods are just different ways of accessing the "same" data, and should ideally return the same results.

To convert them you can work with fvc::reconstruct (surface -> vol) or fvc::interpolate (vol -> surface).

A little attention should of course be paid where phi includes density (though I've seen it called rhoPhi for those cases), usually in compressible or multiphase problems.
Thank you very much for your response.
I've noticed that small differences can be seen in the result of those approaches.
Still I would like to know which one is completely correct if Poisson eq. should be solved? and why?
fvm::Laplacian(p') = fvc::div (U)
or
fvm::Laplacian(p') = fvc::div (phi)

Tnx in advance for any idea.
fshak92 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



All times are GMT -4. The time now is 19:30.