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

UDF for Velocity Inlet of Blood Flow

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2015, 14:44
Default UDF for Velocity Inlet of Blood Flow
  #1
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 12
n_bowen is on a distinguished road
Hi,

I am trying to run a simulation of blood flow with a user defined velocity inlet boundary condition.

Here is the udf that I use:

#include "udf.h"
#define PI 3.141592654

DEFINE_PROFILE(inlet_velocity, thread, index)
{
face_t f;
begin_f_loop(f, thread)
double t = (CURRENT_TIME*2-floor(CURRENT_TIME*2))/2;

{
if(t <= 0.218)
F_PROFILE(f, thread, index) = 0.5*sin(4*PI*(t+0.0160236));
else
F_PROFILE(f, thread, index) = 0.1;
}
end_f_loop(f, thread);
}


I get this error as I try to Interpret the function:
line 3: syntax error.

I am going through all example UDF files and cannot see what the problem is.


Thanks for your help.
n_bowen is offline   Reply With Quote

Old   April 16, 2015, 07:21
Default
  #2
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
#include "udf.h"

DEFINE_PROFILE(inlet_velocity, thread, index)
{
face_t f;
double t;

begin_f_loop(f, thread)
{
t = (CURRENT_TIME*2-floor(CURRENT_TIME*2))/2;
if(t <= 0.218)
F_PROFILE(f, thread, index) = 0.5*sin(4*M_PI()*(t+0.0160236));
else
F_PROFILE(f, thread, index) = 0.1;
}
end_f_loop(f, thread);
}
upeksa is offline   Reply With Quote

Old   April 16, 2015, 14:18
Default
  #3
New Member
 
Join Date: Aug 2014
Posts: 3
Rep Power: 12
n_bowen is on a distinguished road
Upeksa,

Thanks for your reply.

It looks like there is a problem with this line: DEFINE_PROFILE(inlet_velocity, thread, index)

since now that I have eliminated the line: #define PI 3.141592654

I'm getting the same error with a change in the line number:
line 2: syntax error
n_bowen is offline   Reply With Quote

Old   April 17, 2015, 00:45
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Try using the variable names they have provided in the UDF manual:

Code:
DEFINE_PROFILE(inlet_velocity, t, i)
Replace "thread" with "t" and replace "index" with "i". If this correction doesn't eliminate the syntax error, try using an example DEFINE_PROFILE macro to check you're interpreting/compiling and enabling the profile correctly.
`e` is offline   Reply With Quote

Reply

Tags
fluent - udf


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 problems with porous flow Nicolastheterminator Fluent UDF and Scheme Programming 0 April 8, 2014 10:12
"Closing" a pressure inlet via UDF? dave88 Fluent UDF and Scheme Programming 0 August 27, 2013 19:14
Setting Inlet as Wall until flow occurs via UDF emmkell Fluent UDF and Scheme Programming 0 May 1, 2012 13:05
Velocity Inlet BC -- Flow Reversal salihovic FLUENT 0 May 8, 2011 06:45
udf for transient mass flow rate inlet mdzubairmanipal@gmail.com Fluent UDF and Scheme Programming 0 February 22, 2011 03:51


All times are GMT -4. The time now is 16:54.