|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Filipe Dias
Join Date: Jul 2019
Posts: 6
Rep Power: 8 ![]() |
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 |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Sergei
Join Date: Dec 2009
Posts: 262
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. |
|
|
|
|
|
|
|
|
#3 |
|
New Member
Filipe Dias
Join Date: Jul 2019
Posts: 6
Rep Power: 8 ![]() |
Thank you for your help. Is there any page with these kinds of information?
|
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Sergei
Join Date: Dec 2009
Posts: 262
Rep Power: 22 ![]() |
Maybe reading the source code can help.
|
|
|
|
|
|
![]() |
| Tags |
| openfoam 2.1.1, volscalarmatrix |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |