CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   FLUENT received fatal signal (ACCESS_VIOLATION) (http://www.cfd-online.com/Forums/fluent-udf/95567-fluent-received-fatal-signal-access_violation.html)

rubis December 22, 2011 09:55

FLUENT received fatal signal (ACCESS_VIOLATION)
 
Hi all,
I wrote a UDF for calculating surface tension and concentration. UDF is interpreted sucessfully, but after running for1 one iteration it is giving Access_violation error.


best regards

ComputerGuy December 29, 2011 19:51

Rubis,
Where are you defining the *tp pointer? I don't see anywhere in your code where you're defining it or passing it to the functions. If Rho and Yi are defined based upon it, and it's a null pointer, Fluent will quit with an access violation.

Let me know if I'm missing something!

Regards,
ComputerGuy

Quote:

Originally Posted by rubis (Post 336739)
Hi all,
I wrote a UDF for calculating surface tension and concentration. UDF is interpreted sucessfully, but after running for1 one iteration it is giving Access_violation error. Here is my UDF:
#include "udf.h"
/* udf concentration. */
DEFINE_PROPERTY(concentration,cell,ti)

{
double concentration;
Thread *tp; /*thread from phase identified by phase_2_ID*/
real yi; /*mass fraction*/
real rho; /*mass volumique*/

rho = C_R(cell,tp); /*concentration is yi*rho (kg/m^3) */
yi = C_YI(cell,tp,0);
concentration=C_UDMI(cell,tp,0) = yi*rho*1000/456;
return concentration;
}
/* udf tension superficielle */
DEFINE_PROPERTY(surf_tension, cell, thread)
{
double concentration;
double st;
double log (double concentration);
Thread *tp;
st = 0.0728;
if (concentration < 0.094)
{
st = C_UDMI(cell,tp,1) = 68.49-log(concentration)*(6.516-3.353*log(concentration)) ;
}
else
{
st = C_UDMI(cell,tp,2) = -0.25*concentration+39;
}
return st;
}


best regards


rubis December 31, 2011 09:35

hi,
thank you for your reply. can you give me more details.please
it's a big priblem for me

best regards

duri January 2, 2012 06:26

Quote:

Originally Posted by rubis (Post 336739)
Hi all,
DEFINE_PROPERTY(concentration,cell,ti)
{
double concentration;
Thread *tp; /*thread from phase identified by phase_2_ID*/
real yi; /*mass fraction*/
real rho; /*mass volumique*/

rho = C_R(cell,tp); /*concentration is yi*rho (kg/m^3) */
yi = C_YI(cell,tp,0);
concentration=C_UDMI(cell,tp,0) = yi*rho*1000/456;
return concentration;
}

ti is a thread pointer so use ti directly instead of tp. e.g., C_R(cell,ti). Or assign tp=ti and continue to use tp.

ComputerGuy January 2, 2012 21:26

Duri,
I agree this change would "fix" the problem with accessing a non-null thread pointer, but it looks like rubis is performing the calculation in a multiphase environment, and that *tp should be pointing to the second (or third?) phase cell thread (note the comment: *thread from phase identified by phase_2_ID*/). It also looks like there's a species mass fraction involved (C_YI)...

Before we lead Rubis astray with things that will fix the error but not the problem, perhaps we should understand *what* Rubis is trying to calculate.

Rubis: Please write down in words, not fluent UDF code, what you're trying to calculate, and what type of system it is. For example:

I have a two-species, two-phase mixture. The calculation for surface tension is:

Mass Fraction of Species 1 * Mixture Density of the Cell * 1000/456.


Please write this as thoroughly as you can, and I'll be able to take what you write and turn it into Fluent code.

ComputerGuy

rajatca February 5, 2013 02:15

hello computer guy
 
can you see why i get error "Fluent received fatal signal (access voilation). I am trying to run a dynamic mesh..of a body immersed in water.

mehdis April 22, 2014 15:42

Initialize Error
 
hi all
when i initialize the below error occurs
.
,
,
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.
Error Object: #f

:confused:


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