# Help! -User Difined Functions----Drag Coefficient

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

 March 13, 2004, 13:10 Help! -User Difined Functions----Drag Coefficient #1 Colin Guest   Posts: n/a Hi, I am using Eulerian Model for multiphase flow. In the model, the drag coefficient is 1.0. And I defined the UDF of Drag coefficient as follows: #include "udf.h" DEFINE_EXCHANGE_PROPERTY(drag, cell, x_thread, s, f) { Cd = 1.0; return Cd; } When the UDF is interpreted, Fluent says "Cd" is an undeclared variable. Even if I declare Cd is a real later, Fluent still showed me the same message. Could someone help me? Thank you.

 March 14, 2004, 16:04 Re: Help! -User Difined Functions----Drag Coeffici #2 ap Guest   Posts: n/a Cd is a variable, and you must define it *before* you use it. Usually, it's a good idea to define variables as local, in order to use them only when needed: DEFINE_EXCHANGE_PROPERTY(drag, cell, x_thread, s, f) { real Cd Cd = 1.0; return Cd; } or, easier: DEFINE_EXCHANGE_PROPERTY(drag, cell, x_thread, s, f) { return 1.0; } Hi ap

 March 14, 2004, 17:41 Re: Help! -User Difined Functions----Drag Coeffici #3 Colin Guest   Posts: n/a Thanks AP, I will try as you advised. Colin

 March 14, 2004, 17:52 Re: Help! -User Difined Functions----Drag Coeffici #4 ap Guest   Posts: n/a I forgot a semicolon in this line, in my first function: real Cd; sorry Hi ap

 March 15, 2004, 15:10 Re: Help! -User Difined Functions----Drag Coeffici #5 Colin Guest   Posts: n/a Hi, ap, they work! Thanks.

 March 15, 2004, 20:04 Re: Help! -User Difined Functions----Drag Coeffici #6 ap Guest   Posts: n/a Great. Hi ap

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post MFerris CFX 44 May 11, 2015 18:27 abhishek.mnit FLUENT 0 April 29, 2009 23:48 Bloshchitsyn Vladimir CFX 0 October 17, 2007 06:28 Fabrice FLUENT 2 July 18, 2006 08:27 Mark Main CFD Forum 8 April 19, 2004 09:55

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