|
[Sponsors] |
June 15, 2016, 19:50 |
3D udf parabolic inlet bc
|
#1 |
New Member
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9 |
Hi, As I just started using fluent, I am looking for someone who has or at least can help me to turn this code into a 3D code, In fact, I have found the 2D parabolic profile but as my simulation are in 3D, I will need a 3D profil ...
/* vprofile.c */ /* UDF for specifying steady-state velocity profile boundary condition */ /************************************************** *********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20.; } end_f_loop(f, thread) } Thanking you .. |
|
June 15, 2016, 22:47 |
|
#2 |
Senior Member
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25 |
It is not very complicated. I can't give you a complete answer, because I don't know how your inlet is oriented. I've made a few changes to your code. Xf[] is the face centroid vector. x,y,z are the coordinates picked out of that vector. So, that is easy access to your location data. Then you just need to change the F_PROFILE function line to match your boundary conditions using the x, y, and/or z coordinates.
Code:
/* vprofile.c */ /* UDF for specifying steady-state velocity profile boundary condition */ /***********************************************************************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real Xf[ND_ND]; /* this will hold the position vector */ real x,y,z; face_t f; begin_f_loop(f, thread) { F_CENTROID(Xf,f,thread); x = Xf[0]; y = Xf[1]; z = Xf[2]; F_PROFILE(f, thread, position) = 20. - y*y/(.0745*.0745)*20 - z*z/(....); } end_f_loop(f, thread) } |
|
June 16, 2016, 03:32 |
|
#3 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,764
Rep Power: 71 |
It is not clear to me if you have a full confined 3D inflow or a 2D profile to repeat periodically in spanwise direction
|
|
June 16, 2016, 08:27 |
|
#4 | |
New Member
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9 |
Quote:
I have this but it still doesn't work ... /* vprofile.c */ /* UDF for specifying steady-state velocity profile boundary condition */ /************************************************** *********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; real z; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); z = x[2]-0.6095; F_PROFILE(f, thread, position) = 20*(1.0 - z * z / (0.6095*0.6095)); } end_f_loop(f, thread) } |
||
June 16, 2016, 08:30 |
|
#5 | |
New Member
Hussam boujjat
Join Date: Jun 2016
Posts: 5
Rep Power: 9 |
Quote:
/* vprofile.c */ /* UDF for specifying steady-state velocity profile boundary condition */ /************************************************** *********************/ #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, position) { real x[ND_ND]; real z; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); z = x[2]-0.6095; F_PROFILE(f, thread, position) = 20*(1.0 - z * z / (0.6095*0.6095)); } end_f_loop(f, thread) } it still doesn't want to work I don't have a parabolic profile at the inlet and I don't understand why, for the inlet, it is defined between z=0 to z=1.2 I really don't know why.. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Unsteady velocity parabolic profile | Rashad | FLUENT | 3 | October 1, 2018 15:27 |
3D velocity inlet UDF | zumaqiong | Fluent UDF and Scheme Programming | 2 | October 24, 2016 04:44 |
UDF fluent:Change boundary condition. determination inlet and outlet boundary in "t" | gzamiri@gmail.com | FLUENT | 0 | September 27, 2015 05:32 |
Parabolic Inlet velocity UDF parse error | Musa | Fluent UDF and Scheme Programming | 1 | August 29, 2012 01:37 |
simpleFoam Blows up with Parabolic Inlet Pipe Flow | swahono | OpenFOAM | 0 | December 6, 2010 19:37 |