|
[Sponsors] |
August 14, 2023, 00:38 |
specific heat property UDF
|
#1 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2 |
Hello friends,
I want to define specific heat by UDF to define solid property, for that I add this UDF code but when I add this code to specific heat property it is not added and an error is coming that does not imply a user-defined function for a specific heat. DEFINE_PROPERTY(heat_capacity_particles, c, t) { real Xp, Cp_w, Cp_pd, Cp_p; Xp = 0.25; Cp_w = 4182;// Heat capacity of water Cp_pd =1200; // Heat capacity of dry particle // Calculate the heat capacity of solid particles Cp_p = Cp_w * Xp + Cp_pd; return Cp_p; } |
|
August 14, 2023, 02:00 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
this part of code is ok
do you have header Code:
#include <udf.h>
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 14, 2023, 02:17 |
|
#3 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2 |
yes, I already defined it. but it is not adding.
I also saw in the UDF manual, another specific heat function that is adding. I want to know why my defined UDF is not added in the solid property while the code is written right. another UDF is which is add successful #include "udf.h" DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi) { real cp=2000.; *h = cp*(T-Tref); return cp; } |
|
August 14, 2023, 02:23 |
|
#4 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
DEFINE_SPECIFIC_HEAT macro is an answer
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 14, 2023, 02:43 |
|
#5 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2 |
I did not understand,
My actual UDF function is given below, specific heat change with respect to moisture Xp, what should I need to change so that I can add in the solid property? DEFINE_PROPERTY(heat_capacity_particles, c, t) { real Xp, Cp_w, Cp_pd, Cp_p; Xp = 0.25; Cp_w = 4182;// Heat capacity of water Cp_pd =1200; // Heat capacity of dry particle // Calculate the heat capacity of solid particles Cp_p = Cp_w * Xp + Cp_pd; return Cp_p; } |
|
August 14, 2023, 03:02 |
|
#6 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
DEFINE_SPECIFIC_HEAT for specific heat
__________________
best regards ****************************** press LIKE if this message was helpful |
|
August 14, 2023, 03:37 |
|
#7 |
Member
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2 |
When I defined the Specific heat function as given in the manual, we need to define T, Tref, h, and Yi
in that case, UDF compiled successfully but when I added it in the property section bed termination error is coming. please look at my updated code. DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi) { real Xp, Cp_w, Cp_pd, Cp; Thread *t; cell_t c; t = THREAD_T0(t); begin_c_loop(c, t) { Xp = C_UDMI(c, t, 0); // Assuming moisture content is stored in the UDM Cp_w = 4182; // Heat capacity of water Cp_pd = 1200; // Heat capacity of dry particle // Calculate the heat capacity of solid particles Cp = Cp_w * Xp + Cp_pd; *h = Cp * (T - Tref); /* Print the result */ Message("specific_heat_particles: %f\n", Cp); } end_c_loop(c, t) return Cp; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Continuity Equation for multicomponent simulation | lordluan | CFX | 15 | May 19, 2020 18:36 |
Domain Reference Pressure and mass flow inlet boundary | AdidaKK | CFX | 75 | August 20, 2018 05:37 |
UDF for specific heat - error | tarui23 | Fluent UDF and Scheme Programming | 0 | October 13, 2013 06:30 |
error message | cuteapathy | CFX | 14 | March 20, 2012 06:45 |
How to write udf for specific heat | nanoraja | ANSYS Meshing & Geometry | 1 | September 14, 2011 11:34 |