CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)

 ttdtud July 9, 2008 05:37

I have used interFoam to simul

I have used interFoam to simulate falling films. In case of isothermal investigations have been performed successfully.
Now i am going to simulate falling films with heat transfer. Then the energy eqaution must be added into the standard interFoam solver.
Any advice and hint would be appreciated!

 caw July 10, 2008 11:05

Hi Hy, just some thoughts:

Hi Hy,

just some thoughts: I would say that your problem comes from the fact that the call of
"twoPhaseProperties.correct();"
does NOT take care of Cp and lambda but only of viscosity. Therefore you have to update the volume averaged fields for lambda and Cp every timestep on your own.

I would then suggest to use a different formulation for your T Equation. Assuming Cp is constant just divide by Cp.

This would get you to something like:
fvScalarMatrix TEqn
(
fvm::ddt(rho,T)
+fvm::div(rhoPhi,T)
-fvm::laplacian(lambda_div_CP,T)
);

You then have to recalculate the field lambda_div_CP every timestep based on gamma.

Best regards
Christian

 ttdtud July 11, 2008 04:48

Hi Christian, thank you ver

Hi Christian,

yes you are right. The Cp and lambda have not been recalculated according "gamma". Only rho is calculated by means of "gamma".

Bue i donot know why it occured? You said because of accessment "twoPhaseProperties.correct()", can you give me some explainations?

You also advised me that i should adjust my "TEqn" and calculate the new "lambda_div_Cp". i.e. I should correct it in "createFields.H", right?

Best Regards
Yu

 caw July 11, 2008 08:06

Hi Yu, have a look at: Ope

Hi Yu,

have a look at:
OpenFOAM\OpenFOAM-1.4.1\src\transportModels\incompressible\incompres sibleTwoPhas eMixture\twoPhaseMixture.H

There you can find:
//- Correct the laminar viscosity
void correct()
{
calcNu();
}

which only recalculates nu

>"TEqn" and calculate the new "lambda_div_Cp".
>i.e. I should correct it in "createFields.H",
>right?

Yes and no. You have to introduce the new Field lambda_div_Cp in the createFields.H, but you have to recalculate it every timestep based on gamma.
This has to be done outside the createFields.H because this file is only called once on solver startup. Just do the recalculation before calling solve(T....);

Best regards.
Christian

 hsieh July 15, 2008 21:15

Hi, Yu, Did you have any lu

Hi, Yu,

Did you have any luck adding temperature to interFoam? If you are successful, can you post the new solver?

pei

 ttdtud July 16, 2008 06:59

Hi Pei, soory I have not su

Hi Pei,

soory I have not succeeded. I have tried to adjust my Solver. However, one good news is that after adjustment "rho, cp and lambda" have been recalculated successflully according to "gamma". But the results of test case have fatal errors.

Anaway, if I finish this task I will upload it in time.

Yu

 hsieh July 16, 2008 08:25

Hi, Yu, Thanks! If you n

Hi, Yu,

Thanks!

If you need someone to do some testing of your new solver, please let me know. I will be glad to help.

Pei

 haghajani May 19, 2009 11:06

Dear All

Have anybody of you got success in adding temperature to interFoam?

The equation I am trying to add is;
(1)

I know that, a surfaceScalarField should be exist to update thermal conductivity in each time step
(2)
{Landa_eff = Landa + Cp*nuSgs()}, I have Les Turbulence Model as well.

To comply the Eq.2, should I modify a new library for Landa(Thermal conductivity), to call it in TEqn as twoPhaseProperties.landa(), or something else. I also tried with Creatfield and it didn't worked.

Kindly,
Hamed

hamed.aghajani@gmail.com
h.aghajani@kingston.ac.uk

 zakifoam May 21, 2009 00:38

Hi Hamed,

You can add turbulent Prandtl in the transportProperties. Make a header file called "readProperties.H" and in it do as following:

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::NO_WRITE
)
);

dimensionedScalar Pr_t
(
transportProperties.lookup("Pr_t")
);

regards,

zaki

 haghajani May 21, 2009 03:45

Gamma term in the energy equation

Dear Zaki,

Have you realized, why the energy equation is derived in the format shown in paper? I mean the gamma is included in to equation.

Regards,
Hamed

 farhagim June 14, 2010 12:17

Hi Hamed,

have you been sucessfull in adding energy equation in to LEs Interfoam solver. can you can you help me to do that too??

thanks,
Mehran

Quote:
 Originally Posted by haghajani (Post 216819) Dear Zaki, Thanks for replying, Have you realized, why the energy equation is derived in the format shown in paper? I mean the gamma is included in to equation. Regards, Hamed

 haghajani June 14, 2010 12:52

Mehran,

Hope you'd find it usefull;

surfaceScalarField landaf = fvc::interpolate(landa);
surfaceScalarField landaEff
(
"landaEff",
landaf
+ fvc::interpolate(rho*Cp*turbulence->nut())
);
// mu-sgs (Sub-grid scale dynamic viscosity)
//Lamba: Thermal Conductivity

fvScalarMatrix hEqn
(
rho * Cp*
(
fvm::ddt(T)
+ fvm::div(phi, T) //div(Foam::volScalarField&, Foam::volScalarField&)
)
- fvm::laplacian(landaEff, T)
);

hEqn.solve();

Hamed

 farhagim June 17, 2010 12:32

Thanks Hamed..I will add these line. I think I might have some other question from you during this week. Thanks for your help ;)

Mehran
Quote:
 Originally Posted by haghajani (Post 262951) Mehran, Hope you'd find it usefull; surfaceScalarField landaf = fvc::interpolate(landa); surfaceScalarField landaEff ( "landaEff", landaf + fvc::interpolate(rho*Cp*turbulence->nut()) ); // mu-sgs (Sub-grid scale dynamic viscosity) //Lamba: Thermal Conductivity fvScalarMatrix hEqn ( rho * Cp* ( fvm::ddt(T) + fvm::div(phi, T) //div(Foam::volScalarField&, Foam::volScalarField&) ) - fvm::laplacian(landaEff, T) ); hEqn.solve(); Hamed