CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Square Wave Profile

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

LinkBack Thread Tools Display Modes
Old   June 18, 2005, 23:30
Default Square Wave Profile
manish mehta
Posts: n/a
Dear All,

How do I generate a square wave profile for a pressure inlet boundary condition? I tried FFT but there are some problems with this. I need this to be a discontinous flow, because my pressure needs to have a square profile from 0 psi to 180 psi. I do not know how to write this as a UDF code. Can someone please help me?

Thanks. Manish
  Reply With Quote

Old   June 20, 2005, 10:40
Default Re: Square Wave Profile
Posts: n/a
Hi, I've incluced a modified version of a UDF I used to prescribe a time-dependent velocity at the inlet of a pipe. I've modified it quickly so check for errors.

To use this, either interpret or compile this UDF and go to define/boundary-conditions. Choose the face on which you want to use the pressure pulse and choose the UDF named "pressurepulse" in this case.

If you need more details, let me know.

Regards, David ---------------------------------------------------

#include "udf.h"

DEFINE_PROFILE(pressurepulse, thread, position) { real x[ND_ND]; float t, velocity,w,y,z; face_t f;

t = RP_Get_Real("flow-time"); w=floor (t); z=t-w;/* z is ranging from 0 to 1 in this case but the time variable could be modified */

if (z<0.4) pressure = 0; else pressure =180;

begin_f_loop(f, thread) {


y = x[1];

F_PROFILE(f, thread, position) = pressure;

} end_f_loop(f, thread)

  Reply With Quote


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
Fully developed 3d velocity profile: Square inlet! Taru FLUENT 6 September 14, 2015 08:38
UDF for Square Wave Emmanuel FLUENT 2 March 13, 2010 09:36
Free surface water wave profile John N. FLUENT 0 February 2, 2009 17:17
UDF for square wave velocity profile..pls help Frederik FLUENT 0 May 8, 2006 06:48
udf_square wave profile Ramin FLUENT 0 March 8, 2006 10:38

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