CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Problem, adding passive scalar transport for turbulent, compressible flow (

cryple February 26, 2013 10:01

Problem, adding passive scalar transport for turbulent, compressible flow
Hey everybody,

I'm currently trying to implement passive salar transport for visualization of concentrations in my turbulent, compressible jet in crossflow simulation with rhoCentralFoam and the komegaSST model.

I read a lot about passive scalar transport for incompressible cases and also for turbulent cases, but it is the compressible thing that makes me a headake... :-/

I implemented alphaNEqn.H with alphaN, being the dimensionless concentration as follows:


fvScalarMatrix alphaNEqn
+ fvm::div(phi, alphaN)
- fvm::laplacian(DalphaN, alphaN)

DalphaN, being the diffusion coefficient with units [m^2/s].

Obviously, the units of the unsteady and convective term on the left do not correspont to the units of the diffusion term on the right. I think that rho has to be added to the diffusion term aswell, but I don't know how to do that.

Dividing the whole equation by rho is also not possible, because it is compressible.

So... does anybody have an idea, what I should do in this case?

By the way... DalphaN is computed using


dimensionedScalar myMi
dimensionedScalar myd
dimensionedScalar mykB
dimensionedScalar myN
dimensionedScalar myPI
volScalarField DalphaN

I know it is not the most elegant way, but I wanted to be sure using the right units and honestly, I don't know how to get the constants from within the code... ;-)

Thanks in advance...

cryple February 26, 2013 12:42

After some trys, I realized that adding rho to the diffusive term like here


fvm::ddt(rho, alphaN)
+ fvm::div(phi, alphaN)
- fvm::laplacian(DalphaN*rho, alphaN)

really solves the dimension problem. BUT I'm not sure if this is allowed in respect to the underlying physics of the problem.

Can anybody say something about that?

In addition, the now calculated alphaN, which is initialized as 1 in the jet flow and 0 in the crossflow increases slightly above 1 (< 1.09) in regions of high density gradients and in other regions it also decreases slightly below 0 (> 0.9999). That should not be possible for how I wanted alphaN to be.

Does anybody know why that happens? The overall picture of the alphaN field looks allright. Could the mesh be the problem? It is still pretty coarse for testing reasons. Or should I devide alphaNEqn by density though?


bhushanvelis March 25, 2013 12:00

Hi Thanks
Thanks it worked for me too :)

All times are GMT -4. The time now is 16:13.