CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

specific heat property UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 14, 2023, 00:38
Default specific heat property UDF
  #1
Member
 
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2
Chhotelal1234 is on a distinguished road
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;
}
Chhotelal1234 is offline   Reply With Quote

Old   August 14, 2023, 02:00
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
this part of code is ok
do you have header
Code:
#include <udf.h>
???
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 14, 2023, 02:17
Default
  #3
Member
 
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2
Chhotelal1234 is on a distinguished road
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;
}
Chhotelal1234 is offline   Reply With Quote

Old   August 14, 2023, 02:23
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
DEFINE_SPECIFIC_HEAT macro is an answer
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 14, 2023, 02:43
Default
  #5
Member
 
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2
Chhotelal1234 is on a distinguished road
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;
}
Chhotelal1234 is offline   Reply With Quote

Old   August 14, 2023, 03:02
Default
  #6
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
DEFINE_SPECIFIC_HEAT for specific heat
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   August 14, 2023, 03:37
Default
  #7
Member
 
Chhotelal
Join Date: Jun 2023
Posts: 31
Rep Power: 2
Chhotelal1234 is on a distinguished road
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;
}
Chhotelal1234 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 00:15.