## Fluids

#### Heat transfer to a stationary fluid due to a heat generation

Tagged:

• wassim
Subscriber
I am trying to determine the temperature distribution in a tank filled of water (at rest). The initial temperature of water is 20C. The tank has a cylindrical shape of height H = 40 cm with an internal diameter D = 40 cm. The heating is generated by an electrical heater having a diameter of 5 cm and length of 13 cm.nI used laminar model with energy on since no motion exist and I check the gravity. In the boundary condition I checked the source term with constant value of 18500 W/m3. However, the temperature of the whole domain of the fluid reaches 1700K. nI have to cut off the heat generation when the temperature of the water near the heater wall reaches 90C. How this feature can be done? Note that read the Fluent user but I didn't get the answer. nI am trying to achieved this simulation on steady state? is it possible or I have to make it in transient state?nThank you in advancen
• YasserSelima
Subscriber
Hello,nFirst, if you want to have natural convection inside the tank, you should make the fluid density as function of the temperature. nSecond, you can use an expression to turn off the heat generation when the heater wall reaches a certain temperature. Use if statement ...n
• wassim
Subscriber
Thank you for your reply nYou mean that instead of solving the problem in pressure based I have to swicth to density based? or I have to check the bossineq box in the operation conditions? nWhere can I use the if statement? n
• Rob
Ansys Employee
Not Density based: that's not going to help here. Yes, turn on the Bousinesq density. n
• YasserSelima
Subscriber
Bousinesq density works ..nWhen you are defining the heat source, use expression (click in the arrow and select expression) ...nIF(T_av = 90, 18500, 0)nYou need to define and expression for T_av firstn
• wassim
Subscriber
Thank you for your reply. nIn the volume, I want to set the initial temperature 293K. However, in the boundary conditions the volume doesn't exist. nI search in the UDF manual and I found several codes such as:n#include udf.hnDEFINE_INIT(my_init_func,d)n{ncell_t c;nThread *t;nreal xc[ND_ND];n/* loop over all cell threads in the domain */nthread_loop_c(t,d)n{n/* loop over all cells */nbegin_c_loop_all(c,t)n{nC_CENTROID(xc,c,t);nif (sqrt(ND_SUM(pow(xc[0] - 0.5,2.),npow(xc[1] - 0.5,2.),npow(xc[2] - 0.5,2.))) < 0.25)nC_T(c,t) = 400.;nelsenC_T(c,t) = 300.;n}nend_c_loop_all(c,t)n}n} nThis one is use it to set the initial temperature in a sphere with radius 0.25.nIn my case it is a cylinder.ncan you advise please.n
• YasserSelima
Subscriber
I don't think you need a UDF. This is my understanding to your case .. correct me if I am wrong. nYou have a small cylinder heater heating a larger tank.nYou have a heat generation inside the heater only.nAll the system starts from the room temperaturenYou want to turn the heat generation off, when the heater wall temperature reaches 90 CnnIf this is the case, you don't need UDFnIf the volume does not exist, this means you are not simulating solids ... Can you show the geometry and a screen shot of the boundary conditions?.n
• Rob
Ansys Employee
If you need to heat up from a certain temperature you'll need to use the Patch function: that allows you to set initial conditions in sections of the model so suit what you want. n
• wassim
Subscriber

I don't think you need a UDF. This is my understanding to your case .. correct me if I am wrong. You have a small cylinder "heater" heating a larger tank.You have a heat generation inside the heater only.All the system starts from the room temperatureYou want to turn the heat generation off, when the heater wall temperature reaches 90 CIf this is the case, you don't need UDFIf the volume does not exist, this means you are not simulating solids ... Can you show the geometry and a screen shot of the boundary conditions?https://forum.ansys.com/discussion/comment/112672#Comment_112672

What you described is correct. nI have a tank with a diameter of 50 cm and length of 40 cm. nThe heater is a cylinder with diameter of 5 cm and length of 13 cm. nI need to heat the stationary water in the tank using the electric heater (heat generation). when the temperature of water reaches 90C the heater should turn off. nIn the attached file, you can see the geometry and the boundary conditions.nThe walls are insulated with heat flux 0. In the cell boundary condition, I set a source term a constant value 18500 W/m3.nIf you want I send you the case by email. nThank you for your help. nArrayn
• YasserSelima
Subscriber
First, go expression under setup .. right click --- newnnwrite the name as T_avnin the expression write Average(Temperature, ['heater_wall'], Weight = 'Area) and save the expressionnWhen Defining the heat source, click on the arrow on the right and select expression and write IF(T_av < 90 , 18500, 0) and save the expressioow, Fluent will calculate the average heater_wall temperature and if it is below 90, the heat generation will be 18500. If the temperature goes above 90, the heat generation will be 0n
• wassim
Subscriber

First, go expression under setup .. right click --- newwrite the name as T_avin the expression write Average(Temperature, ['heater_wall'], Weight = 'Area) and save the expressionWhen Defining the heat source, click on the arrow on the right and select expression and write IF(T_av < 90 , 18500, 0) and save the expressionNow, Fluent will calculate the average heater_wall temperature and if it is below 90, the heat generation will be 18500. If the temperature goes above 90, the heat generation will be 0https://forum.ansys.com/discussion/comment/112866#Comment_112866

Thank you for your help. nWhen I define the expression, I got that is invalidnn
• YasserSelima
Subscriber
'Area' ... missing ' at the endn
• YasserSelima
Subscriber
Also use StaticTemperature instead of Temperaturen