|
[Sponsors] |
February 10, 2015, 15:59 |
Velocity waveform with UDF
|
#1 |
New Member
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 12 |
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, 16:37 |
|
#2 |
Member
Anonymous
Join Date: Apr 2013
Posts: 34
Rep Power: 12 |
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, 16:51 |
|
#3 |
New Member
Luis
Join Date: Nov 2013
Posts: 5
Rep Power: 12 |
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 | Search this Thread |
Display Modes | |
|
|
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 |