CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

This UDF code was not working :(

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2022, 09:57
Smile This UDF code was not working :(
  #1
New Member
 
Thank you.
Join Date: Jun 2022
Posts: 2
Rep Power: 0
Sumin Lee is on a distinguished road
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.
Sumin Lee is offline   Reply With Quote

Old   June 30, 2022, 01:24
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
remove last line
Code:
NV_S (omega, =, 0.0);
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Old   June 30, 2022, 08:18
Default
  #3
New Member
 
Thank you.
Join Date: Jun 2022
Posts: 2
Rep Power: 0
Sumin Lee is on a distinguished road
I'm sorry, the way you told me didn't solve the problem.
Sumin Lee is offline   Reply With Quote

Reply

Tags
ansys, butterfly valve, c code, fluent, udf


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 00:19.