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

Velocity waveform with UDF

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 10, 2015, 16:59
Default Velocity waveform with UDF
  #1
New Member
 
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 4
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, 17:37
Default
  #2
AGP
Member
 
Anonymous
Join Date: Apr 2013
Posts: 34
Rep Power: 4
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, 17:51
Default
  #3
New Member
 
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 4
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

Thread Tools
Display Modes

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 On
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 10 September 21, 2015 15:03
unsteady inlet velocity udf jill FLUENT 8 February 10, 2015 07: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 10:52.