CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   UDF creating a pulse input (

mwood May 24, 2013 19:04

UDF creating a pulse input

I am trying to create a pulse input to represent my system ideally it would have a 30min pulse every 24hrs. I have a 'line 1: parse error'
and I can't seem to figure it out
This is my code:

# include "udf.h"
DEFINE_PROFILE(velocity_magnitude, t, i)
real velocity;
real the_current_time;
face_t f;
the_current_time = CURRENT_TIME;
if ((the_current_time>=0) && (the_current_time<1800))
if ((the_current_time>=86400) && (the_current_time<88200))
if ((the_current_time>=172800) && (the_current_time<174600))
F_PROFILE(f,t,i) = velocity;

Any help would be much appreciated.


blackmask May 24, 2013 20:47

Remove the space between # and include in the first line and try again.

mwood May 24, 2013 20:50



However, no such luck.

Any other ideas?

blackmask May 24, 2013 21:56

See this thread (

mwood May 26, 2013 18:20

no luck with that thread either. If it were saved in the wrong spot would that cause this error? May 28, 2013 08:20

Hi all ,Iím new in fluent and particularly UDF, I want to model a system that a gas is inlet and it flows for 3s and doesnít flow for 3s alternatively and continuously. In fact itís our respiration flow and the model is a respiratory mask.
How should I write UDF file? Probably CURRENT_TIMESTEP Macro should be used, Is it right?
Would you tell me please how should I write the UDF? This is very important for me.
Thank you very very much in advance.

All times are GMT -4. The time now is 10:53.