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

UDF for Continuous Step Velocity Profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2013, 08:25
Default UDF for Continuous Step Velocity Profile
  #1
New Member
 
Naseh Hosseini
Join Date: Jul 2012
Posts: 6
Rep Power: 14
nasehandarzgoo is on a distinguished road
Hi.
I want to apply a continuous step velocity profile for my inlet.
I want it to keep fluctuating with period of 0.04 seconds until I stop iteration.
Would you please let me know how to do it and whether the way I have written that is correct.

Here is my UDF.


#include "udf.h"
DEFINE_PROFILE(Step_UDF,thread,position)
{
real x[ND_ND];
face_t f;
real u,u0=0.4;
real t;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
t = RP_Get_Real("flow-time");
if ((fabs(t/0.04)%2)==0)
u=u0;
else
u=u0*1.03;
F_PROFILE(f,thread,position)=u;
}
end_f_loop(f,thread)
}
nasehandarzgoo is offline   Reply With Quote

Old   November 14, 2013, 09:11
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Since you already have a proposed solution:
-did you try it?
-did it do what you wanted it to do?
-if not, what was wrong?
pakk is offline   Reply With Quote

Old   November 14, 2013, 12:15
Default
  #3
New Member
 
Naseh Hosseini
Join Date: Jul 2012
Posts: 6
Rep Power: 14
nasehandarzgoo is on a distinguished road
Well I tried and found that I have to mention before that both sides of % are integer.
I just found it through trial and error.
I was actually hoping that someone give me a general solution.
What I did is working for me now.

Thank you
nasehandarzgoo is offline   Reply With Quote

Reply

Tags
fluent, step, udf, velocity profile


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
3D UDF Paraboilc Velocity Profile (Can't Maintain) Sing FLUENT 12 August 7, 2017 07:25
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 14:58
Velocity profile UDF egge24 Fluent UDF and Scheme Programming 2 May 10, 2012 14:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 03:13


All times are GMT -4. The time now is 03:01.