The meanings of diag( ), source( ), psi( )
I am using the solver"porousSimpleFoam" to run simulations on a domain including porous media.
In the UEqn.H, the momentum equation is implemented as follows:
// Construct the Momentum equation
Then in the file: /src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
we have the following code:
scalarField& Udiag = UEqn.diag();
vectorField& Usource = UEqn.source();
const vectorField& U = UEqn.psi();
Does anyone know the exact meanings of UEqn.diag(), UEqn.source(), UEqn.psi() in details, e.g. what do these functions return? Or could anyone give some hints about that?
Thank you very much
See the source code documentation.
Here is the list of all members of fvMatrix since diag() is inheirited
Thanks for your reply.
In the openfoamwiki, I learn that disretization of PDE leads to an algebraic equation in the following form:
AΨ = B
So does UEqn.diag() mean the diagonal of A, UEqn.source() mean B and UEqn.psi() mean Ψ ?
Please attention to this post. ?
For example, if you are discritizing velocity, u will have an symmetry matrix. After discritization, u will have Ax = B, A will be symmetric, Then OpenFOAM will do:
[A.diag()+A.offdiag()] x = B;
A.diag() x = B - A.offdiag() x;
For symmetric matrix, A.diag() will be the diagonal of A, A.offdiag() x will be the source of A. That means if your matrix equation is like this:
A x = 0;
U also have an source() term.
|All times are GMT -4. The time now is 02:33.|