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/)
-   -   Activ Scalar transport equation (https://www.cfd-online.com/Forums/openfoam-programming-development/128330-activ-scalar-transport-equation.html)

Aurelien Thinat January 9, 2014 05:18

Activ Scalar transport equation
 
Hello everyone,

I'm trying to add an activ scalar equation on the solver buoyantSimpleFoam.

The goal :
- 2 species involved (1 standard + 1 pollutant)
- density varying on temperature (large scale of T)
- turbulent flow

So I guess I need to declare 2 differents thermo in createFields.H :

Code:

autoPtr<rhoThermo> pThermo1(rhoThermo::New(mesh));
rhoThermo& thermo1 = pThermo1();
thermo1.validate(args.executable(), "h", "e");

volScalarField rho1
(
IOobject
(
...
),
thermo1.rho1()
);

autoPtr<rhoThermo> pThermo2(rhoThermo::New(mesh));
rhoThermo& thermo2 = pThermo2();
thermo2.validate(args.executable(), "h", "e");

volScalarField rho2
(
IOobject
(
...
),
thermo2.rho2()
);

// scalar definition
volScalarField alpha2
(
IOobject
(
...
),
mesh
);

volScalarField rho
(
IOobject
(
...
),
alpha2*rho2+ (1-alpha2)*rho1
);

Does it look like the right way to code this kind of solver ?

Thank you for your help.

NB : For information, I already performed this for a passiv scalar (density of scalar = density of fluid).


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