CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

Errors message: ACCESS_VIOLATION

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 24, 2010, 08:32
Default Errors message: ACCESS_VIOLATION
  #1
New Member
 
Emily
Join Date: Aug 2010
Posts: 5
Rep Power: 6
whelk123 is on a distinguished road
Hello, I am trying to model the heat transfer within a hydrogen fuel cell and I keep getting the message ACCESS_VIOLATION when I try applying my UDF.
#include "udf.h"
DEFINE_INIT(init_func,d)
{
Domain *d;
Thread *t;
real sum_diss=0.;
cell_t c;
d = Get_Domain(1);
}
DEFINE_SOURCE(sink_mass, c, t, dS, eqn)
{
real sink_mass;
sink_mass=-C_UDMI(c,t,0)*rau0*0.0166*(1-poros);
return sink_mass;

}
DEFINE_SOURCE(energy_source, c, t, dS, eqn)
{
real energy_source;
energy_source=-C_UDMI(c,t,0)*rau0*0.0166*(1-poros)*deltah/mh2;
return energy_source;
}
DEFINE_EXECUTE_AT_END(execute_at_end)
{
real step =RP_Get_Real("physical-time-step");
Domain *domain = Get_Domain(1);
int ID=2;
Thread *t =Lookup_Thread(domain, ID);
cell_t c;
begin_c_loop(c,t)
{
double temper,P,hsmp,lnpeq,Peq, dxdt;
temper=C_T(c,t);
P=(C_R(c,t)*rgp*C_T(c,t)/mh2)*0.00001;


hsmp= C_UDMI(c,t, 1 )*(HsMmaxprim-hsurm)+hsurm;
lnpeq=A-B/temper+C*hsmp+D*pow(tan(pi*hsmp/2.0/HsMmaxprim),n)+E*pow(tan(pi*hsmp/2.0/HsMmaxprim),(-m));
Peq=exp(lnpeq);
C_UDMI(c,t,0)=mh2*Ca*exp(Ea/(rgp*temper))*log(P/Peq)/0.0166;
C_UDMI(c,t,1 )=C_UDMI(c,t,1 )+C_UDMI(c,t,0)*step;
}
end_c_loop(c,t)
}

I have defined things but didnt think that was important. Can anyone please tell me what is wrong with this code!! It is fairly urgent!
Thank you for any help
whelk123 is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 42 May 14, 2012 20:48
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 12 September 17, 2007 17:48
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 15:30.