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

Velocity waveform with UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2015, 15:59
Default Velocity waveform with UDF
  #1
New Member
 
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 12
Luis12 is on a distinguished road
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
Luis12 is offline   Reply With Quote

Old   February 10, 2015, 16:37
Default
  #2
AGP
Member
 
Anonymous
Join Date: Apr 2013
Posts: 34
Rep Power: 12
AGP is on a distinguished road
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.
AGP is offline   Reply With Quote

Old   February 10, 2015, 16:51
Default
  #3
New Member
 
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 12
Luis12 is on a distinguished road
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
Luis12 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
Axisymmetric swirl - angular velocity for UDF NTSbike Fluent UDF and Scheme Programming 13 July 12, 2022 02:08
unsteady inlet velocity udf jill FLUENT 8 February 10, 2015 06:04
UDF for velocity profile egge24 Fluent UDF and Scheme Programming 0 April 4, 2012 19:57
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11
UDF component in Cyliderical Velocity? Hongchan Kim FLUENT 3 April 24, 2001 12:20


All times are GMT -4. The time now is 14:13.