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

UDF creating a pulse input

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2013, 20:04
Exclamation UDF creating a pulse input
  #1
New Member
 
Megan Wood
Join Date: Jan 2013
Posts: 9
Rep Power: 13
mwood is on a distinguished road
Hello

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))
{
velocity=3;
}
if ((the_current_time>=86400) && (the_current_time<88200))
{
velocity=3;
}
if ((the_current_time>=172800) && (the_current_time<174600))
{
velocity=3;
}
else
{
velocity=0
}
begin_f_loop(f,t)
{
F_PROFILE(f,t,i) = velocity;
}
end_f_loop(f,t)
}

Any help would be much appreciated.

Thanks
Megan
mwood is offline   Reply With Quote

Old   May 24, 2013, 21:47
Default
  #2
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
Remove the space between # and include in the first line and try again.
blackmask is offline   Reply With Quote

Old   May 24, 2013, 21:50
Default
  #3
New Member
 
Megan Wood
Join Date: Jan 2013
Posts: 9
Rep Power: 13
mwood is on a distinguished road
Hey,

Thanks!

However, no such luck.

Any other ideas?
mwood is offline   Reply With Quote

Old   May 24, 2013, 22:56
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 421
Blog Entries: 1
Rep Power: 22
blackmask will become famous soon enough
See this thread (http://www.cfd-online.com/Forums/flu...e-error-2.html).

Last edited by blackmask; May 25, 2013 at 01:42.
blackmask is offline   Reply With Quote

Old   May 26, 2013, 19:20
Default
  #5
New Member
 
Megan Wood
Join Date: Jan 2013
Posts: 9
Rep Power: 13
mwood is on a distinguished road
no luck with that thread either. If it were saved in the wrong spot would that cause this error?
mwood is offline   Reply With Quote

Old   May 28, 2013, 09:20
Default
  #6
Member
 
soodabe
Join Date: Apr 2013
Posts: 40
Rep Power: 13
borhan_sd@yahoo.com is on a distinguished road
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.
borhan_sd@yahoo.com is offline   Reply With Quote

Reply

Tags
parse error, pulse input, udf, varying velocity


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 parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 16:50
Tablular values as input to UDF BS FLUENT 0 March 30, 2008 19:59
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 09:13.