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

How to run pulsating flow simulation in Ansys fluently using UDF code?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2022, 15:38
Default How to run pulsating flow simulation in Ansys fluently using UDF code?
  #1
New Member
 
Rubén
Join Date: Aug 2022
Posts: 1
Rep Power: 0
Engineer12 is on a distinguished road
Hi everybody


I am carrying out the study of the pulsating flow of the intake of a 4-stroke engine. For this I have created this boundary condition (UDF) to simulate the suction of the engine, but when I run the Fluent simulation it does not recognize it and marks that the mass flow is 0 kg/s.


Can anyone suggest me what could be wrong?
I put the code below.


Thank you




#include "udf.h"
#include "math.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real time;
real m;
time=CURRENT_TIME;
m = 0;

begin_f_loop(f, thread)
{
if (time <= (0 + (0.00136 * m)) && time > (0.00136 + (0.00136 * m)))
F_PROFILE(f, thread, position) = 0.0;
else if (time <= (0.00136 + (0.00136 * m)) && time > (0.0027 + (0.00136 * m)))
F_PROFILE(f, thread, position) = 0.18382;
else if (time <= (0.0027 + (0.00136 * m)) && time > (0.0041 + (0.00136 * m)))
F_PROFILE(f, thread, position) = 0.0;
else if (time <= (0.0041 + (0.00136 * m)) && time > (0.0054 + (0.00136 * m)))
F_PROFILE(f, thread, position) = 0.0;
else if(time> (0.0054 + (0.00136 * m)))
m = m + 1;
}
end_f_loop(f, thread)
}
Engineer12 is offline   Reply With Quote

Old   August 15, 2022, 21:37
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
udf should be hooked properly
look into ansys fluent customization manual

also I'm expecting probles with this code as you have "m" in if condition
however m is changing inside the loop over faces -> means condition will be different at different location on the same stime moment, double check it
__________________
best regards


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

Reply


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 bug, for reversing flow direction and magnitude EngGhost Fluent UDF and Scheme Programming 12 April 20, 2020 08:50
Dumb Ansys Fluent can't compile UDF ordinary FLUENT 1 October 9, 2019 08:55
How to input a UDF code for simulaing particle-laden flow EvanHuang Fluent Multiphase 0 September 10, 2019 02:23
Flow 3D Cast_can not run simulation pcapsa FLOW-3D 2 June 21, 2013 05:21
Comparison between Solidworks Flow Simulation and Ansys Fluent Bruce828 Main CFD Forum 5 February 23, 2013 11:13


All times are GMT -4. The time now is 22:09.