CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Create Matrix for pressure correction (

nep101 September 20, 2011 15:48

Create Matrix for pressure correction
Hey Everybody,

i try to create a Matrix UEqn for the correction Loop.
The Equatin is:
U and k are vectors and T and Ra are scalars.

Is there a way to create a Matrix like
fvVectorMatrix UEqn
- Ra*T*k
but this doesnt work:mad:

Thanks for Help!

mprinkey November 7, 2011 00:59

You need to use fvm::Sp(U) (or fvm::S for the linear source term, so something like:

fvVectorMatrix UEqn
fvm::Sp(U) - Ra*T*k

should work. Note that this is just a diagonal matrix.

All times are GMT -4. The time now is 09:05.