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

UDF for mass flow profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2012, 08:27
Default UDF for mass flow profile
  #1
Senior Member
 
Join Date: Mar 2009
Location: Indiana, US
Posts: 186
Rep Power: 17
delaneyluke is on a distinguished road
Hi,

I am new at writing UDF's and need help with a UDF for a mass flow profile on an outlet plane.
The mass flow varies along the x-direction across the plane by the following formula
tsat-((0.75*(tout-tin)*y^2)+(1.75*(tout-tin)*y)+tin)

The UDF i have written is as follows

#include "udf.h"
 
DEFINE_PROFILE (mass_profile, t i)
{
real x[ND_ND];
real y;
face_t f;
int tsat=35;
int tin=32.78;
int tout=34.44;
begin_f_loop (f,t)
{
F_CENTROID (x,f,t);
y = x[2];
F_PROFILE = tsat-((0.75*(tout-tin)*y^2)+(1.75*(tout-tin)*y)+tin);
}
end_f_loop (f,t)
}

Keep getting "line 1 : parse error" when trying to interpret the UDF into Fluent

Any help appreciated

Regards
Luke

Last edited by delaneyluke; May 18, 2012 at 01:23.
delaneyluke is offline   Reply With Quote

Old   May 23, 2012, 22:55
Default
  #2
New Member
 
Join Date: Apr 2012
Posts: 20
Blog Entries: 3
Rep Power: 14
Guava Wang is on a distinguished road
Quote:
Originally Posted by delaneyluke View Post
Hi,

 
DEFINE_PROFILE (mass_profile, t i)
{
real x[ND_ND];
real y;
face_t f;
int tsat=35;
int tin=32.78;
int tout=34.44;
begin_f_loop (f,t)
{
F_CENTROID (x,f,t);
y = x[2];
F_PROFILE = tsat-((0.75*(tout-tin)*y^2)+(1.75*(tout-tin)*y)+tin);
}
end_f_loop (f,t)
}

Keep getting "line 1 : parse error" when trying to interpret the UDF into Fluent

Any help appreciated

Regards
Luke
Line 1 should be like that
DEFINE_PROFILE (mass_profile, t ,i)
there miss "," in this macro
Guava Wang is offline   Reply With Quote

Old   May 23, 2012, 23:45
Default
  #3
Member
 
Krishna
Join Date: Oct 2009
Posts: 34
Rep Power: 17
t.krishnamohan is on a distinguished road
#include "udf.h"
 
DEFINE_PROFILE (mass_profile, t i)
{
real x[ND_ND];
real y;
face_t f;


/* define temp as float/ real

int tsat=35;
int tin=32.78;
int tout=34.44;


begin_f_loop (f,t)
{
F_CENTROID (x,f,t);

/* y=x[1]; to get the y cood


y = x[2];

/* F_PROFILE(f, t, i)

F_PROFILE = tsat-((0.75*(tout-tin)*y^2)+(1.75*(tout-tin)*y)+tin);
}
end_f_loop (f,t)
}

Keep getting "line 1 : parse error" when trying to interpret the UDF into Fluent

Any help appreciated

Regards
Luke
t.krishnamohan is offline   Reply With Quote

Reply

Tags
define_profile


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
UDF to measure Mass Flow Rate a.lynchy Fluent UDF and Scheme Programming 31 October 4, 2018 15:10
volume flow rate error in udf jjchristophe Fluent UDF and Scheme Programming 1 July 13, 2010 05:23
Associating profile files for the UDS though a UDF Bharath FLUENT 0 December 1, 2006 16:58
UDF temp. profile BC Shashikant FLUENT 0 June 24, 2006 04:16
UDF for pulsing flow. J. Keays FLUENT 0 February 1, 2001 11:19


All times are GMT -4. The time now is 16:20.