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

UDF velocity profile

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By kywong5
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2017, 05:07
Default UDF velocity profile
  #1
New Member
 
Join Date: Dec 2015
Location: Japan
Posts: 25
Rep Power: 10
kywong5 is on a distinguished road
Hi all,
I would like to prescribe a uniform velocity of 100m/s at an inlet by using the time argument. But I'm afraid that the way i write the code does not represents what I mean.
When I run the code, the velocity at the inlet is less than 100 m/s (around 20-30m/s). But there is no issue with the timing.

************************************************** *******
if ((the_current_time>=0) && (the_current_time<2))
{
velocity=100.00;
}
************************************************** *******
kywong5 is offline   Reply With Quote

Old   September 25, 2017, 07:35
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
You should give your complete code if you want help...

You are using a DEFINE_PROFILE, I guess? Give the complete code for this DEFINE_PROFILE.
pakk is offline   Reply With Quote

Old   September 25, 2017, 07:55
Default
  #3
New Member
 
Join Date: Dec 2015
Location: Japan
Posts: 25
Rep Power: 10
kywong5 is on a distinguished road
DEFINE_PROFILE(velocity_magnitude, t, i)
{
real velocity;
real the_current_time;
face_t f;

the_current_time = CURRENT_TIME;

if ((the_current_time>=0) && (the_current_time<2))
{
velocity=100.00;
}
else if ((the_current_time >=2))
{
velocity=0.00;
}

begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = velocity;
}
end_f_loop(f,t)
}

Thank you
soheil_r7 likes this.
kywong5 is offline   Reply With Quote

Old   September 25, 2017, 10:13
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
It looks to me that you have written a clear code that should do what you said, I can not see any mistake.

I don't understand why it does not work for you. If you don't use a UDF, but fix the velocity in Fluent (so ignoring the time), does it work then?
kywong5 likes this.
pakk is offline   Reply With Quote

Old   September 26, 2017, 09:03
Default
  #5
New Member
 
Join Date: Dec 2015
Location: Japan
Posts: 25
Rep Power: 10
kywong5 is on a distinguished road
It works without the UDF.
Red region represents 100m/s.
<https://ibb.co/iHAbDk>

By the way, I have another question.
How can I increase the red region as shown in below image (from literature)? The literature also using the same velocity 100m/s.
<https://ibb.co/foWcKQ>
kywong5 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
UDF - Inlet Velocity Profile (Ansys Fluent) vinayak4399 Fluent UDF and Scheme Programming 3 August 25, 2020 14:15
UDF for 3d velocity inlet profile in channel flow Thejas4ansys Fluent UDF and Scheme Programming 0 April 1, 2016 15:09
Velocity profile UDF egge24 Fluent UDF and Scheme Programming 2 May 10, 2012 13:03
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 19:09
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 06:47


All times are GMT -4. The time now is 20:16.