CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   [UDF] Segmentation violation (http://www.cfd-online.com/Forums/fluent-udf/63941-udf-segmentation-violation.html)

 visuja April 23, 2009 22:23

[UDF] Segmentation violation

Hi folks,

I am working on simulating flow through a HPLC column. The solid matrix geometry is constructed by importing CT scans of the solid phase. I have been able to succesfully simulate steady state flows in my model.

Now I am working on simulating a pulse on the steady state flow. This involves unsteady state simulation using species transport. I have written a UDF to simulate a pulse at my inlet boundary at t = t0. The other boundary condition is to have species mass fraction gradient at the outlet = 0. This is where I face a few problems. My geometry consists of about 1 million unstructured tet cells.

I separate the cells immediately adjacent to the outlet boundary using Adapt/Boundary into a new fluid zone. I now want to set the conc gradient in this zone = 0.

Here is the UDF that I use for both the inlet pulse as well as for outlet zero conc gradient:

#include "udf.h"
DEFINE_PROFILE(pulse,t,i)
{
face_t f;
real time = CURRENT_TIME;
if (time == 1)
begin_f_loop(f,t)
F_PROFILE(f,t,i) = 0.1;
end_f_loop(f,t)
else
begin_f_loop(f,t)
F_PROFILE(f,t,i) = 0.0;
end_f_loop(c,t)
}
{
cell_t c;
Domain *d;
int ID = 17;
d = Get_Domain(1);
if (!Data_Valid_P())
return;
begin_c_loop(c,t)
C_YI_G(c,t,0)[0] = 0.0;
C_YI_G(c,t,0)[1] = 0.0;
C_YI_G(c,t,0)[2] = 0.0;
end_c_loop(c,t)
}

I hook udf concgrad to my outlet boundary under the Species tab. The problem is when I load the case file (with UDFs already hooked), and then load the steady state data file, I receive a Segmentation Violation. I also believe that to make C_YI_G available in a pressure based solver (which is what I use), I need to type: (rpsetvar species/save-gradients? #t) in the text-interface. However, this does not make any difference.

Could someone kindly guide me how to go about setting my outlet boundary condition?

Thanks and Regards,
Vivek Vasudevan

 All times are GMT -4. The time now is 19:08.