|
[Sponsors] |
June 24, 2022, 09:57 |
This UDF code was not working :(
|
#1 |
New Member
Thank you.
Join Date: Jun 2022
Posts: 2
Rep Power: 0 |
Dear Mr. / Ms.,
I made a code for UDF. My purpose was to simulate the opening and closing of the butterfly valve in the pipe in 3D. But The code was not working. Even in fluent, the code is loaded as UDF in fluent. There is the code below. #include "udf.h" #include "math.h" #include "dynamesh_tools.h" DEFINE_CG_MOTION(motion, dt, vel, omega, time, dtime) { real u = 5.0; real a = 1.0; real t1 = u/a; real t2 = t1 +0.1; real t3 = t2 +t1; real angular; if ( time < t1) { angular = -0; omega[1]= angular; } else if ( (time > t1) && (time <=t2)) { angular = -900; omega[1]= angular; } else if ( (time > t2) && (time <=t3)) { angular = -0; omega[1]= angular; } else { angular = -0; omega[1]= angular; } NV_S (omega, =, 0.0); } I want to that the butterfly valve stays open for 5 seconds, closes in 0.1 seconds, and stays closed for 5 seconds. |
|
June 30, 2022, 01:24 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
remove last line
Code:
NV_S (omega, =, 0.0);
__________________
best regards ****************************** press LIKE if this message was helpful |
|
June 30, 2022, 08:18 |
|
#3 |
New Member
Thank you.
Join Date: Jun 2022
Posts: 2
Rep Power: 0 |
I'm sorry, the way you told me didn't solve the problem.
|
|
Tags |
ansys, butterfly valve, c code, fluent, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Code doesn't work | force_95 | FLUENT | 7 | October 30, 2019 01:19 |
Urgent help for UDF Code needed | force_95 | FLUENT | 2 | October 25, 2019 08:35 |
Need help with udf code for particles | force_95 | FLUENT | 0 | October 24, 2019 09:58 |
Difficulty with UDF code for HEAT FLUX | etudiant_IITB | Fluent UDF and Scheme Programming | 1 | December 7, 2015 09:07 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |