Meaning Of "fvc::div(phi)" - Forums - CFD Online

CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development
Blogs
Recent Entries
Best Entries
Best Blogs
Blog List
Search Blogs
Meaning of "fvc::div(phi)"
User Name Remember Me
Password
Register Blogs Community New Posts Updated Threads Search
New Today
All Forums
Main CFD Forum
ANSYS - CFX
ANSYS - FLUENT
ANSYS - Meshing
Siemens
OpenFOAM
SU2
Last Week
All Forums
Main CFD Forum
ANSYS - CFX
ANSYS - FLUENT
ANSYS - Meshing
Siemens
OpenFOAM
SU2
Updated Today
All Forums
Main CFD Forum
ANSYS - CFX
ANSYS - FLUENT
ANSYS - Meshing
Siemens
OpenFOAM
SU2
Last Week
All Forums
Main CFD Forum
ANSYS - CFX
ANSYS - FLUENT
ANSYS - Meshing
Siemens
OpenFOAM
SU2
Community Links
Members List
Search Forums
Show Threads Show Posts
Tag Search
Advanced Search
Search Blogs
Tag Search
Advanced Search
Go to Page...
Like Tree61Likes
  • Top
  • All
  • This Page
Reply
Page 1 of 2 1 2 >
LinkBack Thread Tools Search this Thread Display Modes
Old February 28, 2012, 11:51 Default Meaning of "fvc::div(phi)" #1
enoch Member Jeong Kim Join Date: Feb 2010 Posts: 42 Rep Power: 17 enoch is on a distinguished road Hi Foamers, When I look at pEqn.C in the "twoPhaseEulerFoam" solver, I don't really understand the following codes. ....... for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(Dp, p) == fvc::div(phi) ); ..... Speaking of div(phi), divergence of any scalar is zero mathematically. Divergence reduce the order rank of maxtrix. For an example, let's say, velcotiy vector u=(ux, uy) div(u)=ux/dx + uy/dy ---> scalar quantity But, scalar phi=phi(x,y) div(phi)=0 So what is the meaning of div(phi) and what's a mathematical formulation for the term in openfoam? Zhiheng Wang, qwebean and nepomnyi like this.
enoch is offline Reply With Quote
Old July 16, 2013, 05:01 Default #2
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Hi Kim, This problem happens to me in the same time!http://www.cfd-online.com/Forums/ope...-equation.html Did you find a solution? Zhiheng Wang likes this.
sharonyue is offline Reply With Quote
Old July 16, 2013, 07:01 Default #3
fportela Member Felipe Alves Portela Join Date: Dec 2012 Location: FR Posts: 70 Rep Power: 15 fportela is on a distinguished road Isn't phi simply the mass flux rho*U*A ? check this HTML Code: http://openfoamwiki.net/index.php/Uguide_table_of_fields and this HTML Code: http://openfoamwiki.net/index.php/Main_FAQ#What_is_the_field_phi_that_the_solver_is_writing I have not used this particular solver, so I'm not sure what's going on, but from continuity: div(phi) = 0 implies that ddt(rho) is zero, if this is not the case, then div(phi) is not zero. Cheers, Felipe elmo555 likes this.
fportela is offline Reply With Quote
Old July 16, 2013, 09:31 Default #4
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Hi Felipre, Thanks for your prompt reply, Quote:
Originally Posted by fportela View Post but from continuity: div(phi) = 0
regarding this, isnt it should be div(u)=0? Zhiheng Wang likes this.
sharonyue is offline Reply With Quote
Old July 16, 2013, 09:35 Default #5
Bernhard Senior Member Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 23 Bernhard is on a distinguished road No, because U is the cell centre value, and the divergence is obtained from the face values, i.e. phi. fportela, utkunun, randolph and 1 others like this.
Bernhard is offline Reply With Quote
Old July 16, 2013, 09:38 Default #6
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Hi Bernhard, Could you explain more? Zhiheng Wang likes this.
sharonyue is offline Reply With Quote
Old July 16, 2013, 09:39 Default #7
Bernhard Senior Member Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 23 Bernhard is on a distinguished road Can you be more specific? Zhiheng Wang likes this.
Bernhard is offline Reply With Quote
Old July 16, 2013, 09:44 Default #8
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Quote:
Originally Posted by Bernhard View Post No, because U is the cell centre value, and the divergence is obtained from the face values, i.e. phi.
I mean all the books say from continuity we have: \nabla \cdot u=0 without mentioning whether its cell centre value or the face value. But Im sure I confused about this. So?
sharonyue is offline Reply With Quote
Old July 16, 2013, 09:49 Default #9
Bernhard Senior Member Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 23 Bernhard is on a distinguished road The book are correct, but is valid without a mesh. If you integrate this equation over a control volume, this converts to a summation over the faces of the velocity times the area ( http://en.wikipedia.org/wiki/Divergence_theorem ). phi is nothing less then the velocity at the face (times the density and the face area). Kummi, SHUBHAM9595 and fly_light like this.
Bernhard is offline Reply With Quote
Old July 16, 2013, 09:51 Default #10
fportela Member Felipe Alves Portela Join Date: Dec 2012 Location: FR Posts: 70 Rep Power: 15 fportela is on a distinguished road Quote:
Originally Posted by sharonyue View Post I mean all the books say from continuity we have: \nabla \cdot u=0 without mentioning weather its cell centre value or the face value. But Im sure I confused about this. So?
This is only true for incompressible flow. For incompressible flow, you have \frac{D\rho}{Dt} = \frac{\partial\rho}{\partial t} + \vec{u} \cdot \nabla (\rho)  = 0 Plug this into continuity \frac{\partial\rho}{\partial t} + \nabla (\rho \vec{u}) = 0 And you get \nabla \cdot \vec{u} = 0
fportela is offline Reply With Quote
Old July 16, 2013, 10:24 Default #11
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Quote:
Originally Posted by Bernhard View Post The book are correct, but is valid without a mesh. If you integrate this equation over a control volume, this converts to a summation over the faces of the velocity times the area ( http://en.wikipedia.org/wiki/Divergence_theorem ). phi is nothing less then the velocity at the face (times the density and the face area).
\int\limits_V^{} {\nabla  \cdot udV}  = \sum\limits_f {{u_f} \cdot {S_f} = 0} I know this, but phi is a scalar, what is div(scalar)..... Felipe. Yeah, you are right~
sharonyue is offline Reply With Quote
Old July 16, 2013, 10:27 Default #12
Bernhard Senior Member Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 23 Bernhard is on a distinguished road Quote:
Originally Posted by sharonyue View Post I know this, but phi is a scalar, what is div(scalar).....
Be careful here. phi is a surfaceScalarField, so there is always a direction vector defined by the face area vector. fportela and wind_ like this.
Bernhard is offline Reply With Quote
Old July 16, 2013, 10:56 Default #13
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road \int\limits_V^{} {\nabla  \cdot udV}  = \sum\limits_f {{u_f} \cdot {S_f} = 0} Regarding this, if div(phi)=0 Do you mean: \int\limits_V^{} {u_f \cdot S_fdV}  = 0 Quote:
phi is a surfaceScalarField, so there is always a direction vector defined by the face area vector
Is there any difference between "surfaceScalarField" and "volScaklaField" expect where they are stored? flowAlways likes this.
sharonyue is offline Reply With Quote
Old July 16, 2013, 11:01 Default #14
Bernhard Senior Member Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 23 Bernhard is on a distinguished road You apply the divergence theorem. \int\limits_V^{} {\nabla  \cdot udV}  = \int\limits_{\partial V}u\cdot\hat{n}dS =\sum\limits_f {{u_f} \cdot {S_f} = 0} You can't integrate face values over a volume as you are posting. The difference between a volScalarField and a surfaceScalarField, is that for a volScalarField, there is a value stored per control volume or cell. For a surfaceScalarField there is a value stored per face. You can of course interpolate from the one to the other, but this is only accurate to some order. fportela, flowAlways, acs and 1 others like this.
Bernhard is offline Reply With Quote
Old July 16, 2013, 11:23 Default #15
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Quote:
Originally Posted by Bernhard View Post You apply the divergence theorem. \int\limits_V^{} {\nabla  \cdot udV}  = \int\limits_{\partial V}u\cdot\hat{n}dS =\sum\limits_f {{u_f} \cdot {S_f} = 0} You can't integrate face values over a volume as you are posting. The difference between a volScalarField and a surfaceScalarField, is that for a volScalarField, there is a value stored per control volume or cell. For a surfaceScalarField there is a value stored per face. You can of course interpolate from the one to the other, but this is only accurate to some order.
Bernhard, Thanks very very much for your consistent help, But I still cannot understand this "div(u)=0" turns into "div(phi)=0" in OpenFOAM, even mathematicly div(vector) works but div(scalar) not. Does it mean fvc::div(phi)=0 equals to sum(phi)=0 in OpenFOAM? Why doesnt it use sum(phi)=0 instead. At last,I think I need to clear my head. Thanks for you patience. Really thankful. acs likes this.
sharonyue is offline Reply With Quote
Old July 18, 2013, 00:52 Default #16
sharonyue Senior Member Dongyue Li Join Date: Jun 2012 Location: Beijing, China Posts: 866 Rep Power: 19 sharonyue is on a distinguished road Im still confused!!!!!! div(u)=0 I know its meaning. 1) If via continuity, we have div(phi)=0, then we make an intergration on this equation like this: [