Regarding udf for boundary conditions in transient.
I want to write an udf to make use of the species mass fraction value at the outlet of the previous time step in inlet of the next time step continously in transient analysis. Since I am new in writing udf I read all the functions in the UDF manual of the fluent. Now I am clear in writing an udf for boundary condition profile. Can any tell me how to access the species mass fraction value of the outlet boundary when writing udf for the inlet boundary?
|
To write your UDF for the boundary condition, you can use:
Code:
DEFINE_PROFILE Code:
C_YI(c,t,i) Code:
C_YI_M1(c,t,i) |
Quote:
Maybe he could use EXECUTE_AT_END - macro to save the outlet values and then use DEFINE_PROFILE in inlet? |
Yeah I guess it does make sense to fill the outlet face at the end, and then using DEFINE_PROFILE.
|
boundary condition in fluent, which is a function of density
Dear all
I want to add a boundary condition in fluent, which is a function of density. For this aim I wrote an UDF code to evaluate the density on the surface of boundary. But a segmentation error has occurred. I know what this error is but I do not know how to fix it and my algorithm is right or not? Thank you in advance for your help. #include "udf.h" DEFINE_PROFILE(inlet_pressure1,t,i) { real x[ND_ND]; real rr1; real vv; Thread *tf; face_t f; cell_t c; int n; begin_c_loop(c, t) /* loops over cells in a cell thread */ { rr1=C_R(c,t); c_face_loop(c, t, n) /* loops over all faces of a cell */ { f=C_FACE(c,t,n); tf=C_FACE_THREAD(c,t,n); vv=sqrt(pow (F_U(f,t),2)+pow (F_V(f,t),2)+pow (F_W(f,t),2)); F_PROFILE(f,tf,i)=40000000-0.5*rr1*pow (vv,2); } } end_c_loop(c, t) } |
All times are GMT -4. The time now is 10:28. |