CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDS Flux (https://www.cfd-online.com/Forums/fluent/49958-uds-flux.html)

Thiru December 3, 2008 04:25

UDS Flux
 
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);

}

Thiru December 4, 2008 08:58

Re: UDS Flux
 
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?



All times are GMT -4. The time now is 10:06.