|
[Sponsors] |
Simple parabolic velocity UDF with symmetry - what am I not understanding!?! |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 29, 2016, 22:47 |
Simple parabolic velocity UDF with symmetry - what am I not understanding!?!
|
#1 |
New Member
Join Date: Nov 2014
Posts: 6
Rep Power: 12 |
Hello all,
This is post is relatively long, but I wanted to be comprehensive. I have been struggling with this for a couple days, and just not able to make any sense of it. I have been using Fluent for several years, on and off, based on various projects, am have decided I would like to begin to use UDF's to enhance my models. In the current model (see System.jpg) I have a inlet (at the top) firing a jet into the cavity (at the bottom) (the vertical is the y direction, and the horizontal is the x). It is a 2D model and symmetric, thus I have utilized a symmetry plane as seen in the center of system.jpg. Additionally, the flow is multiphase. I am trying to apply a UDF to the inlet, in order to have a parabolic velocity profile. For you Fluent Guru's, I am sure this is a simple task, but I cant for the life of me understand what is going on. I have reviewed the user manual, youtube videos, supplementary information I found online and most importantly, the example presented in Define_Profile in the UDF manual, but am still not able to generate the required profile after manipulating the variables. The best I have been able to accomplish, is using the .c file in this youtube video (https://www.youtube.com/watch?v=PXTPfREgLzE), which is: #include "udf.h" DEFINE_PROFILE(vel_profile_udf2, thread, position) { float y[ND_ND]; /* this will hold the position vector */ float x, w; face_t f; w=0.0001275; /* inlet radius in m */ begin_f_loop(f, thread) { F_CENTROID(y,f,thread); x=2*(y[0]-0.5*w)/w; /* non-dimensional x coord */ F_PROFILE(f, thread, position) = 0.01*(1.0-x*x); } end_f_loop(f, thread) } The result I get when applying it to my model are shown in the zoomed in image vectors.jpg (at the inlet). The velocity profile is obviously not what I looking for, but it is the closest I have been able to get to anything that is not a constant velocity profile. Since these UDF's are in C, I might ask some stupid questions regarding coding, since almost all of my programming is done in MATLAB. Now that I have described my issue and background, here are my questions: - How can I see the values of each variable, after each iteration? I think that would help me understand what is going on. What software/method do you recommend? - What exactly does the Define_Profile do? From my understanding, it names the UDF in the GUI, points to the zone to be assessed (i.e. the thread), when the user selects it in the boundary conditions (in my case 'inlet'), and points to the variable it is being (in my case the y component of velocity). Am I correct? - How is Fluent interpreting the variables when they are declared? Does declaring float x pre-allocate an array space, or does the Define_Profile macro do something with it? - What is the purpose of holding y constant? - I assume begin_f_loop is another macro that loops over each face, correct? - What is the x variable doing in each iteration? What does y[0] mean, or point to? Based on my model, with the corner between the inlet and symmetry lines being the origin, what are the the values of x, y and the velocity output of F_Profile after the first three iterations? Thanks in advanced!!!!! |
|
September 30, 2016, 12:42 |
|
#2 |
New Member
Join Date: Nov 2014
Posts: 6
Rep Power: 12 |
Bumping thread. Still looking for support. Cheers
|
|
Tags |
fluent, profile boundary, symmetry, udf, velocity |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF error - parabolic velocity profile - 3D turbine | Zaqie | Fluent UDF and Scheme Programming | 9 | June 25, 2016 20:08 |
InterFoam - Validation for velocity profile in simple channel | me.ouda | OpenFOAM Running, Solving & CFD | 0 | October 19, 2015 07:42 |
SOS!! Velocity UDF | prashantthaker208 | FLUENT | 0 | April 2, 2014 11:16 |
Emergency:UDF for a time dependent parabolic velocity | zumaqiong | Fluent UDF and Scheme Programming | 12 | March 25, 2010 13:00 |
How to define a parabolic velocity inlet of particles with UDF | zumaqiong | FLUENT | 2 | February 22, 2010 10:46 |