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/)
-   -   How to correctly discretize terms with many factors (https://www.cfd-online.com/Forums/openfoam-programming-development/138981-how-correctly-discretize-terms-many-factors.html)

kasper1301 July 15, 2014 07:53

How to correctly discretize terms with many factors
 
Hi,

I am trying to implement an equation for chemical components in twoPhaseEulerFoam and I am wondering how to discretize each term in OpenFOAM.

The transport equation:
http://rogercortesi.com/eqn/tempimagedir/eqn3415.png

I was thinking that I could create some new fields, such as rhoAlpha and rhoAlphaPhi (alphaPhi already exists), and implement the equation as following

Code:

fvm::ddt(rhoAlpha1, Yi)
 + fvm:div(rhoAlphaPhi1, Yi)
 - fvm::laplacian(turbulence->muEff(), Yi)
  ==
  0

The alternative would be to apply the product rule of differentation and use the fvc schemes.

Does anyone know of any pros or cons with these approaches, maybe there exists other approaches that are better?

Kasper


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