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

Doubt in DEFINE_SPECIFIC_HEAT macro

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By anuarun

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2017, 07:41
Default Enthalpy calculated from DEFINE_SPECIFIC_HEAT macro-doubt
  #1
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 9
anuarun is on a distinguished road
Dear friends,
Below is an excerpt from Fluent manual.

"The UDF must return the real value of the specific heat, and set the sensible enthalpy to the value
referenced by the real pointer h. The entropy is calculated by Fluent as
S=Cp(Tmean)*log(T/Tref)
, where
Cp
is computed by the UDF at
Tmean, the logarithmic average of T and Tref".
2.3.31.3. Example
/************************************************** ********************
UDF that computes specific heat and sets the sensible enthalpy
to the referenced value
************************************************** *********************/
#include "udf.h"
DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi)
{
real cp=2000.;
*h = cp*(T-Tref);
return cp;
}
"
This is as per Fluent UDF User Manual. If cp is computed at Tmean, what does "real cp=2000.;" mean? It is as if we are setting Cp at 2000J/(kg.K). I got confused. Since specific heat macro is already called from within a loop, this will automatically set the Cp value at all cells to be 2000J/(kg.K), right? Then what is the meaning of above statement? I do not know whether I am interpreting it wrongly. I have few more doubts. I will list those.
1.How the macro works?
2.What is the definition of h("enthalpy") in fluent? It seems to be different from the text book definition.
3.What is the reference temp to be given?
4.Is it absolutely necessary that the Cp macro must be compiled (so given in manual)? I do not have visual studio to compile. My Cp udf got interpreted nicely but do not know if it works fine inernally.

Sorry for the long message. I could not help it since no details are given in manual. Please direct me friends.

Last edited by anuarun; May 10, 2017 at 04:54. Reason: To add more details
anuarun is offline   Reply With Quote

Old   May 9, 2017, 07:48
Default
  #2
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 9
anuarun is on a distinguished road
posted by mistake

Last edited by anuarun; May 10, 2017 at 04:49.
anuarun is offline   Reply With Quote

Old   June 24, 2017, 11:02
Default
  #3
Member
 
NGP
Join Date: Mar 2016
Posts: 33
Rep Power: 10
ngonbadipoor@yahoo.com is on a distinguished road
Hi
did you find your answers?


Sent from my iPad using CFD Online Forum mobile app
ngonbadipoor@yahoo.com is offline   Reply With Quote

Old   June 26, 2017, 02:29
Default
  #4
New Member
 
Anuja Vijayan
Join Date: Mar 2017
Location: Thiruvananthapuram
Posts: 23
Rep Power: 9
anuarun is on a distinguished road
I did not find answer to these fundamental questions yet, though I managed to solve my actual problem of writing the temperature and property UDFs!

If you know, Please tell me so that I can add it to the knowledge repository
anuarun 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
timestep extraction for macro manuc Tecplot 0 August 10, 2016 12:20
Doubt about F_FLUX(f,tf) macro & VOF ?!!!!!!!! asghari FLUENT 2 October 28, 2012 03:03
Macro problem cfddummy Siemens 1 April 9, 2007 12:37
Doubt Regarding macro calculator option in CFX Sridevi CFX 0 December 21, 2005 03:55
Call a macro from a macro Flav Siemens 2 July 1, 2004 05:42


All times are GMT -4. The time now is 22:42.