CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   mass transport having different diffusity in each direction (

wes1204 November 8, 2013 06:27

mass transport having different diffusity in each direction
1 Attachment(s)
hello foamer

I am making my own solver related to mass transport in turbulent flow.

first, i made the solver of mass transport having same diffusity of concentration in each direction like:

fvScalarMatrix CEqn
+ fvm::div(phi, C)
- fvm::laplacian(turbulence->nut() / 0.5, C)



the code above is added pimple solver to calculate concentration C.

this solver is for river flow and turbulent diffusity of mass is

nut() / 0.5

it is eddy-viscosity over Prandtl number(in this case, Prandtl number is 0.5)

that is, mass spread out having same diffusion coefficient in x,y,z

but now, i want to consider different coefficient in each direction like attached equation.

different coefficient is definded D1, D2, D3 as scalar.

D1, D2, D3 is calculated by some equations.

if scalar value D1, D2, D3 can be located in vector matrix after D1,D2,D3 is calculated, i think it is easy to programming as i want.
Dt=(D1, D2, D3)
fvScalarMatrix CEqn
+ fvm::div(phi, C)
- Dt&fvm::laplacian( C)



actually i dont know openfoam programming exactly.
I am just beginer for programming.
so i'm not sure whether - Dt&fvm::laplacian(C) is right expression in openfoam language or not

plz help me.

the point is make vector using scalar which is calculated

jherb February 10, 2014 10:01

If you haven't solved your problem meanwhile: Here is the documentation of the OpenFOAM operators:

jdmac6 February 21, 2014 16:45

Did you ever figure this out? What is the syntax to access the components of the vector Dt in fvScalarMatrix?

All times are GMT -4. The time now is 15:17.