Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Calculating the heat stored in a solid sub-domain

Please login with a confirmed email address before reporting spam

Hi,

I am solving a time-dependent heat transfer problem on a solid domain. The specific heat capacity (Cp) is a function of temperature. I would like to calculate the amount of heat stored in specific sub-domains as a function of time. Since Cp is not constant, I need to perform a temperature integration on Cp before I do a domain integration.

How can I do this in COMSOL? Any ideas/help would be greatly appreciated.

Thanks.

Ismail

10 Replies Last Post Nov 22, 2012, 8:12 p.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 12:04 p.m. EDT
Hi

I would say: in the Results add a domain integration of ht.Cp*T*ht.rho, but check it this varaible is not already defined by default by COMSOL ;)

--
Good luck
Ivar
Hi I would say: in the Results add a domain integration of ht.Cp*T*ht.rho, but check it this varaible is not already defined by default by COMSOL ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 12:22 p.m. EDT

Hi

I would say: in the Results add a domain integration of ht.Cp*T*ht.rho, but check it this varaible is not already defined by default by COMSOL ;)

--
Good luck
Ivar


Hi Ivar,

Thank you for your reply. Your suggestion would work just fine if Cp was constant. In my case Cp is a function of temperature. Therefore, in order to calculate the amount of heat stored, I think I need to calculate the area under the Cp versus Temperature curve (i.e. integrating Cp with respect to temperature) before I do a domain integration. This is the generalized form of enthalpy (H) definition.

H = integral (Cp . dT)

How can I do this in COMSOL?

Thanks again.

Ismail
[QUOTE] Hi I would say: in the Results add a domain integration of ht.Cp*T*ht.rho, but check it this varaible is not already defined by default by COMSOL ;) -- Good luck Ivar [/QUOTE] Hi Ivar, Thank you for your reply. Your suggestion would work just fine if Cp was constant. In my case Cp is a function of temperature. Therefore, in order to calculate the amount of heat stored, I think I need to calculate the area under the Cp versus Temperature curve (i.e. integrating Cp with respect to temperature) before I do a domain integration. This is the generalized form of enthalpy (H) definition. H = integral (Cp . dT) How can I do this in COMSOL? Thanks again. Ismail

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 12:49 p.m. EDT
Hi

if Cp is defined a Cp(T,p, ...) then COMSOl will map directly the Cp per element and per T corresponding to that elements, so I do not believe you need anything else than to write out the formula.

Now if you have defined Cp as a variable or an analytical function you need to integrate your_Cp(T)*T*ht.rho over the domain, all three of these are not truely varaibles but fields, with implicit Cp(T,p,x,y,z ...) variables, bit not shown in COMSOL notation convention

Test it out on a simple 2D example with "simple" known values to get convinced. The nice thing with COMSOl it's so easy to test the math underlaying by simple examples ;)

--
Good luck
Ivar
Hi if Cp is defined a Cp(T,p, ...) then COMSOl will map directly the Cp per element and per T corresponding to that elements, so I do not believe you need anything else than to write out the formula. Now if you have defined Cp as a variable or an analytical function you need to integrate your_Cp(T)*T*ht.rho over the domain, all three of these are not truely varaibles but fields, with implicit Cp(T,p,x,y,z ...) variables, bit not shown in COMSOL notation convention Test it out on a simple 2D example with "simple" known values to get convinced. The nice thing with COMSOl it's so easy to test the math underlaying by simple examples ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 1:25 p.m. EDT
Hi Ivar,

In my case Cp is a function of temperature and I define it via an interpolation (data source: table) under "Global Definitions" in COMSOL:

Cp(T)

And yes, at any given time point, there is a temperature distribution on my domain and we can calculate the corresponding Cp(T) distribution with no problem.

The question arises when we try to calculate the heat added into our domain:

heat added = (enthalpy at current time) - (enthalpy at time = 0)

Lets say temperature at time = 0 is T0 and the temperature at current time is T. Then,

heat added = integral of Cp(T)*dT (integrated from T0 to T)

Since Cp is not constant, the following is not true:

heat added = Cp(T)*T - Cp(T0)*T0

Yes, we can calculate Cp(T)*T in COMSOL for any given time point, but how can we take the following integral in COMSOL?

heat added = integral of Cp(T)*dT (integrated from T0 to T)

Thank you for your help.

Ismail


Hi Ivar, In my case Cp is a function of temperature and I define it via an interpolation (data source: table) under "Global Definitions" in COMSOL: Cp(T) And yes, at any given time point, there is a temperature distribution on my domain and we can calculate the corresponding Cp(T) distribution with no problem. The question arises when we try to calculate the heat added into our domain: heat added = (enthalpy at current time) - (enthalpy at time = 0) Lets say temperature at time = 0 is T0 and the temperature at current time is T. Then, heat added = integral of Cp(T)*dT (integrated from T0 to T) Since Cp is not constant, the following is not true: heat added = Cp(T)*T - Cp(T0)*T0 Yes, we can calculate Cp(T)*T in COMSOL for any given time point, but how can we take the following integral in COMSOL? heat added = integral of Cp(T)*dT (integrated from T0 to T) Thank you for your help. Ismail

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 2:19 p.m. EDT
Hi

Ok now I understand you better ;) And you are perfectly right, it's not the same

then I would say define a global dependent variable via its time derivative and have COMSOL integrate it over your time dependent solver case t. I believe that is the closest you can get.

And if I remember right the KB (knowledge base) has some entries on this too, try a search on time derivatives

--
Good luck
Ivar
Hi Ok now I understand you better ;) And you are perfectly right, it's not the same then I would say define a global dependent variable via its time derivative and have COMSOL integrate it over your time dependent solver case t. I believe that is the closest you can get. And if I remember right the KB (knowledge base) has some entries on this too, try a search on time derivatives -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 2:30 p.m. EDT
Thanks Ivar. I will give it a thought. Another idea that came to my mind is to integrate Cp(T) with respect to T manually and enter it into COMSOL as another interpolation table. It would be really nice if COMSOL did this numerically for us though!

Thanks again!

Ismail
Thanks Ivar. I will give it a thought. Another idea that came to my mind is to integrate Cp(T) with respect to T manually and enter it into COMSOL as another interpolation table. It would be really nice if COMSOL did this numerically for us though! Thanks again! Ismail

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 2:41 p.m. EDT
Hi

that is what I understand what COMSOl does if you define a global dependent variable as the integration of Cp(T)*T,
and write out the equations as a derivative. Then after a time "t" the resulting value is a time integation of the stored energy at each moment

--
Good luck
Ivar
Hi that is what I understand what COMSOl does if you define a global dependent variable as the integration of Cp(T)*T, and write out the equations as a derivative. Then after a time "t" the resulting value is a time integation of the stored energy at each moment -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 3:05 p.m. EDT
Hi Ivar,

We want to calculate:

integral of Cp(T)*dT

Per your suggestion, we can write the following by making use of the chain rule:

Cp(T)*dT = Cp(T)*(dT/dt)*dt

Then:

temperature integral of Cp(T) = time integral of Cp(T)*(dT/dt)

Great! Do you know the expression in COMSOL for the time derivative of temperature (i.e. dT/dt)?

Thanks!

Ismail
Hi Ivar, We want to calculate: integral of Cp(T)*dT Per your suggestion, we can write the following by making use of the chain rule: Cp(T)*dT = Cp(T)*(dT/dt)*dt Then: temperature integral of Cp(T) = time integral of Cp(T)*(dT/dt) Great! Do you know the expression in COMSOL for the time derivative of temperature (i.e. dT/dt)? Thanks! Ismail

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Apr 20, 2012, 3:17 p.m. EDT
Hi Ivar,

It looks like Tt is the first time derivative of temperature in COMSOL.

Thanks again for all your help!

Ismail

Hi Ivar, It looks like Tt is the first time derivative of temperature in COMSOL. Thanks again for all your help! Ismail

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Nov 22, 2012, 8:12 p.m. EST
Hi I am planing to write a partial PDE equation in comsol regarding heat transfer. Could you please help me to figure out how is possible?
Hi I am planing to write a partial PDE equation in comsol regarding heat transfer. Could you please help me to figure out how is possible?

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.