|
[Sponsors] |
August 9, 2013, 17:58 |
Error udf - define_profile
|
#1 |
New Member
Join Date: Feb 2013
Posts: 4
Rep Power: 13 |
Hi everybody,
I'm trying to interpreted an UDF-file but from fluent I get error all the time. It writes this error: Error: C:\BFS_channel\inlet_z_velocity.c: line 1: parse error. My UDF file looks like this: #include "udf.h" #define DELTA 0.003 /*thickness of boundary layer [m]*/ #define W 20. /*velocity in free streem [m/s]*/ #define P 1./7. /*exponent of power*/ DEFINE_PROFILE(inlet_z_velocity,thread,position) { real x [ND_ND], b; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); b=x[1]; if (b <= DELTA) { F_PROFILE(f,thread,position)=W*pow(b/DELTA,b); } else { F_PROFILE(f,thread,position)=W } } end_f_loop(f,thread) } Can anybody help me please? I think I tried everything what I know and still can't find parse error in 1st line. Thank you for your help Best regards H. |
|
August 12, 2013, 01:56 |
|
#2 |
Senior Member
|
You missed a semicolon at the end of
Code:
F_PROFILE(f,thread,position)=W; |
|
August 12, 2013, 12:28 |
|
#3 |
New Member
Join Date: Feb 2013
Posts: 4
Rep Power: 13 |
Thank you for your answer but it doesn't work anyway. So i think I will do it in CFX it will be much easier.
|
|
August 14, 2013, 08:01 |
|
#4 |
New Member
alireza
Join Date: May 2013
Location: shiraz
Posts: 11
Rep Power: 13 |
I tested this code and worked
--------------------------------------- #include "udf.h" #define DELTA 0.003 /*thickness of boundary layer [m]*/ #define W 20. /*velocity in free streem [m/s]*/ #define P 1./7. /*exponent of power*/ DEFINE_PROFILE(inlet_z_velocity,thread,position) { real x [ND_ND], b; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); b=x[1]; if (b <= DELTA) F_PROFILE(f,thread,position)=W*pow(b/DELTA,b); else F_PROFILE(f,thread,position)=W; } end_f_loop(f,thread) } --------------------------------------------- when you are using (if) doesn't need {{}} |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh | gschaider | OpenFOAM Community Contributions | 300 | October 29, 2014 19:00 |
c++ libraries and solver compiling | vaina74 | OpenFOAM Installation | 13 | February 3, 2012 18:43 |
attach/detach (valve opening/closing) | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | March 21, 2009 06:18 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
user defined function | cfduser | CFX | 0 | April 29, 2006 11:58 |