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

Error inputting udf into fluent for mass source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2012, 22:42
Default Error inputting udf into fluent for mass source
  #1
New Member
 
Edward Overy Jr.
Join Date: Jan 2012
Posts: 5
Rep Power: 14
ejvikings is on a distinguished road
In fluent, I'm modeling the 2-D combustion of a leaf. I made a mesh in gambit that includes a small face around the leaf that is zoned as a fluid to allow mass sources in Fluent.

My problem is that I have tried to use a udf for the source term of h20 being volatilized but I always get the result "Error, Segmentation Violation". It works if I just put in a constant value for the source term of H20.

Here's a copy of the UDF that I was trying to use:

#include "udf.h"
DEFINE_PROFILE(massrelease_h2o,thread,index)
{
face_t f;
real x[ND_ND]; /* this will hold the position vector */
real y;
real ti = CURRENT_TIME; /* Current time step */
/* inputs for leaf */
real tig, d, th, SurfA, pi;
real a1, b1, ae, be, dmH2O, value, total;
tig=3.0; /* Time when ignition occurs - devolatilization starts */
d=0.02736; /* diameter of leaf [m] - must go with FLUENT */
th=0.0005; /* thickness of leaf [m] - must go with FLUENT */
pi=3.141592654;
SurfA=2.*(pi*(d/2.)*(d/2.))+pi*d*th;
a1=0.483620247554468; /* Water */
b1=0.0824661144389419;
ae=0.87330029071108;
be=0.277540639452865;
total=51.027;
if ((ti-tig)<0.) {
dmH2O=a1*b1*exp(-b1*ti);
}
else {
dmH2O=ae*be*exp(-be*ti);
}
value=total*dmH2O/SurfA/1000.;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f,thread,index)=value;
}
end_f_loop(f,thread)
/* printf("H2O=%f\n",value); */
}


Any help would be greatly appreciated!!
ejvikings is offline   Reply With Quote

Reply

Tags
fluent, mass source term, segmentation violation, udf


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
UDF - Source Term Question Jacques FLUENT 0 December 8, 2008 14:40
UDF for energy source João Fernandes FLUENT 4 October 17, 2008 05:53
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 11:16
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07


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