CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

[UDF] Segmentation violation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2009, 22:23
Default [UDF] Segmentation violation
  #1
New Member
 
Vivek
Join Date: Apr 2009
Posts: 7
Rep Power: 17
visuja is on a distinguished road
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)
}
DEFINE_PROFILE(concgrad,thread,species)
{
cell_t c;
Domain *d;
Thread *t;
int ID = 17;
d = Get_Domain(1);
t = Lookup_Thread(d,ID);
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
visuja is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove the error:FLUENT received a fatal signal (SEGMENTATION VIOLATION). Conan FLUENT 9 December 20, 2019 12:31
Segmentation Violation Corentin FLUENT 1 February 13, 2011 01:07
segmentation violation wasan FLUENT 0 December 23, 2008 11:37
Segmentation Violation Axel FLUENT 2 May 26, 2006 12:16
SEGMENTATION VIOLATION kROZ FLUENT 1 May 4, 2006 09:12


All times are GMT -4. The time now is 17:00.