|
[Sponsors] |
May 2, 2002, 01:55 |
Boundary condition
|
#1 |
Guest
Posts: n/a
|
Hello, In order to set the boundary condition at inlet and outlet of porous media, I developed the following UDF's .But when I try to run the program it shows a segmntation violation.Could any body help in this matter. The condensed source code is as follows...
DEFINE_ADJUST(in_outb,domain) { Thread *t; Thread *t0; Thread *t1; real y, dv,area,kf,kt,x[ND_ND],U; real ff,constt,l,Rep,Pr; face_t f; cell_t c,c0,c1; area = (20.346*(1-zeta)*pow(zeta,2))/Dp; dv = (4*zeta)/area; constt = 1.29*pow((dv/Dp),0.5); kf = zeta*0.0242; t = Lookup_Thread(domain,3); begin_f_loop(f, t) { real RE,PR; F_CENTROID(x,f,t); y=x[1]; l = 1 - (exp((-(y + 0.005))/(1.5*Dp))); U = sqrt(pow(F_V(f,t),2.)+pow(F_U(f,t),2.)); kt = 0.375*1.225*1006.43*U*Dp*l; Rep = (U*Dp*1.225)/(1.7894e-05); Pr = ((1.7894e-05)*1006.43)/0.0242; if(c0 = F_C0(f,t) && (t0 = t->t0)) C_T_G(c0,t0)[0]= 0; RE = pow(Rep,0.5); PR = pow(Pr,0.4); C_UDSI_G(c0,t0,0)[0] = (constt)*RE*PR*(kf+kt)*(F_UDSI(f,t,0) -300)/(dv*(1-zeta)*TKS); } end_f_loop(f, t) t = Lookup_Thread(domain,2);//outlet constt = -(0.2776); begin_f_loop(f, t) { real RE,PR; F_CENTROID(x,f,t); y=x[1]; l = 1 - (exp((-(y + 0.005))/(1.5*Dp))); U = sqrt(pow(F_V(f,t),2.)+pow(F_U(f,t),2.)); kt = 0.375*1.225*1006.43*U*Dp*l; Rep = (U*Dp*1.225)/(1.7894e-05); Pr = ((1.7894e-05)*1006.43)/0.0242; RE = pow(Rep,0.5); PR = pow(Pr,0.4); if(c0 = F_C0(f,t) && (t0 = t->t0)) C_T_G(c0,t0)[0]= 0; /*if(c1 = F_C1(f,t) && (t1 = t->t1)) C_T_G(c1,t1)[0] =0;*/ //F_T_G(f,t,0) = 0.0; C_UDSI_G(c0,t0,0)[0] = constt*(kf+kt)*RE*PR*(F_UDSI(f,t,0)-F_T(f,t))/Dp; } end_f_loop(f, t) } The source code works fine when I comment the gradient term of my UDS and the gradient of the fluid temperature. |
|
May 2, 2002, 19:45 |
Re: Boundary condition
|
#2 |
Guest
Posts: n/a
|
Hello, I couold partially resolve the problem by making two DEFINE_PROFILE functions one for inlet and the other for oultlet, but when I use the UDF for outlet it gives me an segmentation violation. Could any body expound on how to use a UDF for outlet boundary condition. Srinivas
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 05:57 |
Boundary Conditions | Thomas P. Abraham | Main CFD Forum | 20 | July 7, 2013 05:05 |
Setting outlet Pressure boundary condition using CAFFA code | Mukund Pondkule | Main CFD Forum | 0 | March 16, 2011 03:23 |
How exactly the "pressure outlet" bdry condition compute properties on the boundary? | yating9901 | FLUENT | 3 | June 28, 2010 12:26 |
How to set boundary condition in Fluent for the fo | Peiyong | FLUENT | 1 | November 10, 2006 11:44 |