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

ACCESS_VIOLATION error

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 13, 2012, 18:14
Question ACCESS_VIOLATION error
  #1
New Member
 
Augusto Fontan
Join Date: Aug 2012
Location: Brazil
Posts: 13
Rep Power: 13
Fontan is on a distinguished road
Good evening, everyone.

I'm trying to get the hang of UDF's as I'll need to use them for real gas simulations in the future for my master's program, so I've made a simple UDF for perfect gas in order to test and compare values. I manage to compile it without problem, but when initializing the problem I get the ACCESS_VIOLATION error.

I get the same error when interpreting the UDF, and it also says "temp definition shadows previous definition" after interpreting.

Here is the UDF:

Quote:
#include "udf.h"

#define CGAS 287
#define GAMMA 1.4

DEFINE_PROPERTY(fluid_density, c, t)

{

real rho;
real press;
real p_operating;
real temp;
real t_operating;

p_operating = RP_Get_Real ("operating-pressure");
press = C_P(c,t) + p_operating;

t_operating = RP_Get_Real ("operating-temperature");
temp = C_T (c,t) + t_operating;

rho = press/(CGAS*temp);

return rho;
}

DEFINE_PROPERTY(sound_speed, c,t)

{

real a;
real temp;
real t_operating;

t_operating = RP_Get_Real ("operating-temperature");
temp = C_T (c,t) + t_operating;

a=sqrt(GAMMA*CGAS*temp);

return a;

}
Thanks in advance
Fontan is offline   Reply With Quote

Reply

Tags
access violation error, access_violation, user defined

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 18:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 17:43
[OpenFOAM] Saving ParaFoam views and case sail ParaView 9 November 25, 2011 15:46
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
user defined function cfduser CFX 0 April 29, 2006 10:58


All times are GMT -4. The time now is 02:25.