CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Convective term with extra coefficient in Flux (

onlyacan August 18, 2016 05:03

Convective term with extra coefficient in Flux
Hello, dear openFOAM user,

For a incompressible flow, the flux phi used in convection term
fvm::div(phi, volScalarField)
is calculated in the "createPhi.H" as
linearIntepolate(U) & mesh.Sf()
Now I have a term like div( gl * U T), where gl is an extra coefficient. My current solution is create a new flux called phi_mul_gl as
phi_mul_gl = linearIntepolate(gl) * phi
and then we have
fvm::div(phi_mul_gl, volScalarField)
It works, but I don't know how this kind of term is normally handled in your case?

Jerryfan August 18, 2016 12:05

Hi Can,

I think the way you use is OK. But if I were you, I might do it a little bit different.

surfaceScalarField phi_mul_gl
linearInterpolate(gl*U) & mesh.Sf()


fvm::div(phi_mul_gl, volScalarField)

Any way, it's the same thing. I just don't want to linearInterpolate twice.

All times are GMT -4. The time now is 04:29.