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

FLUENT received fatal signal (ACCESS_VIOLATION) Error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2015, 22:04
Default FLUENT received fatal signal (ACCESS_VIOLATION) Error
  #1
New Member
 
Justin Reiter
Join Date: Feb 2015
Posts: 9
Rep Power: 11
jreiter164 is on a distinguished road
Hello all,

I am a new FLUENT user and am having an issue getting a UDF I wrote to work. I am trying to create user defined functions for density and viscosity as a function of concentration. The code is as follows:

#include "udf.h"

#define rhoC3 -70.481
#define rhoC2 239.64
#define rhoC1 -383.15
#define rhoC0 995.08

DEFINE_PROPERTY(mixture_density,c,t)
{
real ethanol_mf, rho;

ethanol_mf=C_YI(c,t,0);

rho=rhoC3*pow(ethanol_mf,3)+rhoC2*pow(ethanol_mf,2 )+rhoC1*ethanol_mf+rhoC0;

return rho;
}

#define muC4 -1e-5
#define muC3 4e-5
#define muC2 -3e-5
#define muC1 1e-5
#define muC0 8e-7

DEFINE_PROPERTY(mixture_viscosity,c,t)
{
real ethanol_mf, mu;

ethanol_mf=C_YI(c,t,0);

mu=muC4*pow(ethanol_mf,4)+muC3*pow(ethanol_mf,3)+m uC2*pow(ethanol_mf,2)+muC1*ethanol_mf+muC0;

return mu;
}

It interprets fine and I can hook it into my mixture properties, but when I try and initialize I get the following error message:

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.

Does anyone know to fix this issue? Help will be greatly appreciated.
jreiter164 is offline   Reply With Quote

Old   February 12, 2015, 03:37
Default
  #2
Member
 
Join Date: Nov 2014
Posts: 31
Rep Power: 11
maverick123 is on a distinguished road
Hi,

Instead #define , initialize your constants in
DEFINE_PROPERTY()
{
real rhoC3 = -70.481;
}

and it is better to use only alphabets to name a variable/constant. You may consider to rename the constant name as well.

Best Luck!

Quote:
Originally Posted by jreiter164 View Post
Hello all,

I am a new FLUENT user and am having an issue getting a UDF I wrote to work. I am trying to create user defined functions for density and viscosity as a function of concentration. The code is as follows:

#include "udf.h"

#define rhoC3 -70.481
#define rhoC2 239.64
#define rhoC1 -383.15
#define rhoC0 995.08

DEFINE_PROPERTY(mixture_density,c,t)
{
real ethanol_mf, rho;

ethanol_mf=C_YI(c,t,0);

rho=rhoC3*pow(ethanol_mf,3)+rhoC2*pow(ethanol_mf,2 )+rhoC1*ethanol_mf+rhoC0;

return rho;
}

#define muC4 -1e-5
#define muC3 4e-5
#define muC2 -3e-5
#define muC1 1e-5
#define muC0 8e-7

DEFINE_PROPERTY(mixture_viscosity,c,t)
{
real ethanol_mf, mu;

ethanol_mf=C_YI(c,t,0);

mu=muC4*pow(ethanol_mf,4)+muC3*pow(ethanol_mf,3)+m uC2*pow(ethanol_mf,2)+muC1*ethanol_mf+muC0;

return mu;
}

It interprets fine and I can hook it into my mixture properties, but when I try and initialize I get the following error message:

FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.

Does anyone know to fix this issue? Help will be greatly appreciated.
maverick123 is offline   Reply With Quote

Old   February 12, 2015, 05:55
Default
  #3
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
I think your #define's are fine, and there is nothing wrong with your variable names.

The problem is, I think, in the line
Code:
ethanol_mf=C_YI(c,t,0);
When you start to initialize, you don't have any data yet. But your code tries to get the species mass fraction anyway. Fluent does not know what to do.

You can try to test if I am right by changing that line to:
Code:
ethanol_mf=0.25;
If your code then runs without problems, it is due to C_YI.

If that is the case, you should fix the code by first checking if C_YI is set; if it is set, read it, if it is not set, choose a default value (e.g. 0.0). I don't remember the Fluent macro to check if a value is set, but it exists.
pakk is offline   Reply With Quote

Old   February 16, 2015, 14:19
Default
  #4
New Member
 
Justin Reiter
Join Date: Feb 2015
Posts: 9
Rep Power: 11
jreiter164 is on a distinguished road
Thanks Pakk,

I think you are right about the source of the error, when I put in a constant value for ethanol_mf the simulation initialized fine.

I would like to implement your solution of checking to see if C_YI has a value or not prior to defining the mass fraction for the cell. I am having difficulty doing that.

Does anyone know how to perform this? Also, is there a "command window" or something like that where I can just put in a line of code and see its effect? I am used to having this in MATLAB.
jreiter164 is offline   Reply With Quote

Reply

Tags
define_property, 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
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
Pressure outlet boundary condition rolando OpenFOAM Running, Solving & CFD 62 September 18, 2017 07:45
[OpenFOAM] Native ParaView Reader Bugs tj22 ParaView 270 January 4, 2016 12:39
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 13:34


All times are GMT -4. The time now is 00:20.