CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming


Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   July 13, 2009, 12:34
Post udf
New Member
Join Date: Jul 2009
Posts: 4
Rep Power: 10
mmoja is on a distinguished road
Hello experts,
Below is a short UDF i wrote to calculate the density of supercritical CO2, however it
does not run, it gives a floating point error.
If firstly,I replace the C_P(c,t) with a value say 2 bars it calculates the correct
density though constant throughout. Secondly, if I initialize the gauge pressure in the
solve menu, it uses that value as C_P(c,t) which results to constant density in the
bed... does not depict any pressure drop or change.
I just wandering and wondering where the problem could be.
inlet boundary condition- mass inflow and pressure outlet BC.

#include "udf.h"
#define B 1.1
#define Q 0.2
#define D 0.01
#define R 188.90
#define K 1.330

DEFINE_PROPERTY(superfluid_density, c, t)
real rho;
real press;
real p_operating;
real temp= C_T(c,t);
press = C_P(c,t);
rho = D*pow(press,B)/pow(temp,Q);
return rho;
DEFINE_PROPERTY(sound_speed, c, t)
real a;
real temp = C_T(c,t);
a = sqrt(R*K*temp);
return a;
mmoja is offline   Reply With Quote

Old   July 23, 2009, 02:17
Byron Smith R J
Join Date: Mar 2009
Location: India
Posts: 46
Rep Power: 10
byronsmith is on a distinguished road
The macro for density is C_R(c,t) in mem.h try using the macro instead of the variable rho
byronsmith is offline   Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
I need UDF help. S.Whitney FLUENT 0 October 15, 2007 11:29
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

All times are GMT -4. The time now is 14:18.