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

UDF on-off Pulsed velocity inlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 10, 2002, 23:07
Default UDF on-off Pulsed velocity inlet
  #1
Samuel
Guest
 
Posts: n/a
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;
<blockquote>
for I=0:Per:0.5
<blockquote>


for t = I:0.001:I+Per




<blockquote>


if(t<=I+Per/3),

Flow = abs(A*sin(3*pi*t/Per));

else

Flow = 0;

end

plot (t,Flow);

hold on;


</blockquote>


end
</blockquote>
end
</blockquote>
plot (t,Flow);
*****END******

*******vinlet.c***********

#include "udf.h"

DEFINE_PROFILE(inlet_xv_sinusoidal, /* function name */ <blockquote> <blockquote>

<blockquote>

<blockquote>


thread, /* thread */



nv) /* variable number */


</blockquote>

</blockquote> </blockquote> </blockquote>
{

<blockquote>
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? */

{
<blockquote>


begin_f_loop (f,thread)

{




<blockquote>


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.;

}


</blockquote>


}



end_f_loop (f,thread)
</blockquote>
}

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

  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 parabolic velocity inlet with unsteady case Faruk Beyca FLUENT 4 June 24, 2022 11:45
UDF for Velocity change at inlet haihek FLUENT 7 August 2, 2019 08:45
USED UDF for inlet velocity in 3D sara FLUENT 0 October 11, 2007 19:04
Fluent UDF load and apply inlet velocity b.c. Knut Lehmann Main CFD Forum 2 June 29, 2007 05:53
Urgent! Help on UDF to set inlet velocity Ray Hong FLUENT 4 December 30, 2005 13:32


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