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

Matrix

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 21, 2006, 01:34
Default Where are the matricies stored
  #1
shuo
Guest
 
Posts: n/a
Where are the matricies stored?

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

solve(UEqn == -fvc::grad(p));

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

Regards,

Shuo
  Reply With Quote

Old   October 21, 2006, 03:25
Default fvVectorMatrix is a typedef fo
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 23, 2006, 02:47
Default Hi Hrv, Since this topic fi
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
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
olesen is offline   Reply With Quote

Old   October 23, 2006, 03:01
Default Hello Mark, 'initialResidua
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
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
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   October 23, 2006, 03:09
Default Hi Hrv, Of course, the repo
  #5
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Hi Hrv,

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

/mark
olesen 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
Addressing matrix element and reuse of system matrix marziolettich OpenFOAM Running, Solving & CFD 2 February 19, 2008 06:04
Roe matrix srinath Main CFD Forum 2 March 26, 2003 11:39
about Roe matrix ! Root Willow Main CFD Forum 2 October 15, 2002 04:26
Elemtary matrix to CSR global matrix xueying Main CFD Forum 2 September 24, 2002 09:44
Gradient Matrix in FEM Astrid Barros Main CFD Forum 3 November 30, 1998 21:09


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