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

Help needed in udf for a pulsatile flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2021, 23:29
Default Help needed in udf for a pulsatile flow
  #1
New Member
 
mohit dhoriya
Join Date: Mar 2018
Posts: 9
Rep Power: 8
mohit68 is on a distinguished road
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.
mohit68 is offline   Reply With Quote

Old   November 21, 2021, 23:53
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,683
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran 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
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


All times are GMT -4. The time now is 08:04.