# Velocity waveform with UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 10, 2015, 16:59 Velocity waveform with UDF #1 New Member   Luis Join Date: Nov 2013 Posts: 5 Rep Power: 5 Hi all, hope someone can help with this. I am trying to impose a transient boundary condition on an fluid flow problem in ANSYS Fluent. I've searched online and here for solutions to this problem which involve UDF's, however they all seem to include known velocity functions to represent the waveform, which I don't have. I am simulating pulsatile flow; I have my data set which includes time steps with their associated velocities, but these time steps are not all equal. Can someone please advise me on how I can represent this as my velocity inlet BC. Thanks in advance. Luis

 February 10, 2015, 17:37 #2 Member   Anonymous Join Date: Apr 2013 Posts: 34 Rep Power: 5 You can save all your time steps and velocities in individual text files. Place them in the FLUENT folder along with your udf. You can use commands like fopen and fscanf to open and read the values. For unequal time steps, write a 'for' loop that will interpolate the values between the 2 neighboring time steps.

 February 10, 2015, 17:51 #3 New Member   Luis Join Date: Nov 2013 Posts: 5 Rep Power: 5 Hey thanks for the quick reply. I'm afraid I don't know much about writing code. I have found the following UDF: #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = 0.02 + 0.005*sin(100.*t); } end_f_loop(f, thread) } As I don't have a sin function for my waveform, could you show me how to modify this function to read off my saved time and velocity values using the 'fopen' and 'fscanf' commands?. Also could you please show me how to use the 'for' loop for interpolation between two data points? Appreciate the help. Luis

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post NTSbike Fluent UDF and Scheme Programming 10 September 21, 2015 15:03 jill FLUENT 8 February 10, 2015 07:04 egge24 Fluent UDF and Scheme Programming 0 April 4, 2012 19:57 Abhi Main CFD Forum 12 July 8, 2002 09:11 Hongchan Kim FLUENT 3 April 24, 2001 12:20

All times are GMT -4. The time now is 20:33.