|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
raymond
Join Date: Nov 2009
Posts: 149
Rep Power: 18 ![]() |
What is the main function of 'return' in udf? Since I had gone through the guide and I found that certain udf with 'return' while some did not. What the different of udf with 'return' and udf with no 'return'?
|
|
|
|
|
|
|
|
|
#2 | |
|
Senior Member
|
Quote:
if your macro is void-type, it wouldn't return any value and it just does some settings, but if it isn't void-type, it return a value and needs return command. Bests,
__________________
Amir |
||
|
|
|
||
|
|
|
#3 |
|
Senior Member
raymond
Join Date: Nov 2009
Posts: 149
Rep Power: 18 ![]() |
Thanks Amir. For example, I am having changes in species during the modelling, then I am either using macro DEFINE_SOURCE or DEFINE_VR_RATE. DEFINE_SOURCE does have 'return' while DEFINE_VR_RATE does not have. Does it mean that DEFINE_VR_RATE just doing some setting which has been pre-defined in Fluent while DEFINE_SOURCE calling for calculation and return the value to the model? Please help.
|
|
|
|
|
|
|
|
|
#4 |
|
New Member
Kristian Etienne Einarsrud
Join Date: Oct 2010
Location: Trondheim
Posts: 29
Rep Power: 17 ![]() |
Hi,
Your reasoning is correct; In DEFINE_SOURCE, you return the value of the source directly (through the "return" command), while in DEFINE_VR_RATE you update the specific reaction rate pointer (*rr_t) which is predefined by FLUENT. Cheers! |
|
|
|
|
|
|
|
|
#5 | |
|
Senior Member
|
Quote:
Code:
return source Bests,
__________________
Amir |
||
|
|
|
||
|
|
|
#6 | |
|
Senior Member
raymond
Join Date: Nov 2009
Posts: 149
Rep Power: 18 ![]() |
Quote:
|
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
| Parallelizing a UDF | tstorm | Fluent UDF and Scheme Programming | 3 | August 20, 2009 13:31 |
| Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
| I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 12:29 |
| UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |