# UDF trouble shoot

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 24, 2015, 02:41 UDF trouble shoot #1 New Member   Join Date: Sep 2015 Posts: 7 Rep Power: 4 Hi Guys, Could I please have someones help to trouble shoot this UDF code. I keep getting - Error: received a fatal signal (Segmentation fault). - Error Object: #f So I know it has to do with the code. I stole most of the code from other places. I can compile the code and date file shows up when I 'Execute on Demand' The error shows up with I try and 'Initialize' my Thank you Guys #include "udf.h" int NPt_mu = 561; /* number of entries in density table */ /* Locate the place in the interpolation vector using bisection algorithm*/ int locate(float xx[], int n, float x) { int j = 0; int jm = 0; int jl = 0; int ju = n+1; int ascnd = 0; ascnd = (xx[n] >= xx[1]); while (ju-jl > 1) { jm = (ju+jl) >> 1; if (x >= xx[jm] == ascnd) jl = jm; else ju = jm; } if (x == xx[1]) j = 1; else if (x == xx[n]) j = n-1; else j = jl; return j; } float *pres_vec_mu,*dens_vec; #define FAST_LOOKUP TRUE /* use bisection algorithm for interpolation */ #define TABLE_MESSAGES TRUE #define DISPLAY_TABLES TRUE /* Obtaine mu given pressure */ float get_mu_from_T(float xdata) { int i = 0; int j = 0; float xL,xU,ydata; #if FAST_LOOKUP j = locate(pres_vec_mu,NPt_mu,xdata); xL = pres_vec_mu[j]; xU = pres_vec_mu[j+1]; ydata = dens_vec[j] + (xdata-xL)/(xU-xL)*( dens_vec[j+1] - dens_vec[j] ); #else for ( i=1; i=xL)&&(xdata<=xU) ) { ydata = dens_vec[i] + (xdata-xL)/(xU-xL)*( dens_vec[i+1] - dens_vec[i] ); break; } } #endif if ( xdata>pres_vec_mu[NPt_mu] ) { #if TABLE_MESSAGES Message("\n pressure is above the bound of dens-array \n"); #endif ydata = dens_vec[NPt_mu]; } if ( xdata

 October 26, 2015, 05:57 #2 Senior Member   Bruno Machado Join Date: May 2014 Posts: 271 Rep Power: 6 This kind of error appear when Fluent cant reach some information. It might compile with no error, but when it runs it will try to get information (boundaries, gradient, variable values, etc) and this information is not avilable. Since you took pieces of code from different places, it is better to have a detailed look at it and check if all the information necessary is provided.

 March 2, 2017, 09:31 #3 New Member   davoud javar Join Date: Jan 2017 Posts: 5 Rep Power: 2 hello Bruno Machado how I can give initial value for gradient of temperature (C_T_G)in sorce macro to calculate T over the channel in my case? regard

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12 virgy Fluent UDF and Scheme Programming 8 February 7, 2012 05:30 fullmonty FLUENT 5 June 30, 2011 02:40 Luc SEMINEL FLUENT 0 November 25, 2002 05:03 Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

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