CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Cp (Specific heat) UDF. When/what version??? (http://www.cfd-online.com/Forums/fluent-udf/50617-cp-specific-heat-udf-when-what-version.html)

agg February 19, 2009 16:10

Cp (Specific heat) UDF. When/what version???
 
I've seen release notes saying UDF's can be used for specific heat. I compiled and loaded a DEFINE_PROPERTY UDF in 12.0.7, but when I select "user defined" for specific heat, a dialog pops up saying no UDFs have been loaded. What gives? Is this not fully functional yet or am I doing something wrong? Thanks!

bohis February 21, 2009 05:38

Re: Cp (Specific heat) UDF. When/what version???
 
your UDF was not either loaded or you forgot to put return Cp; to your UDF


agg February 23, 2009 17:32

Re: Cp (Specific heat) UDF. When/what version???
 
Thanks for responding. Any other possibilities? I've done both.

To check my UDF, I wanted know if a DEFINE_PROPERTY had been loaded. So, I selected user-defined for the density and my UDF is there. However, doing the same with Cp gives a pop-up saying "No user-defined functions have been loaded". So, my thinking is that the Cp UDF functionality has not been completed as of version 12.0.7.

agg February 23, 2009 17:51

Use DEFINE_SPECIFIC_HEAT, not DEFINE_PROPERTY
 
The udf.h file contains the define. Here it is:

#define DEFINE_SPECIFIC_HEAT(name, T, Tref, h, yi) real name(real T, real Tref, real *h, real *yi)

So, write a UDF so as the one below...

#include "udf.h"

/* UDF that computes Cp for diatomic oxygen, O_2 */

DEFINE_SPECIFIC_HEAT(cell_cp_o2, T, Tref, h, yi) {

real Cp;

/*

define your version of Cp here...

*/

return Cp; }

agg February 25, 2009 14:02

Re: in addition to defining Cp, the code must
 
define the enthalpy for the specie (real *h) as the integral from Tref to T of the defined/returned Cp. The mass fractions, (real *yi) are given in the specie order as defined for the material.

! If the enthalpy is not defined, calculations requiring the energy equation will not work.

ashrawage January 10, 2013 21:25

About the equation for h in the UDF for Cp
 
Quote:

Originally Posted by agg
;156886
define the enthalpy for the specie (real *h) as the integral from Tref to T of the defined/returned Cp. The mass fractions, (real *yi) are given in the specie order as defined for the material.

! If the enthalpy is not defined, calculations requiring the energy equation will not work.

Hi
I have been trying to to what you said for a while but I seem to be having a problem with the way FLuent is calculating enthalpy. The integration i have done is correct for the polynomial for Cp (T) but Fluent is pulling a Tref value which causes my h to go negative.
Can you give me any advice regarding this?
Thanks

iriswang May 3, 2013 09:09

udf-cp
 
Quote:

Originally Posted by agg
;156886
define the enthalpy for the specie (real *h) as the integral from Tref to T of the defined/returned Cp. The mass fractions, (real *yi) are given in the specie order as defined for the material.

! If the enthalpy is not defined, calculations requiring the energy equation will not work.

can you tell me the detail function of the T, Tref, h, yi?????

iriswang May 3, 2013 09:17

udf-cp
 
Quote:

Originally Posted by ashrawage (Post 401297)
Hi
I have been trying to to what you said for a while but I seem to be having a problem with the way FLuent is calculating enthalpy. The integration i have done is correct for the polynomial for Cp (T) but Fluent is pulling a Tref value which causes my h to go negative.
Can you give me any advice regarding this?
Thanks

would you introduce the function of (T, Tref, h, yi) minutely?? especialy the h, yi.
and i also want to know how to get the "T",because there is not any position parameter among (T, Tref, h, yi).....very thanks:p


All times are GMT -4. The time now is 13:50.