|
[Sponsors] |
April 7, 2015, 00:10 |
A udf question~
|
#1 |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
Hi~
I have defined the global variations in the udf, and I want to reset the value of variations to zero after every fluent step. how to achieve this? tks a lot~ |
|
April 7, 2015, 20:04 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Could you include the UDF code you're asking about?
|
|
April 7, 2015, 22:20 |
|
#3 |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
I set 2 global variables in udf, and they are used to accumulate the results of source.
After each iteration of fluent step, the new results are added to the old one. so I want to reset the global variables to zero for the new step. simple code as: static real Sesum=0.; DEFINE_SOURCE(engergy,c,t,dS,eqn) { real se=0.; se=C_T(c,t); Sesum+=se; return se; } |
|
April 7, 2015, 22:45 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The User-defined ADJUST hook is executed at the start of each iteration before the transport equations are solved. For example, to reset a variable to zero at each iteration:
Code:
DEFINE_ADJUST(my_adjust,d) { a_global_variable=0.; } |
|
April 7, 2015, 22:52 |
|
#5 |
New Member
Tao Ning
Join Date: Mar 2015
Posts: 23
Rep Power: 11 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
Source Term UDF VS Porous Media Model | pchoopanya | Fluent UDF and Scheme Programming | 1 | August 28, 2013 07:12 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |