CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Matrix (https://www.cfd-online.com/Forums/openfoam-solving/59960-matrix.html)

 shuo October 21, 2006 01:34

Where are the matricies stored

Where are the matricies stored?

fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
- fvm::laplacian(mu, U)
);

Is fvVectorMatrix a a template of fvMatrix class?
Is solve() a member function of fvMatrix?

Regards,

Shuo

 hjasak October 21, 2006 03:25

fvVectorMatrix is a typedef fo

fvVectorMatrix is a typedef for fvMatrix<vector>:

/home/hjasak/OpenFOAM/OpenFOAM-1.3/src/finiteVolume/fvMatrices/fvMatrix

This lot is derived from lduMatrix in the foundation library. Beware, there is a template specialisation for fvScalarMatrix.

Hrv

 olesen October 23, 2006 02:47

Hi Hrv, Since this topic fi

Hi Hrv,

Since this topic finally came up, I was wishing to know how the initial residuals of a fvVectorMatrix should be tracked. As far as I can see, since lduMatrix::solverPerformanance is non-templated, only the last residuals can be obtained - regardless of the matrix type.
Eg, the 'initialResidual' from the UEqn degenerates to that of the W-component and provides no access to the U/V information.

Is the correct workaround to calculate all of the initial residuals prior to the UEqn.solve() step, or to unwrap the fvVectorMatrix and issue the calls for the scalar components ourselves?

Thanks,
/mark

 hjasak October 23, 2006 03:01

Hello Mark, 'initialResidua

Hello Mark,

Quote:
 'initialResidual' from the UEqn degenerates to that of the W-component and provides no access to the U/V information.
A bit of leeway, please: do you think any sane person would make a mistake like the one you mention and it would remain undetected for 15 years? Of course, the reported residual is the MAXIMUM of component residuals and not the last one.

As for the issue of providing a scalar residual for a vector equation, here you are right: the underlying matrix machinery is scalar and it did not get the solverPerformance class as the appropriate type (mainly because it breaks some templating). This will be done properly (along with a suite of new solution techniques and my new super-fast solvers) in the rewrite of lduMatrix functionality.

You can, of course, simply evaluate the residual yourself before calling the solve, which will of course give you all the functionality you need. An example is clearly laid out in the existing fvMatrix classes.

Enjoy,

Hrv

 olesen October 23, 2006 03:09

Hi Hrv, Of course, the repo

Hi Hrv,

Quote:
 Of course, the reported residual is the MAXIMUM of component residuals and not the last one.
Excellent!

/mark

 All times are GMT -4. The time now is 13:21.