|
[Sponsors] |
December 3, 2008, 05:25 |
UDS Flux
|
#1 |
Guest
Posts: n/a
|
Hello friends, I am using 4 User defined scalars in my simulation. I want to use user-defined scalar flux term. The following code which I found in the Fluent manual compiled fine but it is giving me error when I started simulation.
"Error: fluent.6.3.26 received a fatal signal (SEGMENTATION VIOLATION). Error Object: #f " This UDS Flux function returns the mass flow rate to the UDS. Can any one please suggest me where is the problem. DEFINE_UDS_FLUX(my_uds_flux, f, t, i) { Thread *t0, *t1 = NULL; cell_t c0, c1 = -1; real NV_VEC(psi_vec), NV_VEC(A); /* neighboring cells of face f, and their (corresponding) threads */ t0 = F_C0_THREAD(f,t); c0 = F_C0(f,t); if (NULL != F_C1_THREAD(f,t)) /* Alternative: if (! BOUNDARY_FACE_THREAD_P(t)) */ { t1 = F_C1_THREAD(f,t); c1 = F_C1(f,t); } else { t1 = NULL; c1 = -1; } /* If Face lies at domain boundary, use face values; */ /* If Face lies IN the domain, use average of adjacent cells. */ if (NULL == t1) /* Alternative: if (BOUNDARY_FACE_THREAD_P(t)) */ { NV_D(psi_vec, =, F_U(f,t), F_V(f,t), F_W(f,t)); NV_S(psi_vec, *=, F_R(f,t)); } else { NV_D(psi_vec, =, C_U(c0,t0), C_V(c0,t0), C_W(c0,t0)); NV_D(psi_vec, +=, C_U(c1,t1), C_V(c1,t1), C_W(c1,t1)); NV_S(psi_vec, /=, 2.); /* averaging. */ NV_S(psi_vec, *=, (((C_R(c0,t0) + C_R(c1,t1)) / 2.))); } /* Now psi_vec contains our "psi" from above. */ /* Next, get the face normal vector: */ F_AREA(A, f, t); /* Finally, return the dot product of both. */ /* Fluent will multiply the returned value */ /* by phi_f (the scalar's value at the face) */ /* to get the "complete" advective term... */ return NV_DOT(psi_vec, A); } |
|
December 4, 2008, 09:58 |
Re: UDS Flux
|
#2 |
Guest
Posts: n/a
|
One Update friends. When I deleted the density terms (C_R(c,t) and F_R(f,t)) it is working fine. Without density multiplication it becomes Volumetric flow rate. But if I want mass flow rate, I need density right?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About specified flux | John | FLUENT | 0 | November 13, 2008 06:37 |
ratio of total heat flux and radiative heat flux | S.Karthikeyan | FLUENT | 2 | July 1, 2008 04:48 |
WALL HEAT FLUX V.S. HEAT FLUX | tommy | CFX | 0 | December 15, 2005 09:14 |
Help with UDS FLUX | Andrew Garrard | FLUENT | 2 | February 14, 2005 06:47 |
Flux in UDS | Ulrich | FLUENT | 1 | May 30, 2000 13:37 |