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

UDF Errors

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2009, 07:00
Default UDF Errors
  #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
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 17, 2019 00:12
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 16:33
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 03:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


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