|
[Sponsors] |
July 12, 2019, 13:35 |
volScalarMatrix adding and subtracting
|
#1 |
New Member
Filipe Dias
Join Date: Jul 2019
Posts: 6
Rep Power: 7 |
Good afternoon!
I have a question about the usage of the -= command in implementing in volScalarMatrix. For example, consider the species continuity equation: ddt(rho)+div(rho*U)+div(J)=w So, starting by defining the Matrix with the convective terms: fvScalarMatrix rhoYEqn (fvm::ddt(rhoY)+fvc::div(rho*U)); Then to add the diffusive term: rhoYeqn+= fvc::div(J); And, finally, the source term: rhoYeqn-= w; I copied this from another code, and haven't been able to find it elsewhere. The code is also fairly complex, and I can't compare the equations. My question is this: are the signs on the diffusive and source term correct? Thank you kindly for your help |
|
July 14, 2019, 09:34 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Seems like everything is fine here. Moreover you can replace
rhoYeqn-= w; with rhoYeqn == w; to state explicitly that your source tern goes to the right hand side. |
|
July 14, 2019, 19:51 |
|
#3 |
New Member
Filipe Dias
Join Date: Jul 2019
Posts: 6
Rep Power: 7 |
Thank you for your help. Is there any page with these kinds of information?
|
|
July 19, 2019, 15:01 |
|
#4 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Maybe reading the source code can help.
|
|
Tags |
openfoam 2.1.1, volscalarmatrix |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding an internal heat source for compressibleTwoPhaseEulerFoam | Kenna | OpenFOAM Programming & Development | 3 | September 17, 2013 04:51 |