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

Why A() is a scalarField ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2023, 04:50
Default Why A() is a scalarField ?
  #1
New Member
 
Join Date: Mar 2020
Posts: 11
Rep Power: 6
GV871 is on a distinguished road
Hello all,


looking at the fvMatrix class (but you also see it in all the incompressible solvers), I noticed that the A() method return a volScalarField, while the H() a volumetric field based on the type.
I would have expected a field base on type also for the A(), or the matrix diagonal for every component.
Since I am wrong, could someone explain it to me ?
Thank you
GV871 is offline   Reply With Quote

Old   October 18, 2023, 06:02
Default Just a convenient note
  #2
New Member
 
ZP zhao
Join Date: Oct 2023
Location: China
Posts: 7
Rep Power: 3
ZX-zha is on a distinguished road
In my opinion, A() comes from
MU=-\nabla p
and
MU=AU-H
where A is a diagonal matrix, H is a non-diagonal matrix
For the sake of simplicity, we can treat A as a fvScalarField, namely ignoring zeros in A matrix.
ZX-zha is offline   Reply With Quote

Old   October 18, 2023, 10:59
Default
  #3
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by ZX-zha View Post
In my opinion, A() comes from
MU=-\nabla p
and
MU=AU-H
where A is a diagonal matrix, H is a non-diagonal matrix
For the sake of simplicity, we can treat A as a fvScalarField, namely ignoring zeros in A matrix.
Just to add to this response, look at the fvMatrix code and you will see that A() just returns the matrix diagonal coefficients (dimensionless) divided by the cell volume. Hence, this is always a volScalar. By contrast, the dimensions of H() are the same as the dimensions of the matrix source term, and so depend on the matrix equation that is being solved - the post above shows one example where it has the dimensions of a volVectorField, but it could be anything.

Last edited by Tobermory; October 18, 2023 at 12:01.
Tobermory is offline   Reply With Quote

Old   October 18, 2023, 12:07
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 737
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by ZX-zha View Post
In my opinion, A() comes from
MU=-\nabla p
and
MU=AU-H
where A is a diagonal matrix, H is a non-diagonal matrix
For the sake of simplicity, we can treat A as a fvScalarField, namely ignoring zeros in A matrix.
I think a better description of the matrix equation, for OpenFOAM, is as follows:
M U^*= Q^n -\nabla p^n

where Q is the source term. Now define H as the sum of the source term minus the off-diagonal terms of MU, then
AU^*=H -\nabla p

where AU contains the remaining diagonal terms from MU. Using this terminology, you should be able to follow through the coding in the pEqn more easily.
Tobermory is offline   Reply With Quote

Reply

Tags
finite volume method, opefoam, programing


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
Bizarre behavior of passing a scalarField to another scalarField randolph OpenFOAM 0 October 24, 2020 20:08
Interpolating scalarField values between two non conformal patches goku15 OpenFOAM Running, Solving & CFD 3 May 31, 2019 13:17
char combustion chemistry; multi-step raection, coalChemistryFoam Shuai_W OpenFOAM Running, Solving & CFD 3 February 18, 2019 07:32
Divergence of a scalarField in two forms RaghavendraRohith OpenFOAM Programming & Development 1 August 23, 2016 11:34
How to calculate T+gradT where T is volScalarField and gradT is scalarField ??? Zhiheng Wang OpenFOAM Programming & Development 4 May 28, 2016 14:51


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