# rhoPimpleFoam energy equation understanding problem he

 Register Blogs Members List Search Today's Posts Mark Forums Read

 May 28, 2020, 08:04 rhoPimpleFoam energy equation understanding problem he #1 Member   alexander thierfelder Join Date: Dec 2019 Posts: 71 Rep Power: 5 Hey,I looked into rhoPimpleFoam source code and I wonder about the energy equation. I have some questions for that. 1) Why is he.name() == "e" necessary? 2) I applied an fvOptions scalarCodedSource term to it, what was only possible on "e" not on "he", but fvOptions(rho, he) is coded into the equation, and also the correction is called on "he" fvOptions.correct(he). Is that just because of 1) ? scalarCodedSource fvOptions example moving heat source 3) Where does the temperature field "T" gets calculated, since it does not even get created in "createFields"? ( I think it has to be somehow implemented in the "thermo" functionality what is for me whitchcraft until now, I would be very happy for some advice to begin my research about "thermo") Code: ```{ volScalarField& he = thermo.he(); fvScalarMatrix EEqn ( fvm::div(phi, he) + ( he.name() == "e" ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) ) - fvm::laplacian(turbulence->alphaEff(), he) == fvOptions(rho, he) ); EEqn.relax(); fvOptions.constrain(EEqn); EEqn.solve(); fvOptions.correct(he); thermo.correct(); }``` It would be very nice if someone of you takes some time for answering, or even just giving some hints. Thank you in advance.

 May 28, 2020, 11:15 #2 Senior Member   Michael Alletto Join Date: Jun 2018 Location: Bremen Posts: 613 Rep Power: 15 In openfoam you can either solve an equation for the internal energy ("e") or enthalpy ("he"). This is the if else statement in the energy equation. Once solved the energy equation, the temperature is calculated in the termo package. For the latter see https://caefn.com/openfoam/temperature-calculation superkelle likes this.

 May 28, 2020, 11:33 #3 Member   alexander thierfelder Join Date: Dec 2019 Posts: 71 Rep Power: 5 Isn't it quite confusing that there is not a dummy variable instead of "he" ? So for example "x" that get set to "e" or "he" .

 July 12, 2020, 19:18 #4 Senior Member   Joachim Herb Join Date: Sep 2010 Posts: 650 Rep Power: 21 he is the dummy variable. Enthalpy is "h". In he.name() it is store, what is actually solved (e or h) and then the energy equation is modified accordingly. See : https://cfd.direct/openfoam/energy-equation/

 Tags eeqn.h, rhopimpledymfoam, thermo