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.

Energy balance with variable density

Please login with a confirmed email address before reporting spam

Hello everyone,

I am interested in finding the temperature in a system that changes the density in time and I would like to formulate the energy balance using this variable density.

What I have in mind is to use

Cp * d( rho T)/dt = Q

but I find it pretty tricky to implement it in COMSOL, because of the derivative. Does anyone have any experience with this?

Nomenclature: Cp is the specific heat, rho is the density (rho = f(t)), T is the temperature and Q is the heat source in W/m3, which can be any number (just for reference)]

4 Replies Last Post 2016年4月27日 GMT-4 12:54

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年1月27日 GMT-5 07:52
Solved it!

One can simply use d(rho*T,t) in the place where you define the temperature as T and it's derivative as Tt.

Thank Thure!
Solved it! One can simply use d(rho*T,t) in the place where you define the temperature as T and it's derivative as Tt. Thank Thure!

Vitul Raj Govindaraju

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年4月27日 GMT-4 01:39
Hi Paul,

How to set a variable density for one of the phases ? I am using two phase-level set method. Could you please explain ?
Hi Paul, How to set a variable density for one of the phases ? I am using two phase-level set method. Could you please explain ?

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年4月27日 GMT-4 06:30
It's hard to say, because I don't know how you are implementing the two phase flow. Is it lump model? Or you are using PDE's? Are you building your own equations or are you using a module from COMSOL? If you are using ODE/PDE modules, then you can easily implement the density as d(rho,t) for the specific phase.
It's hard to say, because I don't know how you are implementing the two phase flow. Is it lump model? Or you are using PDE's? Are you building your own equations or are you using a module from COMSOL? If you are using ODE/PDE modules, then you can easily implement the density as d(rho,t) for the specific phase.

Please login with a confirmed email address before reporting spam

Posted: 8 years ago 2016年4月27日 GMT-4 12:54
Oh, sorry. I misread the question. To set a variable density for a phase, you can set an Interpolation Function (Global Definitions > Functions > Interpolation)

If you know the density as a function of temperature, you can write the temperature in the first column and the density in the second. Then you label the function as rho, for example, and you call it with rho(T) in your governing equations. In this case T is your Temperature variable.
Oh, sorry. I misread the question. To set a variable density for a phase, you can set an Interpolation Function (Global Definitions > Functions > Interpolation) If you know the density as a function of temperature, you can write the temperature in the first column and the density in the second. Then you label the function as rho, for example, and you call it with rho(T) in your governing equations. In this case T is your Temperature variable.

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.