CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Create Matrix for pressure correction (https://www.cfd-online.com/Forums/openfoam-programming-development/92645-create-matrix-pressure-correction.html)

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-Ra*T*k=-grad(p)
U and k are vectors and T and Ra are scalars.

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

Thanks for Help!

mprinkey November 6, 2011 23: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 10:16.