# UDF on-off Pulsed velocity inlet

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

 March 10, 2002, 23:07 UDF on-off Pulsed velocity inlet #1 Samuel Guest   Posts: n/a Sponsored Links Hi, I've got a problem using UDF for inlet velocity profile. I have managed to write in Matlab file, but having trouble to write in Fluent UDF file. **********vinlet.m*********** clear all;
for I=0:Per:0.5
for t = I:0.001:I+Per
if(t<=I+Per/3), Flow = abs(A*sin(3*pi*t/Per)); else Flow = 0; end plot (t,Flow); hold on;
end
end
plot (t,Flow); *****END****** *******vinlet.c*********** #include "udf.h" DEFINE_PROFILE(inlet_xv_sinusoidal, /* function name */
{
face_t f; real pi = 4*atan(1); real U = 36.6; real A = 3*pi*U/2; real Per = 0.1; real i; real flow_time = RP_Get_Real("flow-time"); for (i=0:Per:flow_time) /* NOT sure how to define "for" or is this possible? */ {
if (flow_time <= i+Per/3.) { F_PROFILE(f,thread,nv) = fabs(A*sin(0.3*pi*flow_time)); /* What is an equivalent command for "hold on" in Fluent or is this possible?*/ } else { F_PROFILE(f,thread,nv) = 0.; }
} end *****END******** I am trying to model on-off pulsed jet with 1:2 ratio. My real question is how to create a loop for the cycles in terms of flow_time. As in the matlab, I just defined this cycle (the fisrt loop, i = 0:0.1:0.5) where 0.5 being a chosen number, as in the FLUENT, it should be defined in "Interate" FLUENT GUI panel as "number of time step". Is it possible to create a loop for flow_time? Any inputs will be appreciated! Thanks sam

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post haihek FLUENT 5 December 15, 2010 19:58 sara FLUENT 0 October 11, 2007 18:04 Knut Lehmann Main CFD Forum 2 June 29, 2007 04:53 Ray Hong FLUENT 4 December 30, 2005 13:32 Faruk Beyca FLUENT 3 November 28, 2005 15:25