CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Access violation - Help please (https://www.cfd-online.com/Forums/fluent/42076-access-violation-help-please.html)

AlwaysLearning August 21, 2006 04:57

Access violation - Help please
 
I am trying to run some simple udf's. To get going I am using a few of the many examples on the www.

I seem to get the dreaded 'access violation'.

Any help please.

My steps

Load .cas & .dat files. solve/set/expert (keep temporary solver memory for post-processing = yes) interpret UDF. I don't seem to get any problems here.

Then solve case Then run the execute on demand udf.

I get the oputput from the udf. It simply writes out th min, max and average temp in the domain, then I get the access violation probelms.

I get similar access issues with other examples UDF's.

I have tried the same case on another pc, it shares the lic file and I get identical issues.

Any help.

Oh, if it adds anything, when I try to compile the UDF and not use interpret I get

"Opening library "libudf"... Error: open_udf_library: The system cannot find the path specified.

Error Object: ()"

Help please

my udf

#include "udf.h" extern Domain* domain; DEFINE_ON_DEMAND(demo_calc) {

float tavg = 0.;

float tmax = 0.;

float tmin = 0.;

float temp,volume,vol_tot;

Thread *t;

cell_t c;

thread_loop_c(t,domain)

{

begin_c_loop(c,t)

{

volume = C_VOLUME(c,t); /* get cell volume */

temp = C_T(c,t); /* get cell temperature */

if (temp < tmin || tmin == 0.) tmin = temp;

if (temp > tmax || tmax == 0.) tmax = temp;

vol_tot += volume;

tavg += temp*volume;

}

end_c_loop(c,t)

tavg /= vol_tot;

printf("\n Tmin = %g Tmax = %g Tavg = %g\n",tmin,tmax,tavg);

begin_c_loop(c,t)

{

temp = C_T(c,t);

C_UDMI(c,t,0) = (temp-tmin)/(tmax-tmin);

}

end_c_loop(c,t)

} }


cadaei August 21, 2006 08:41

Re: Access violation - Help please
 
did you enable a user-defined memory?

The compile error you are getting is a common problem encountered when you don't have a compiler set up correctly. search the forum for the error

AlwaysLearning August 22, 2006 08:14

Re: Access violation - Help please
 
Thanks for your help but still no joy. Not sure I have come across my issue in the forum. Or at least how I might 'set the compiler'

If oit helps ...

When I try to compile -> build the UDF I get /////////////////////////

Deleted old libudf\ntx86\2d\libudf.dll

1 file(s) copied. (system "copy C:\Fluent.Inc\fluent6.2.16\src\makefile_nt.udf libudf\ntx86\2d\makefile") 1 file(s) copied. 0 (chdir "libudf")() (chdir "ntx86\2d")() 'nmake' is not recognized as an internal or external command, operable program or batch file. 'nmake' is not recognized as an internal or external command, operable program or batch file. ///////////////////////

Any thoughts?

The 'interpret' udf issue is still there too.


cadaei August 22, 2006 12:21

Re: Access violation - Help please
 
This error is definetly an error about the compiler. search the forum for "nmake". You need to install Microsoft Visual Studio c++ or something equivalent for the Fluent compilers to work.


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