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

UDF for Continuous Step Velocity Profile

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools 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: 5
Rep Power: 5
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: 684
Rep Power: 9
pakk is on a distinguished road
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: 5
Rep Power: 5
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

Thread Tools
Display Modes

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 On
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 9 November 26, 2014 08:58
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 13:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Variables Definition in CFX Solver 5.6 R P CFX 2 October 26, 2004 02:13


All times are GMT -4. The time now is 23:46.