# what's the meaning of UEqn().A()

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

 May 2, 2010, 09:59 what's the meaning of UEqn().A() #1 New Member   wangle Join Date: Dec 2009 Posts: 7 Rep Power: 8 I'm a new user of OpenFOAM,now I'm analyzing a solver .But I don't know what's the meaning of UEqn().A() and UEqn().H().Can you help me translate them to mathematic form.Thank you!

 May 2, 2010, 10:13 #2 Member   Cedric Van Holsbeke Join Date: Dec 2009 Location: Belgium Posts: 81 Rep Power: 8 Terms dependent on U are included in the A field. Terms not directly dependent on U are included in the H field.

May 2, 2010, 10:25
#3
New Member

wangle
Join Date: Dec 2009
Posts: 7
Rep Power: 8
Quote:
 Originally Posted by CedricVH Terms dependent on U are included in the A field. Terms not directly dependent on U are included in the H field.
Thank you for your reply.Does it mean the matrix A in equntion AU=H?But it's expressed a volScalarField，what's the connection between the matrix and the "scalar"? Thank you!

 May 3, 2010, 10:21 #4 Member   Matthew J. Churchfield Join Date: Nov 2009 Location: Boulder, Colorado, USA Posts: 49 Rep Power: 10 In the solver you are analyzing, the equation system to be solved begins as CU = R where C is a matrix, U is the solution vector, and R is the right hand side. The C matrix can be split into a matrix with only the diagonal elements of C, which is called A, and a matrix that has only the off-diagonal elements of C, which is called H'. In other words C = A + H'. Therefore, the linear system becomes (A + H')U = R, which is the same as AU = R - H'U. The right hand side is simply called H, so H = R - H'U. Therefore, we know have AU = H. So take a look at the code you are analyzing, and you'll see something similar to: Code: ``` fvVectorMatrix UEqn ( fvm::ddt(U) // time derivative + fvm::div(phi, U) // convection + turbulence->divDevReff(U) // viscous and turbulent deviatoric stresses == - gradPd // specified mean pressure gradient );``` Later you'll see code like rUA = 1.0/UEqn.A() and U = rUA*UEqn.H(). The .A() operator gives A formed in UEqn, the list of diagonal elements as explained above. This is a scalarField because each element is a scalar and corresponds to one grid cell. The .H() operator is a list of the elements of the vector H described above and formed in UEqn. If the variable U is a vector, then each element of H will be a vector; if the variable U is a scalar, then each element of H will be a vector, and so on. It is important to note, though, that there will be a piece of code that forms an fvMatrix, like the piece of code I included above. Later, there will be a piece of code that says something like Code: `solve(UEqn == - fvc::grad(pd) - fvc::grad(rhok) * gh);` where the matrix system is actually solved. Note that it is UEqn == ... The terms on the right hand side of the == do not contribute the the A and H given by UEqn.A() and UEqn.H(). Only the terms contained inside UEqn definition itself create UEqn.A() and UEqn.H(). For more description of this go take at look at section 2 of my description of buoyantBoussinesqPisoFoam at http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam Pascal_doran, Tushar@cfd, Haier and 36 others like this.

May 4, 2010, 03:36
Thank you very much to help me solve the problem!
#5
New Member

wangle
Join Date: Dec 2009
Posts: 7
Rep Power: 8
Quote:
 Originally Posted by mchurchf In the solver you are analyzing, the equation system to be solved begins as CU = R where C is a matrix, U is the solution vector, and R is the right hand side. The C matrix can be split into a matrix with only the diagonal elements of C, which is called A, and a matrix that has only the off-diagonal elements of C, which is called H'. In other words C = A + H'. Therefore, the linear system becomes (A + H')U = R, which is the same as AU = R - H'U. The right hand side is simply called H, so H = R - H'U. Therefore, we know have AU = H. So take a look at the code you are analyzing, and you'll see something similar to: Code: ``` fvVectorMatrix UEqn ( fvm::ddt(U) // time derivative + fvm::div(phi, U) // convection + turbulence->divDevReff(U) // viscous and turbulent deviatoric stresses == - gradPd // specified mean pressure gradient );``` Later you'll see code like rUA = 1.0/UEqn.A() and U = rUA*UEqn.H(). The .A() operator gives A formed in UEqn, the list of diagonal elements as explained above. This is a scalarField because each element is a scalar and corresponds to one grid cell. The .H() operator is a list of the elements of the vector H described above and formed in UEqn. If the variable U is a vector, then each element of H will be a vector; if the variable U is a scalar, then each element of H will be a vector, and so on. It is important to note, though, that there will be a piece of code that forms an fvMatrix, like the piece of code I included above. Later, there will be a piece of code that says something like Code: `solve(UEqn == - fvc::grad(pd) - fvc::grad(rhok) * gh);` where the matrix system is actually solved. Note that it is UEqn == ... The terms on the right hand side of the == do not contribute the the A and H given by UEqn.A() and UEqn.H(). Only the terms contained inside UEqn definition itself create UEqn.A() and UEqn.H(). For more description of this go take at look at section 2 of my description of buoyantBoussinesqPisoFoam at http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam

Thank you very much to help me solve the problem!

May 6, 2010, 02:23
need help
#6
New Member

beauty
Join Date: Feb 2010
Posts: 27
Blog Entries: 1
Rep Power: 8
Quote:
 Originally Posted by mchurchf For more description of this go take at look at section 2 of my description of buoyantBoussinesqPisoFoam at http://openfoamwiki.net/index.php/Bu...sinesqPisoFoam
Hi, mchurchf
After reading your description of buoyantBoussinesPisoFoam, I am still puzzled about the meaning of the red line in the following code, which is in the UEqn of twophaseEulerFoam.I can not find the corresponding mathematical expression, can you help me? Thank you!
UaEqn =
(
(scalar(1) + Cvm*rhob*beta/rhoa)*
(
fvm::ddt(Ua)
+ fvm::div(phia, Ua, "div(phia,Ua)")
- fvm::Sp(fvc::div(phia), Ua)
)
- fvm::laplacian(nuEffa, Ua)
+ fvc::div(Rca)
+ fvm::div(phiRa, Ua, "div(phia,Ua)")
- fvm::Sp(fvc::div(phiRa), Ua)
+ (fvc::grad(alpha)/(fvc::average(alpha) + scalar(0.001)) & Rca)
==
- fvm::Sp(beta/rhoa*K, Ua)
- beta/rhoa*(liftCoeff - Cvm*rhob*DDtUb)

November 9, 2016, 09:22
how to know there is a member function named of UEqn?
#7
New Member

DUO ZHANG
Join Date: Sep 2016
Posts: 2
Rep Power: 0
Quote:
 Originally Posted by wangle I'm a new user of OpenFOAM,now I'm analyzing a solver .But I don't know what's the meaning of UEqn().A() and UEqn().H().Can you help me translate them to mathematic form.Thank you!
I am a new user too, I wonder how to know there is a member function named A() or H() of UEqn? where can I find the definition of UEqn, I checked UEqn.H, but I can't find it, anyone can give a link of the definition of some instruction? thanks!

 November 9, 2016, 11:50 #8 New Member   khedar Join Date: Oct 2016 Posts: 29 Rep Power: 2 Hi Duo, UEqn is and object of class fvVectorMatrix so you need to search for member functions of this class to get A() or U(). Also fvVectorMatrix is basically typedef name for fvMatrix. Code: `typedef fvMatrix fvVectorMatrix` typedef fvMatrix fvVectorMatrix so you search for fvMatrix template class for finding the required member functions. This can be found here: http://openfoam.com/documentation/cp...ml/a00955.html Duo likes this.

 November 9, 2016, 11:55 #9 New Member   DUO ZHANG Join Date: Sep 2016 Posts: 2 Rep Power: 0 thanks, very helpful!

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post zhaoxinyu Fluent UDF and Scheme Programming 0 March 31, 2010 08:04 sarav Main CFD Forum 3 November 16, 2009 05:45 Sangamesh CD-adapco 0 May 15, 2007 05:15 cfdbeginner CFX 0 November 27, 2003 10:02 id Main CFD Forum 0 September 18, 2003 04:01

All times are GMT -4. The time now is 07:43.