|
[Sponsors] |
November 21, 2021, 23:29 |
Help needed in udf for a pulsatile flow
|
#1 |
New Member
mohit dhoriya
Join Date: Mar 2018
Posts: 9
Rep Power: 8 |
I want to simulate pulsating flow in ansys fluent and I found a udf online. But I'm having trouble understanding a few functions in it.
Here's the code : Face_t f; Begin_f_loop (f,th) Double t =( current_time*2- floor(current_time*2))/2; { If (t<=0.218) F _profile (f,th,i)= 4*sin(4*pi*(t+0.0160236); Else F _profile (f,th,i)= 0; } All I need to know is what values does the current_time return. How is t defined and what is the significance of 0.0160236 in the function. |
|
November 21, 2021, 23:53 |
|
#2 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,683
Rep Power: 66 |
t is defined as such:
Code:
Double t =( current_time*2- floor(current_time*2))/2; current time is not defined anywhere here. But presumably there is a line somewhere else declaring the shared variable, e.g.: Code:
real current time; current_time = CURRENT_TIME; 0.0160236 is a time-shift (i.e a phase shift). There could be a million reasons why such a phase shift was coded here, but it is a phase shift nonetheless. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Intuition for why flow follows convex surfaces | lopp | Main CFD Forum | 47 | February 1, 2022 13:14 |
UDF bug, for reversing flow direction and magnitude | EngGhost | Fluent UDF and Scheme Programming | 12 | April 20, 2020 07:50 |
Pulsatile waveform of flow rate | amsys | CFX | 1 | March 2, 2020 10:06 |
udf -pulsatile flow | parthanitr | Fluent UDF and Scheme Programming | 1 | August 15, 2013 04:45 |
3D pulsatile blood flow UDF | Michal | Main CFD Forum | 0 | February 25, 2005 07:18 |