# Full energy equation for enthalpy

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

 June 8, 2006, 09:03 Markus, I see 3 things whic #2 Member   E. David Huckaby Join Date: Mar 2009 Posts: 57 Rep Power: 8 Markus, I see 3 things which you might look at: 1) Is the enthalpy of formation included in the definition of enthalpy(i.e.): h = h_0 + cp*(T - T0) Certain thermodynamic classes include this in the definition of enthalpy. 2) There is a function to fvc:DDt() to calculate the equivalent of: fvc::ddt(p) + fvc::div(p*U) - p * fvc::div(U) (look at pEqn.H in rhoTurbFoam) should the last term be "-U & grad(p)" ? 3) You might also try discretizing tauGradU as: div( phi/interplate(rho) & interpolate(tau) ) - U & div(tau) (I believe this is similar to procedure used for calculating the U & grad(p) term in the DDt() ) David H. dongchao yang and mm.abdollahzadeh like this.

 June 8, 2006, 09:14 Ignore my comment after point #3 Member   E. David Huckaby Join Date: Mar 2009 Posts: 57 Rep Power: 8 Ignore my comment after point 2 Dave H.

 June 8, 2006, 12:35 David, thanks for your remarks #4 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 8 David, thanks for your remarks. to 1) personally i won't do any reaction, so should be alright to assume the enthalpy of formation to be zero. to 2) i wasn't aware of that function, thanks > should the last term be "-U & grad(p)" ? what do you mean? i replaced "U & grad(p)" with "div(pU) - p div(U)" to have a more conservative form. that's correct, isn't? thank you Markus

 June 12, 2006, 10:20 Marcus, Below I derived an #5 Member   E. David Huckaby Join Date: Mar 2009 Posts: 57 Rep Power: 8 Marcus, Below I derived an internal energy equation in terms of pressure and internal enthalpy by subtracting the kinetic energy equation from the total energy equation (Kuo,Combustion). I get a "non-conservative" form for the pressure: ddt(p) + U & grad(p) and a "conservative" form for the stress: div( phi/rho & tau ) - U & div(tau) derivation: total energy equation: ddt(rho,h_T) + div(phi,h_T) - ddt(p) = div(-q) + div(phi/rho & tau ) h_T = h + K K ~ mean kinetic energy h_T ~ total enthalpy 1) ddt(rho,h) + div(phi,h) - ddt(p) - ddt(rho,K) + div(phi,K) = div(-q) + div(phi/rho & tau ) kinetic energy equation ddt(rho,K) = U & ddt(rhoU) + K ddt(rho) 2) ddt(rho,K) + U & div(phi,U) + U & grad(p) + K & div(phi) = U & div(tau) subtracting 2) from 1) give an internal energy: 3) ddt(rho,h) + div(phi,h) - ( ddt(p) + U & grad(p) ) = div(-q) + ( div( phi/rho & tau) - U & div(tau) ) Dave

 June 13, 2006, 08:46 yep, looks good. I guess it i #6 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 8 yep, looks good. I guess it is a good idea to replace 'tau && grad(U)' with 'div( phi/rho & tau ) - U & div(tau)' as you suggested markus

 July 17, 2007, 07:19 I've got a question regarding #7 Member     Stefan Radl Join Date: Mar 2009 Location: Graz, Austria Posts: 82 Rep Power: 9 I've got a question regarding the flux calculation in Markus' programm (which is the same as in the sonicLiquidFoam solver). Obviously phi is the surface mass flux. in the sonicLiquidEnergyFoam however, a new surface flux is introduced: phid. This should be something like a volume flux as it is multiplied with a pressure - howevever only something like a volume... So can anybode explain what does is the meaning of phid in the code section: surfaceScalarField phid = psi* ( (fvc::interpolate(rho*U) & mesh.Sf()) + fvc::ddtPhiCorr(rUA, rho, U, phi) )/fvc::interpolate(rho); phi = (rho0/psi - p0)*phid; cheers Stefan

 July 17, 2007, 08:45 Hi Stefan, have a look here #8 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 8 Hi Stefan, have a look here, might help http://www.cfd-online.com/OpenFOAM_D...ges/1/104.html regards markus

 July 31, 2007, 09:55 Hi, I have a question about #9 New Member   isabelle choquet Join Date: Mar 2009 Location: trollhÃ¤ttan, vÃ¤stra gÃ¶taland, sweden Posts: 3 Rep Power: 8 Hi, I have a question about the enthalpy equation implemented in various solvers of openFOAM-1.4, such as buoyantFoam, sonicTurbFoam or dieselEngineFoam for instance. If I understand correctly, it seems that the viscous heating term "tauGradU", that was in Markus test (1st message above) is not accounted for in OpenFoam-1.4. Is it because viscous heating can often be assumed negligible or is there any other reason ? Best regards, Isabelle sharonyue likes this.

 July 31, 2007, 10:09 Hi Isabelle, yes, for gases #10 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 8 Hi Isabelle, yes, for gases usually negligible. regards markus

 July 31, 2007, 10:21 Dear Foamers, I've combined #11 Member     Stefan Radl Join Date: Mar 2009 Location: Graz, Austria Posts: 82 Rep Power: 9 Dear Foamers, I've combined Markus' code with a new Non-Newtonian models and Heat Transfer in the surrounding solid. If someone is interested for testing, I can send him the package via email (however, it would be a quite big package of libraries, solvers and boundary conditions). The heat of dissipation in my problem (polymer flow) plays a significant role: the temperature profile has quite significant gradients with DT = 7 [K]. br Stefan Radl

 August 28, 2007, 12:32 Hi David, I would like an ex #12 Member   cosimo bianchini Join Date: Mar 2009 Location: Florence, Tuscany, Italy Posts: 88 Rep Power: 8 Hi David, I would like an explanation about something you wrote sometime ago in this thread: tau && grad(U) = div( phi/interplate(rho) & interpolate(tau) ) - U & div(tau); I would have written something like: tau && grad(U) = div( U & tau ) - U & div(tau) In other terms how can you do (scalar & tensor)? what does that mean? (I tried something like that but I didn't manage even to compile it) I'm asking you this because I'm implementing a solver for total enthalpy so I directly need to model the div( U & tau ) term. I would prefer to make it dependent on mass flux instead of velocity. How can I do it? Thanks Cosimo __________________ Cosimo Bianchini Energy Engineering Department "S. Stecco" University of Florence Via di S.Marta, 3 50139 Florence - ITALY Tel: +39 055 4796575 Fax: +39 055 4796342 Mob: +39 320 9460153 e-mail: cosimo.bianchini@htc.de.unifi.it URL: www.htc.de.unifi.it

 August 30, 2007, 09:20 Cosimo, I made a mistake in #13 Member   E. David Huckaby Join Date: Mar 2009 Posts: 57 Rep Power: 8 Cosimo, I made a mistake in writing the first term of the equation. I used phi as though it represented the "mass flow rate vector" at the face center instead of the "mass flow rate" (scalar) at the face center normal to the face. The second term in the equation comes from subtracting the relevant term from momentum equation dotted with the velocity vector. I would revise the term as: uFace = interpolate(U,phi,"methodString"); uFace = uFace + ( phi/interpolate(rho) - uFace & mesh.Sf() ) * mesh.Sf()/mesh.magSf()/mesh.magSf(); viscDiss = div( uFace & interpolate(tau) & mesh.Sf() ) - U & div(tau) The reasoning of the above was to derive the viscous dissipation term using the discretized forms of the "total energy" and "momentum" equations as opposed to discretizing the viscous dissipation term in the "internal energy" equation from its continuous representation (tau && grad(U) ). The method as outlined above implies an inconsistency in how the stress is calculated in the momentum and energy equations. The stress used in the momentum equation is calculated directly (nearly) at the face. Whereas the above expression interpolates the stress at the face from the stress evaluated at the cell centers. Dave

 August 31, 2007, 10:45 Hi David, thanks for the answe #14 Member   cosimo bianchini Join Date: Mar 2009 Location: Florence, Tuscany, Italy Posts: 88 Rep Power: 8 Hi David, thanks for the answer. Just a couple of questions more: 1) Markus said viscous heating = tau && gradU is usually negligible for gases. However I'm solving for total enthalpy where viscous dissipation = div(U & tau) = tau && gradU + U & div(tau). Is the error for neglecting such term of the same order of magnitude as using the static enthalpy formulation or not? 2) I'm not sure wether or not turbulent stress R should be added to tau in case of turbulent flows? Thanks a lot, Cosimo __________________ Cosimo Bianchini Energy Engineering Department "S. Stecco" University of Florence Via di S.Marta, 3 50139 Florence - ITALY Tel: +39 055 4796575 Fax: +39 055 4796342 Mob: +39 320 9460153 e-mail: cosimo.bianchini@htc.de.unifi.it URL: www.htc.de.unifi.it

 September 1, 2007, 05:40 Hey Cosimo, 1) whether visc #15 Senior Member   Markus Hartinger Join Date: Mar 2009 Posts: 102 Rep Power: 8 Hey Cosimo, 1) whether viscous heating is negligible is determined by the physics. A dimensional analysis should tell you. The way you implement it doesn't really matter. 2) look at sonicTurbFoam, the turbulent fluxes need to be modeled, which is done there using the effective turbulent thermal diffusivity. If you consider viscous heating you should use the effective turbulent viscosity. regards markus

 September 3, 2007, 08:21 Hi Markus and thanks for the r #16 Member   cosimo bianchini Join Date: Mar 2009 Location: Florence, Tuscany, Italy Posts: 88 Rep Power: 8 Hi Markus and thanks for the reply but I need further clarification. 1) Maybe my question was not very clear. I was asking if on the same case (same physics) the error for neglecting viscous work was bigger in case of static enthalpy equation or total enthalpy equation. The source terms for these two different conservation equations are not the same: staticEnthalpy = tau && gradU totalEnthalpy = div(U & tau) = tau && gradU + U & div(tau) Is there a general rule to establish which one is bigger? 2) Thanks you confirm what I have implemented was correct. regards Cosimo __________________ Cosimo Bianchini Energy Engineering Department "S. Stecco" University of Florence Via di S.Marta, 3 50139 Florence - ITALY Tel: +39 055 4796575 Fax: +39 055 4796342 Mob: +39 320 9460153 e-mail: cosimo.bianchini@htc.de.unifi.it URL: www.htc.de.unifi.it

 April 22, 2009, 06:24 nonNewtonianFoam with energy eqn #17 Member   Join Date: Mar 2009 Posts: 39 Rep Power: 8 Hey.. I have a case wich require nonNewtonianFoam solver with energy equation. As mentioned here..I am intrested to test this solver. Can any body provide me code for this??? Thanks Mehulkumar Email: patel.mehulkumar.l@gmail.com

May 21, 2010, 07:43
how to implement this in OpenFoam
#18
Senior Member

Join Date: Jan 2010
Location: Stuttgart
Posts: 129
Rep Power: 7
Quote:
 Originally Posted by david_h Cosimo, I made a mistake in writing the first term of the equation. I used phi as though it represented the "mass flow rate vector" at the face center instead of the "mass flow rate" (scalar) at the face center normal to the face. The second term in the equation comes from subtracting the relevant term from momentum equation dotted with the velocity vector. I would revise the term as: uFace = interpolate(U,phi,"methodString"); uFace = uFace + ( phi/interpolate(rho) - uFace & mesh.Sf() ) * mesh.Sf()/mesh.magSf()/mesh.magSf(); viscDiss = div( uFace & interpolate(tau) & mesh.Sf() ) - U & div(tau) The reasoning of the above was to derive the viscous dissipation term using the discretized forms of the "total energy" and "momentum" equations as opposed to discretizing the viscous dissipation term in the "internal energy" equation from its continuous representation (tau && grad(U) ). The method as outlined above implies an inconsistency in how the stress is calculated in the momentum and energy equations. The stress used in the momentum equation is calculated directly (nearly) at the face. Whereas the above expression interpolates the stress at the face from the stress evaluated at the cell centers. Dave
Hi,

I now that this read is old, but i would like to know how I should implement this

uFace = interpolate(U,phi,"methodString");
uFace = uFace + ( phi/interpolate(rho) - uFace & mesh.Sf() ) * mesh.Sf()/mesh.magSf()/mesh.magSf();

viscDiss = div( uFace & interpolate(tau) & mesh.Sf() ) - U & div(tau)

in OpenFoam (1.6) speech?

I didn't succed.

Regards Chrisi

 April 23, 2012, 07:31 #19 New Member   Join Date: Dec 2011 Posts: 12 Rep Power: 5 Hi, is it possible to integrate these terms into the simpleFoam solver to get the heat due to friction in an moving liquid? Thanks!

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sergio OpenFOAM Running, Solving & CFD 0 May 19, 2008 16:43 Alberto Main CFD Forum 0 February 19, 2007 07:47 Daniel Main CFD Forum 2 October 21, 2005 17:51 Martin FLUENT 1 January 25, 2001 18:11 zhanglei Main CFD Forum 2 June 4, 2000 23:56

All times are GMT -4. The time now is 03:47.