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

Functions A and H what are returned values

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2008, 13:02
Default Hello OF people! It's me ag
  #1
kar
Senior Member
 
Kārlis Repsons
Join Date: Mar 2009
Location: Latvia
Posts: 111
Rep Power: 17
kar is on a distinguished road
Hello OF people!

It's me again, looks like I have too much questions, probably I haven't learned how to read code yet.. I'm trying to get my first solver working, but it's not so easy to find out from sources what exactly function

template<class>
tmp<volscalarfield> fvMatrix<type>::A() const

and

template<class>
tmp<geometricfield<type,> > fvMatrix<type>::H() const

is returning! In several papers momentum equation discretisation is shown in this form "a_P U_P = H(U) - grad(p)". OF has it's functions A() and H() which appear in many solvers for p-U coupling.

For example, I added rho to icoFoam equation

fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- fvm::laplacian(mu, U)
);

calculated phi as: "linearInterpolate(rho*U) & mesh.Sf()"

..and was hoping, that there is no need to modify

U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

since there is rho in UEqn. Sure, I was wrong, so I need to understand those functions.. Maybe you can help with this (explain, give a link to www or paper)? Basically the question is about how to write PISO loop for compressible flow and any kind of momentum eq.!

Kārlis
kar is offline   Reply With Quote

Old   February 21, 2008, 09:08
Default A() should return a Field of t
  #2
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
A() should return a Field of the same length of that describing the variable for which the matrix is solved for; the value of this field should be the diagonal term of the matrix. The output of H() is of the same size of the output of A(), and each of its element should be obtained by multiplying the neighbours' coefficients for the corresponding velocity (or whichever is the unknown) values and summing them all. For transient flows, add another previous step velocity term.
As for your solver... why don't you take a look at the "rhoSimpleFoam" sovler in the "compressible" folder? It could be a better start for compressible flow solver design
marziolettich 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ensight - node values -cell values leo FLUENT 1 May 12, 2010 08:47
Modify, G_k,k and epsilon values on wall functions Javier Larrondo FLUENT 0 September 15, 2008 21:34
Correct values for constants k E in wall functions jaswi OpenFOAM Running, Solving & CFD 0 February 21, 2008 11:33
What value is returned for gradUneighbourfaceI if faceI is at a boundary sampaio OpenFOAM Running, Solving & CFD 1 June 1, 2006 13:14
damping functions(wall functions) Pr Main CFD Forum 0 March 22, 2004 02:17


All times are GMT -4. The time now is 10:03.