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

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

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

Like Tree29Likes
  • 29 Post By mchurchf

Reply
 
LinkBack Thread Tools Display Modes
Old   May 2, 2010, 09:59
Default what's the meaning of UEqn().A()
  #1
New Member
 
wangle
Join Date: Dec 2009
Posts: 7
Rep Power: 7
wangle is on a distinguished road
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!
wangle is offline   Reply With Quote

Old   May 2, 2010, 10:13
Default
  #2
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 7
CedricVH is on a distinguished road
  • Terms dependent on U are included in the A field.
  • Terms not directly dependent on U are included in the H field.
CedricVH is offline   Reply With Quote

Old   May 2, 2010, 10:25
Default
  #3
New Member
 
wangle
Join Date: Dec 2009
Posts: 7
Rep Power: 7
wangle is on a distinguished road
Quote:
Originally Posted by CedricVH View Post
  • 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!
wangle is offline   Reply With Quote

Old   May 3, 2010, 10:21
Default
  #4
Member
 
Matthew J. Churchfield
Join Date: Nov 2009
Location: Boulder, Colorado, USA
Posts: 49
Rep Power: 8
mchurchf is on a distinguished road
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 fv<Type>Matrix, 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
mchurchf is offline   Reply With Quote

Old   May 4, 2010, 03:36
Default Thank you very much to help me solve the problem!
  #5
New Member
 
wangle
Join Date: Dec 2009
Posts: 7
Rep Power: 7
wangle is on a distinguished road
Quote:
Originally Posted by mchurchf View Post
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 fv<Type>Matrix, 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!
wangle is offline   Reply With Quote

Old   May 6, 2010, 02:23
Default need help
  #6
New Member
 
beauty
Join Date: Feb 2010
Posts: 27
Blog Entries: 1
Rep Power: 7
beauty is on a distinguished road
Quote:
Originally Posted by mchurchf View Post

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)
beauty is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's meaning of UDF FUNCTION zhaoxinyu Fluent UDF and Scheme Programming 0 March 31, 2010 08:04
wall y+: physic meaning sarav Main CFD Forum 3 November 16, 2009 05:45
want to know meaning Sangamesh CD-adapco 0 May 15, 2007 05:15
What's the meaning of "combustion scalar"and.... cfdbeginner CFX 0 November 27, 2003 10:02
meaning id Main CFD Forum 0 September 18, 2003 04:01


All times are GMT -4. The time now is 18:36.