CFD Online Discussion Forums

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

natantyt October 5, 2010 14:17

FLUENT received fatal signal (ACCESS_VIOLATION)
 
Hi

I've written a UDF for a reacting flow in a channel,I have species sources for different components as they react through the channel. I receive this message "FLUENT received fatal signal (ACCESS_VIOLATION)" while enable my Define_Adjust function in thef unction hook. These functions update the reaction rate in the memory and also define a species balance.

the function :

DEFINE_ADJUST(update_memory, domain)
{
/* Stores relevant reaction rates into user-defined memory (UDM). */
/* Enable through the Function Hooks --> Adjust in the FLUENT GUI. */
face_t f;
Thread *t;
cell_t c;
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{

/* Mass Fractions */
mCO=C_YI(c,t,iCO);
mCO2=C_YI(c,t,iCO2);
mH2O=C_YI(c,t,iH2O);
mH2=C_YI(c,t,iH2);
mC3H8=C_YI(c,t,iC3H8);

/* Mass Fraction Check */
/* If the reaction rate ever causes a component to locally vanish, a divide-by-zero error will result
These conditional statements place a lower limit on the concentrations. B. Peppley claims this error
can occur if the grid is too coarse. It can also occur if inlet and backflow concentrations are set
to zero. */
if (mCO==0) {
mCO = 0.000000001;
}
if (mCO2==0) {
mCO2 = 0.000000001;
}
if (mH2O==0) {
mH2O = 0.000000001;
}
if (mH2==0) {
mH2 = 0.000000001;
}
if (mC3H8==0) {
mC3H8 = 0.000000001;
}
/* Reaction Constants */
KR = reack(kRinf,ER,C_T(c,t));
KW = reack(kWinf,EW,C_T(c,t));
Kd = reack(kden,Ed,C_T(c,t));
/* Equilibrium Constants */
K1R= equiK(C_T(c,t));


/* Reaction Rates */

/* Simultaneous Reaction Rates */
rR= KR*mC3H8/mwC3H8*mH2O/mwH2O/(1+Kd); /* [kgmol/m^3.s]*/
rW= KW*(mCO/mwCO*mH2O/mwH2O-mH2/mwH2*mCO2/mwCO2/K1R);
zone_ID = catalyst;
currentzone = THREAD_ID(t);
if (currentzone==zone_ID){
C_UDMI(c,t,0)= rR;
C_UDMI(c,t,1)= rW;
}
}
end_c_loop(c,t)
}
}
DEFINE_ADJUST(Species_Balance, domain)
{
Thread *ft;
face_t f;
Thread *ct;
cell_t c;
real balance[NUM_SPECIES];
int n,i;
thread_loop_c(ct,domain)
{
begin_c_loop(c,ct)
{
for (i=0; i<NUM_SPECIES;i++)
{
c_face_loop(c, ct, n) /* loops over all faces of a cell */
{
f = C_FACE(c,ct,n);
ft = C_FACE_THREAD(c,ct,n);
balance[i] = F_FLUX(f,ft)*F_YI(f,ft,i);
}
C_UDMI(c,ct,2+i) = balance[i]; /* Hard-coded "2" because I have used the first 2 spots already */
}
} end_c_loop(c,ct)
}

}


Thanks

Natan

rayoflight153 November 6, 2010 02:46

help me, I have the same problem, please

davidyin November 4, 2011 00:39

Help, so do I.

natantyt November 4, 2011 01:52

Access Violation
 
Hi

This is a general error I encountered , it could be very irritating . What I can say is that you're using a wrong command that does not exist anymore in the syntax in t or you're using a function that can not obtain the required value for a variable. You need to simplify the code, run it then make it bigger.

davidyin November 4, 2011 13:54

Quote:

Originally Posted by natantyt (Post 330693)
Hi

This is a general error I encountered , it could be very irritating . What I can say is that you're using a wrong command that does not exist anymore in the syntax in t or you're using a function that can not obtain the required value for a variable. You need to simplify the code, run it then make it bigger.


Thanks a lot. i will try according to your suggestion.

Shayan November 20, 2011 20:42

Hi
I had this error, for my case,I should first define the number of user defined memory, and then in TUI I should write solve/set/expert command,and for this question "Keep temporary solver memory from being freed? [yes] " answer yes, this error is sometimes related to memory shortage

aleni32 February 8, 2014 04:58

I am runing a simulation for steel melt with VOF model with UDF (11 sources).
1- I used 21 UDMI so I defined 21 Memory for it,
2- I defined EXECUTE_AT_END for the UDF
but when i run it there is an error after 1 iteration:
in serial solver: fatal error, segmentation fault
in parallel solver: MPI application rank1 exited before MPI finalize() with status -1073741819
I even use parallel setting for auto partition with METIS method but still didnt worked.
when i run this UDF with water model it works very good but in steel model(different model) it doesnt worked.
If you have some experience about this i would be ppreciated if you inform me. thanks in advance

natantyt February 8, 2014 15:07

Hi

I can give general answers here. 11 sources made it a bit complex, it might be because of the memory problem. You may need to use another machine with higher RAM specifically for VOF. The other thing check if the variables that you need to run your source terms or whatever; is available and thesyntax you're using is uptodate with FLUENT syntax.


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