CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   [Very urgent] How to write a C Source File For 3D fully developed (https://www.cfd-online.com/Forums/fluent-udf/97794-very-urgent-how-write-c-source-file-3d-fully-developed.html)

evolutionf33 February 25, 2012 05:16

[Very urgent] How to write a C Source File For 3D fully developed
 
I really need help to get my project started. :(

Image here : http://postimage.org/image/yavkje2zv/

My 3d case is quite simple as shown in the image.
It's a cubical geometry, velocity inlet at the front and pressure at the back.
My geometry is 200micrometer*200micrometer*1000micrometer.
What I wanted to do is to have 3d fully developed velocity profile at the entrance.
The maximum velocity varies from 6.6m/s to 0.0006m/s for each case.
I have searched through the forum and google about it.
But I found that there are many different F_PROFILE equations.
I'm not sure which equation suits mine the best.

I found the following C Source File below. Can anyone edit it to suit my case and tell me which part should I edit to change the velocity? Thank you very much. :)

/************************************************** *********************
UDF for parabolic velocity profile at inlet boundary
************************************************** **********************/
#include"udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, position) /* inlet x velocity = name of the x velocity */
{
real x[ND_ND]; /* this will hold the position vector */
real y,z;
face_t f; /* f = all the cell faces on the boundary*/
begin_f_loop(f,thread) /* thread = given boundary zone, defined automatically when the UDF is hooked to inlet boundary, the macro begin_f_loop is applied to all the cell faces*/
{
F_CENTROID(x, f, thread); /* the coordinates of the face centroid accessed by F_CENTROID */
z= x[2];
F_PROFILE(f, thread, position) = 1.73-((15-y)*(15-y)*1.73/(30*30)); /* return velocity is assigned through F_PROFILE */
}
end_f_loop(f, thread)
}


All times are GMT -4. The time now is 23:17.