|
[Sponsors] |
Adding a term in the diagonal of the matrix form of the momentum equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 3, 2020, 05:07 |
Adding a term in the diagonal of the matrix form of the momentum equation
|
#1 |
New Member
Join Date: Aug 2020
Posts: 20
Rep Power: 6 |
Hi everyone,
I'm an openfoam beginner and am trying to implement a simple addition of a term (sp) in the diagonal of the matrix form of the N-S eqns. ie: . The term should be subtracted implicitly in the diagonal of the RHS of Au=b, increasing the diagonal dominance because sp<0. In order to implement this change in OF I used the SuSp framework. I added a term in the PDE in order for it to be discretized as in the matrix form. I'm using eqn += fvm::Sp(sp/Vp,U) in the addSup function in fvOptions. I tried printing out the diagonal and the upper and lower matrices of UEqn and it appears that the diagonal indeed increases by sp, while the upper and lower remain untouched. However I'm not getting my desirable results so I was wondering if there is anything wrong with my implementation. The reason I'm confused is that I don't seem to be able to print out the system A*u=b. I did find a way online to get matrix A and vector b, by adding the UEqn's upper lower and diagonal with the BC contributions, but when i multiply this matrix by the UEqn().psi() (when the solution has converged) I do not get the UEqn().source(), which is again not equal to UEqn().boundaryCoeffs()[patchI][faceI], which i thought was supposed to be the RHS of Au=b. I am definitely getting something wrong, and probably need some good explanation of the fvMatrix class functions. I'd be very greatful if someone could point me to the right direction Thanks, A |
|
August 3, 2020, 14:12 |
|
#2 |
Senior Member
|
Replace Sp by SuSp. See https://github.com/OpenFOAM/OpenFOAM...e/fvm/fvmSup.H (and corresponding C-file).
Some details are at https://www.linkedin.com/pulse/openf...menico-lahaye/ |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Developing a matrix coefficient for a source term and adding a constrain equation | charles4allme | OpenFOAM Programming & Development | 0 | April 9, 2019 12:38 |
Energy Equation - Adding source term | cfdsolver1 | OpenFOAM Running, Solving & CFD | 9 | February 21, 2018 11:52 |
A simple question about adding Div and Grad of a source term to the momentum equation | adkar | Main CFD Forum | 5 | May 23, 2016 18:31 |
Adding source term to the momentum equation | sirpolar | FLUENT | 1 | January 6, 2016 09:29 |
what is form of momentum equation in case of cavitation in nozzle & how it is solved | arindamsantra7 | Fluent Multiphase | 0 | August 11, 2014 04:32 |