UDF Parabolic 2D Velocity Profile Issue
1 Attachment(s)
Hi,
I am trying to specify a fully developed velocity at the inlet of my gradual expansion diffuser. The UDF is below. /************************************************** ******** udf_parabolicinlet.c UDF for specifying a steady-state velocity profile boundary condition ************************************************** ********/ #include "udf.h" DEFINE_PROFILE(inlet_x_xyvelocity, thread, index) { real x[ND_ND]; real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, index) = .21 - y*y/(.002*.002)*.21; } end_f_loop(f, thread) } I plotted the equation in MATLAB and got a nice parabolic profile. However, whenever I run this case, I do not get a smooth graph. I get the graph attached. Attachment 66979 The steps I follow are: Write Code...save with file extension ".c" Interpret it in Setup Use it as the u component of the velocity inlet boundary condition Run Check Velocity Profile Does anyone know what may be happening here? |
To get a smooth curve, you simply need more points. Two things to consider:
Make sure your mesh is fine enough so that the curve appears smooth (it will always be jagged as shown). How do you produce this plot? Using a line probe or what? Check the settings. Better just, just plot the full velocity field and look at it and see if it makes sense. |
Quote:
|
All times are GMT -4. The time now is 19:17. |