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/)
-   -   Convective term with extra coefficient in Flux (https://www.cfd-online.com/Forums/openfoam-programming-development/176428-convective-term-extra-coefficient-flux.html)

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
(
IOobject
(
"phi_mul_gl",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
linearInterpolate(gl*U) & mesh.Sf()
);

Then,


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.