|
[Sponsors] |
October 4, 2019, 10:47 |
Parabolic 3D velocity profile
|
#1 |
New Member
Mattia Lupo
Join Date: Oct 2019
Posts: 1
Rep Power: 0 |
Good afternoon,
I've written the following UDF in order to obtain a 3D transient parabolic velocity profile for a cylindrical pype. The outlet is at 0 static pressure, L=0.02 m, D=0.00156 m. #include "udf.h" #include "math.h" DEFINE_PROFILE(inlet_x_velocity,thread,index) { real posVector[ND_ND]; real y; real x; real z; real a; real R; face_t f; real v_in_avg; real a0,a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,a6,b6,a7,b7,a8,b8 ,w; real tt; tt=CURRENT_TIME; a0 = 1.204; a1 = -0.7902 ; b1 =0.6605; a2 = -0.304; b2 = -0.6178; a3 = 0.2219; b3 =-0.09491; a4 = 0.07092 ; b4 = 0.1358 ; a5 = -0.05621; b5 = 0.08825; a6 = -0.09846; b6 = -0.00592; a7=-0.01869; b7=-0.06586; a8=0.01712; b8=-0.02417; w =25.48; v_in_avg = a0 + a1*cos(tt*w) + b1*sin(tt*w) + a2*cos(2.0*tt*w) + b2*sin(2.0*tt*w) + a3*cos(3.0*tt*w) + b3*sin(3.0*tt*w)+ a4*cos(4.0*tt*w) + b4*sin(4.0*tt*w)+a5*cos(5.0*tt*w) + b5*sin(5.0*tt*w)+ a6*cos(6.0*tt*w) +b6*sin(6.0*tt*w)+ a7*cos(7.0*tt*w) + b7*sin(7.0*tt*w)+a8*cos(8.0*tt*w) + b8*sin(8.0*tt*w); begin_f_loop(f,thread) { F_CENTROID(posVector,f,thread); x=posVector[0]; y=posVector[1]; z=posVector[2]; a=pow((pow(y,2)+pow(z,2)),0.5); R=0.00078; F_PROFILE(f,thread,index)=2*v_in_avg*(1-(pow(a,2)/(pow(R,2))); } end_f_loop(f,thread) } The UDF is interpreted correctly. The first problem is that the velocity profile is not parabolic from the inlet, but it needs approximately 10 mm (1/3 of the total length). I've tried a steady-state simulation and the profile is parabolic from the inlet. Another issue regards the pressure values calculcated at each time step. I've noticed they are different from the steady-state simulations (and so are the pressure drops). For example, by applying Pouiselle's law far from the inlet, I can't obtain the expected values. Does anyone have any thoughts about it? Thank you if you read until here Last edited by mattialupo; October 8, 2019 at 10:33. Reason: I have solved some issues with the previous code |
|
October 15, 2019, 08:35 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
you had type
Code:
F_PROFILE(f,thread,index)=2*v_in_avg*(1-(pow(a,2)/(pow(R,2))));
__________________
best regards ****************************** press LIKE if this message was helpful |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to read transient velocity profile data as inlet condition at each time step | hemmt | FLUENT | 12 | July 9, 2018 03:26 |
how to edit files for a parabolic velocity profile | bitacovir | OpenFOAM Pre-Processing | 1 | October 7, 2013 11:52 |
[swak4Foam] parabolic velocity profile with fluctuations (groovyBC?) | newOFuser | OpenFOAM Community Contributions | 17 | July 15, 2013 18:27 |
Multi step transient UDF velocity profile problem | William177 | FLUENT | 1 | February 3, 2008 07:47 |
How to create a parabolic velocity profile | Nelson | FLUENT | 0 | July 7, 2005 03:49 |