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

DivphiU expression in incompressible solvers

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2005, 10:26
Default In OpenFoam, the term (U . Ñ)U
  #1
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
In OpenFoam, the term (U . Ñ)U in N-S equation is expressed as div(phi,U),where phi is surfaceScalarField, and phi = linearInterpolate(Uo) & mesh.Sf(). I don't understand this.

I think it can also expressed as U . ÑU, (inner product),which in OpenFoam is U & fvc::grad(U)).(why not in this way?)

in OpenFoam, div(phi,U) is said to mean Ñ . (UU), and flux f=U
see User Guide U-110

createPhi.H
#ifndef createPhi_H
#define createPhi_H

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "Reading/calculating face flux field phi\n" << endl;

surfaceScalarField phi
(
IOobject
(
"phi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
linearInterpolate(U) & mesh.Sf()
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

vvqf is offline   Reply With Quote

Old   November 15, 2005, 11:29
Default U & fvc::grad(U)) wouldn't be
  #2
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
U & fvc::grad(U)) wouldn't be conservative. The FVM for all transport equations is to discretise

div(phi q)

where q is the unknown variable - could be k, epsilon, temperature, whatever... or in this case any of the components of the velocity. Applying Gauss theorem to the cell converts this into a sum of the fluxes through the faces of the cell, which is what ensures conservation. Of course you do need to get the flux from somewhere, which is what the interpolation is there for.

It is a bit difficult to grasp at first, but we do need to make a distinction between velocity and flux. This is standard practice in FV CFD codes. not just FOAM. Have a look at a textbook in the area (my favourite is Versteeg + Malalasekera)

Gavin
grtabor is offline   Reply With Quote

Old   November 23, 2005, 05:50
Default if the term (U奄)U could be n
  #3
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
if the term (U奄)U could be non-conservative, mathematically, put the physical meaning aside, is it ok to use U & fvc::grad(U))?

or will it cause a inconvergent solution when using the solver, like the residual very large, even "nan" ?
vvqf is offline   Reply With Quote

Old   November 23, 2005, 09:59
Default You can do whatever you like,
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
You can do whatever you like, but the

U & fvc::grad(U)

will be explicit, with the appropriate effects on stability, convergence etc. I would go for

div(U U) - U div(U)

which is the same as U & grad(U) but can be made implicit in both terms (or course, you need to write this in the FOAM language. Mind the fluxes, etc.) :-)

Have fun,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   November 24, 2005, 07:09
Default it is really nice of you to an
  #5
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
it is really nice of you to anwer my question.
Yes, it is of some fun, but as well as *&^%#@

I would not think of expressing the term in div()terms, and also difficult for me to transform in this way.

I want to ask further:
2 vectors : a, b
Could you give me suggestion what is the proper way to express
<a,Ñb> + <b,Ña> ?

Thanks again.
vvqf is offline   Reply With Quote

Old   November 24, 2005, 07:19
Default sorry. it should be +
  #6
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
sorry. it should be
<a,Ñb> + <Ñb,a>

Exactly, I wanna solve U
<u',Ñu> + <Ñu,u'>
vvqf is offline   Reply With Quote

Old   November 25, 2005, 08:46
Default at first, I thought your trans
  #7
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
at first, I thought your transformation
U & fvc::grad(U) = div(U U) - U div(U)
is wrong. later i think there is a mistake in
Programmer's Guide, page P-28
equation (2.5)
should it be : dTij/dxj ?

dT11/dx1 + dT12/dx2 + dT13/dx3
dT21/dx1 + dT22/dx2 + dT23/dx3
dT31/dx1 + dT32/dx2 + dT33/dx3
vvqf is offline   Reply With Quote

Old   November 25, 2005, 09:14
Default if so, then i can come to the
  #8
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17
vvqf is on a distinguished road
if so, then i can come to the conclusion :
(U'•Ñ)U = Ñ•(U U') = U'•(ÑU)
Then,
(U'奄)U = fvm::div(phi, U')
is that right?

http://www.cfd-online.com/OpenFOAM_D...tml?1132700141
vvqf is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Pressure force calculation in incompressible solvers philippose OpenFOAM Running, Solving & CFD 10 December 7, 2019 04:51
Incompressible vs compressible solvers James Main CFD Forum 5 January 19, 2009 05:15
SonicFoam divphiU dimi OpenFOAM Running, Solving & CFD 3 June 25, 2007 05:47
NS-incompressible and compressible flow solvers ag Main CFD Forum 2 September 27, 2005 06:18
CEL expression Henry CFX 2 August 7, 2004 12:16


All times are GMT -4. The time now is 16:14.