|
[Sponsors] |
FLUENT received fatal signal (ACCESS_VIOLATION) Error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 11, 2015, 22:04 |
FLUENT received fatal signal (ACCESS_VIOLATION) Error
|
#1 |
New Member
Justin Reiter
Join Date: Feb 2015
Posts: 9
Rep Power: 11 |
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. |
|
February 12, 2015, 03:37 |
|
#2 | |
Member
Join Date: Nov 2014
Posts: 31
Rep Power: 11 |
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:
|
||
February 12, 2015, 05:55 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
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); You can try to test if I am right by changing that line to: Code:
ethanol_mf=0.25; 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. |
|
February 16, 2015, 14:19 |
|
#4 |
New Member
Justin Reiter
Join Date: Feb 2015
Posts: 9
Rep Power: 11 |
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. |
|
Tags |
define_property, udf |
|
|
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 |