|
[Sponsors] |
July 9, 2011, 04:46 |
Error message udf file
|
#1 |
New Member
A BIBI
Join Date: Jul 2011
Posts: 3
Rep Power: 15 |
Hello,
i want to introduce a velocity profile at the inlet of a 3D tube. My udf file is: #include "udf.h" DEFINE_PROFILE(inlet_z_velocity,thread,index) { real z[ND_ND]; real x; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(z,f,thread); x = x[0]; y = x[1]; F_PROFILE(f,thread,index) = 0.217*pow(pow((pow(y,2)+pow(x,2)),0.5)/3.9,1/7); } end_f_loop(f,thread) } When i put it in fluent i've got the message line11: subscripted expression is not an array or pointer : double Thks for your help |
|
July 9, 2011, 06:06 |
|
#2 |
New Member
Josy
Join Date: Mar 2009
Location: India
Posts: 29
Rep Power: 17 |
Hi,
I think z = x[2]; has to be added. Check and see. |
|
July 9, 2011, 06:35 |
|
#3 |
New Member
A BIBI
Join Date: Jul 2011
Posts: 3
Rep Power: 15 |
Now fluent read the file but it is not what i expect
To be more precise, the face is on the XY plane and the velocity orientated in the z direction. But if i check the initialization, the profile is flat. I modified the file like that:#include "udf.h" DEFINE_PROFILE(inlet_z_velocity,thread,index) { real z[ND_ND]; real x; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(z,f,thread); x = z[1]; y = z[2]; F_PROFILE(f,thread,index) = 0.217*pow(pow((pow(y,2)+pow(x,2)),0.5)/3.9,1/7); } end_f_loop(f,thread) } Last edited by Keskidi; July 9, 2011 at 09:56. |
|
July 9, 2011, 18:19 |
|
#4 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18 |
You want to calculate velocity magnitude in z direction?
If I understand what you want, that could be like that: Code:
#include "udf.h" DEFINE_PROFILE(inlet_z_velocity,thread,index) { real coord[ND_ND]; /* face centroid coordinate */ real x; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(coord,f,thread); x = coord[0]; y = coord[1]; F_PROFILE(f,thread,index) = 0.217*pow(pow((pow(y,2)+pow(x,2)),0.5)/3.9,1./7); } end_f_loop(f,thread) } |
|
July 9, 2011, 18:48 |
|
#5 |
New Member
A BIBI
Join Date: Jul 2011
Posts: 3
Rep Power: 15 |
Yes exactly.
It's working well with 1./7 Thanks a lot |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 14:43 |
[OpenFOAM] Paraview command not found | hardy | ParaView | 7 | September 18, 2008 05:59 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |