Help! -User Difined Functions----Drag Coefficient
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. |
Re: Help! -User Difined Functions----Drag Coeffici
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 |
Re: Help! -User Difined Functions----Drag Coeffici
Thanks AP, I will try as you advised. Colin
|
Re: Help! -User Difined Functions----Drag Coeffici
I forgot a semicolon in this line, in my first function:
real Cd; sorry Hi :) ap |
Re: Help! -User Difined Functions----Drag Coeffici
Hi, ap, they work! Thanks.
|
Re: Help! -User Difined Functions----Drag Coeffici
Great.
Hi :) ap |
All times are GMT -4. The time now is 18:09. |