CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   LduMatrix<Type, DType, LUType> (https://www.cfd-online.com/Forums/openfoam-solving/123375-ldumatrix-type-dtype-lutype.html)

behnamnasr September 11, 2013 07:48

LduMatrix<Type, DType, LUType>
 
Hi all FOAMers;

As you may know, the LduMatrix class involved in OF-2.2.x is constructed by three types as below:

LduMatrix<Type, DType, LUType>

which the first is type of the X and B (source). Second and third ones are obvious! It’s ok!

But, when OF uses "typedef" or "make" functions to rename objects for using in LduSolvers (such as PBiCCCG, …) and Preconditioners, DType and LUType are always considered as scalar. (whether Type is scalar, vector or tensor) It is much obscure for me! I don’t understand why!?

When I tried to understand cavityCoupledU tutorial in pisoFoam, I encountered this problem; Suppose my mesh is a 3x3 grid and has 9 cells, and I want to solve a coupled system for U equations (as done in cavityCoupledU tutorial in pisoFoam)! If I use predefined objects (i.e. LduMatrix<vector, scalar, scalar>) and construct the equation system (fvVectorMatrix) for my grid, I will have an array of 9 vectors for source, an array of 9 scalars for diag and two arrays of 12 scalars for lower and upper arrays. This configuration for D and LU, except the source, does not differ with an fvScalarMatrix used for a scalar equation such as pEqn.

Now, my questions are:

1) when Type is vector and matrix A in 3 equation-3 unknown system is a tensor, why are D and LU considered as scalars in OF, rather than tensors?! while X and B (in AX = B) are of vector type! Does not this corrupt the equation system (as I think)?!

2) if D and LU must be as scalars (by any reason), why we have 9 coefficients [for U equation system] for 9 cells in D, rather than 27?! I guess I need a 27x27 array for solving 3 momentum equations for a 3x3 mesh! Am I wrong?!

Thank you all in advance!
Behnam

behnamnasr October 8, 2013 06:01

OMG! :confused:

Don't anyone encounter with such a problem?!

Indeed, I have a crude guess for the reason, but not sure!

Can anyone kindly give me a hint?!


All times are GMT -4. The time now is 04:50.