CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding two Energy Equations to Porous Solver (http://www.cfd-online.com/Forums/openfoam-programming-development/125699-adding-two-energy-equations-porous-solver.html)

Filankes October 29, 2013 11:38

Adding two Energy Equations to Porous Solver
 
Hello everyone,

I want to simulate porous media with solid heat transfer.

I am going to add "addTwoEquationsEnthalpy" to hEqn.h

fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
);
pZones.addTwoEquationsEnthalpySource(thermo, gamma, ts, hEqn);
hEqn.relax();
hEqn.solve();
thermo.correct();

Apart from it I should add tsEqn.h equation somewhere in solver folder "I guess so"

fvScalarMatrix tsEqn
(
-fvm::laplacian(kappa,ts)
);
pZones.addTwoEquationsTsSource(thermo, gamma, ts, tsEqn);
tsEqn.relax();
tsEqn.solve();}

Here "kappa" is convection constant and "ts" is temperature of solid.

I just don't know the procedure of adding this equation to the solver. If you could help me, that would be very nice. Thank you.

Cyp October 30, 2013 17:19

Is your simulation domain only a porous medium ? In that case, I suggest you to program your own solver. You will get what you are doing under control !

Here is a full tutorial to program a 2 temperatures heat transfer solver in porous media (from slide #60)
https://www.imft.fr/IMG/pdf/INITIATI...OME_1v3-05.pdf

Everything is in French (I prepare an english version.. but not for now) but there is all the snippets and you could easily understand what you have to code.

Regards,
Cyp

Filankes December 3, 2013 06:20

This is perfrect, Thank you very much. I already started to modification of the solvers.

My simulation domain is partially (20 %) porous medium.


All times are GMT -4. The time now is 01:19.