|
[Sponsors] |
April 15, 2015, 14:44 |
UDF for Velocity Inlet of Blood Flow
|
#1 |
New Member
Join Date: Aug 2014
Posts: 3
Rep Power: 12 |
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. |
|
April 16, 2015, 07:21 |
|
#2 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
#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); } |
|
April 16, 2015, 14:18 |
|
#3 |
New Member
Join Date: Aug 2014
Posts: 3
Rep Power: 12 |
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 |
|
April 17, 2015, 00:45 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Try using the variable names they have provided in the UDF manual:
Code:
DEFINE_PROFILE(inlet_velocity, t, i) |
|
Tags |
fluent - udf |
|
|
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 |