
[Sponsors] 
July 3, 2007, 17:52 
Hi all,
I am trying to writ

#1 
Member
Doug Hunsaker
Join Date: Mar 2009
Location: Logan, UT
Posts: 63
Rep Power: 16 
Hi all,
I am trying to write my own turbulence model and am currently studying the kEpsilon model in OF 1.4 linked with simpleFoam. In the simpleFoam.C source file, it says: phi = fvc::interpolate(U) & mesh.Sf(); I'm not exactly sure what's happening here. My best guess is that it's interpolating the vector U from the cell centers to the cell faces and storing it as the transport property phi. (What exactly is the "& mesh.Sf()?) In the kEpsilon.C source file, the dissipation equation is solved using phi_ as the item of transport. The divergence of phi_ is calculated as part of that equation. However, I thought you could only calculate the divergence of a vector. Is phi_ somehow a vector now instead of a scalar? If so, how was it set? I'm assuming that the phi defined in simpleFoam.C is the same as the phi_ in kEpsilon.C. Since velocity is the item of transport, could the phi_ in the turbulence model be replaced by U_? This would be a true vector. Thanks for your help. Doug 

July 3, 2007, 20:50 
Hi Doug,
As I understand it

#2 
Member
Shaun Cooper
Join Date: Mar 2009
Posts: 54
Rep Power: 16 
Hi Doug,
As I understand it fvc::interpolate(U) & mesh.Sf() is, as you say, the interpolation of the velocity from the cell centre to the cell face, the '&' is the dot product symbol, see programmer's guide, and meshSf() is the face area magnitudes. So this is saying, interpolate the velocity field and take the dot product with the face area vector. Not too sure about the rest, Hope this helps, Shaun 

July 4, 2007, 05:28 
@"However, I thought you could

#3 
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,227
Rep Power: 50 
@"However, I thought you could only calculate the divergence of a vector. Is phi_ somehow a vector now instead of a scalar?": According to Gauss's theorem (http://en.wikipedia.org/wiki/Divergence_theorem) the divergence in a volume can be calculated by summing the flux on the surfaces. phi is just that (the flux on the surface). So I guess (havn't looked at the code for that) div(phi) does just that: sum up the phis on the surface and pretend it's div(U)
__________________
Note: I don't use "Friend"feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request 

July 4, 2007, 11:20 
Hi Bernhard,
If you think (

#4 
Member
HoangLam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 16 
Hi Bernhard,
If you think (as Shaun) that div(phi) is something like div(U), do you think that I have well implemented: nu*laplacian(U)=grad(div(U))/epsi (I obtained this expression by considering: div(U)=epsi*p, where epsi is very small (epsi [0 2 1 0 0 0 0] 1e6)) and nu*Laplacian(U)=grad(p) by writting in Foam: tmp<fvvectormatrix> UEqn(laplacian(nu,U)); solve(UEqn()==fvc::grad(fvc::div(phi)/epsi)); ? Lam 

November 10, 2009, 05:33 

#5  
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 16 
Quote:
However, phi is a "surfaceScalarField" (not a vector). What div(phi) is? And why you can compute a divergence of an scalar? By definition, divergence is applied to a vector, for a scalar it would be a gradient. 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
which turbulence model to use???  Ravikanth  CFX  1  April 3, 2008 19:03 
Turbulence Model  GG  Siemens  3  March 3, 2008 20:06 
changing model constants in ke turbulence model  Sunil  CFX  3  October 3, 2006 13:12 
Best Turbulence Model  manish  FLUENT  1  March 10, 2005 19:15 
HELP! TURBULENCE ke OR komega TURBULENCE MODEL?  Mirek Kabacinski  FLUENT  5  August 24, 2003 23:31 