|
[Sponsors] |
November 3, 2003, 04:50 |
UDF Boundary Condition
|
#1 |
Guest
Posts: n/a
|
Hello!
I need to create two UDF boundary conditions at an interface; one for the flux and one for the scalar. I´m actually looking at a mass transfer problem but in order to get some feedback I have begun with a temperature problem and compared my result with the one obtained using FLUENTS built-in functions. The UDF code is as follows: /*B.C. Solidface q = -k*(dT/ds)**********************/ DEFINE_PROFILE(Diff_Flux, t, i) { face_t f; cell_t c1; Thread *t1; real xc[ND_ND], xf[ND_ND], grad, dn; begin_f_loop(f,t) { c1 = F_C1(f,t); t1 = THREAD_T1(t); C_CENTROID(xc,c1,t1); F_CENTROID(xf,f,t); dn = sqrt(ND_SUM(pow(xc[0]-xf[0],2.),pow(xc[1]-xf[1],2.),pow(xc[2]-xf[2],2.))); grad = (F_T(f,t)-C_T(c1,t1))/dn; F_PROFILE(f,t,i) = -0.0242*grad; } end_f_loop(f,t) } /************************************************** **/ /*B.C. Bulkface Tbulkface = Tsolidface***************/ DEFINE_PROFILE(T_bulkface,t,i) { face_t fbulk, fsolid; Domain *doma; Thread *tsolid; real xfbulk[ND_ND], xfsolid[ND_ND]; int ID; doma = Get_Domain(1); ID = 10; /*Zone ID for the solid face*/ tsolid = Lookup_Thread(doma,ID); begin_f_loop(fbulk,t) { F_CENTROID(xfbulk,fbulk,t); begin_f_loop(fsolid,tsolid) { F_CENTROID(xfsolid,fsolid,tsolid); if (xfsolid[0]==xfbulk[0] && xfsolid[1]==xfbulk[1] && xfsolid[2]==xfbulk[2]) { F_PROFILE(fbulk,t,i) = F_T(fsolid,tsolid); } } end_f_loop(fsolid,tsolid) } end_f_loop(fbulk,t) } /************************************************** **/ This UDF is working fine with one exception. My problem is that FLUENT in every iteration make use of the boundary condition for the scalar (i.e. Tbulkface = Tsolidface) before the boundary condition for the flux (i.e. q = -k*(dT/ds)). I want it to be the other way around! So my question is: How can I force FLUENT to first make use of the boundary condition for the flux and then the one for the scalar? If anybody knows the answer or at least have some suggestion, please share it with me! Thanks! /Victor |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Resolved: Changing boundary condition with UDF according to pressure outlet boundary | alpemre | Fluent UDF and Scheme Programming | 12 | February 24, 2014 10:18 |
UDF for inhomogenous Neumann boundary condition | akhilesh | Fluent UDF and Scheme Programming | 3 | December 24, 2012 11:14 |
Boundary Condition Types Using Scheme and UDF | Nasir | FLUENT | 0 | September 15, 2008 21:54 |
UDF for the boundary condition | Sridhar | FLUENT | 3 | July 13, 2001 19:18 |
UDF : boundary condition ID | Flav | FLUENT | 4 | June 28, 2001 09:52 |