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

Getting error both interpreting and compiling

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 26, 2017, 21:15
Default Getting error both interpreting and compiling
  #1
New Member
 
Jing
Join Date: Feb 2013
Posts: 25
Rep Power: 13
serene6390 is on a distinguished road
Can anyone help me running my code in your computer and see if it works?

My code is kind of long, I'm now having errors both interpreting and compiling the UDF into my model.

I've ever successfully compiling this code in Fluent 17.0, but now my lab updated the whole system and installed Fluent 18.0 instead of 17.0. Then the error comes to be:

Error: The UDF library you are trying to load (D:\2017fall\2017fall_files\dp0\FFF-1\Fluent\libudf) is not compiled for 2d on the current platform (win64).\n\nThe system cannot find the file specified.
\n\nD:\2017fall\2017fall_files\dp0\FFF-1\Fluent\D:\2017fall\2017fall_files\dp0\FFF-1\Fluent\libudf\win64\2d\libudf.dll
Error Object: #f

I then tried to interpret the code, I got the error:

Error: received a fatal signal (Segmentation fault).
Error Object: #f

When I interpreted the code in Fluent 17.0, I got the same error, I searched the forum and someone suggested me compiling instead of interpreting, it worked! But after the lab updated the windows system and got 18.0, I got error as I posted above. I'm wondering if the error is caused by some bug in my code or it's caused by the something else.

My code is as below:
DEFINE_EXECUTE_AT_END(h_zt)
{

real patm=101325;
real r=1e-5;
real sigma=0.007; /*sigma*cos(theta)*/
real rho=984.6;
real g=9.8;
real De=6e-07;
real rhog=1;
real alpha=0.5;
real phi=0.6;
real mu=0.0058;
real b=0.06;
real b0=0.01;
real Ht=0.0015/2;
real a0=1.075e-3;
real h0=0.01991;
real x[ND_ND];
real y;
real kapa=phi*r*r/8;
real M1_integ=0; /*integral(m)dz, z from h0 to zt*/
real M2_integ=0; /* integral(m(zt-z))dz, z from h0 to zt*/
real M3_integ=0; /*integral(m)dz, z from h0 to z*/
real M3_integ_add=0;
real M4_integ=0; /*integralm(zt-z)dz,z from z to zt*/
real M4_integ_minus=0;
real weight_loss=0;
real dx=0.001;
real dt = CURRENT_TIMESTEP;
real flow_time=CURRENT_TIME;
int n=N_TIME;

Domain *d;
face_t f;

Thread *t;
Thread *t0;
cell_t c;
cell_t c0;
d = Get_Domain(1);
t = Lookup_Thread(d,7);


/* Loop over all faces on wall */

begin_f_loop(f,t)
{

c0 = F_C0(f, t);
t0 = THREAD_T0(t);
F_CENTROID(x,f,t);

y=x[1];


if (y>0 && y<zt1-h0)
{
M1_integ+=-De*rhog*C_T_G(c0,t0)[0]*dx;
M2_integ+=-De*rhog*C_T_G(c0,t0)[0]*(zt1-y-h0)*dx;
}

}
end_f_loop(f,t)

h2=h1+dt*(kapa/mu*rho*g*(zt1-h1)-kapa/mu*2*sigma/r-1/rho/Ht*M2_integ)*2*Ht/(a0-2*Ht*b0)/((zt1-h0)/b+(h0-h1)/b0);
zt2=zt1+dt/phi*(-1/rho/Ht*M1_integ-(a0-2*Ht*b0)/(2*Ht*b)*(h2-h1)/dt);

begin_f_loop(c,t)
{
c0 = F_C0(f, t);
t0 = THREAD_T0(t);

y=x[1];

M3_integ=M3_integ_add+(-De*rhog*C_T_G(c0,t0)[0])*dx;
M3_integ_add=M3_integ;

M4_integ=M2_integ-(-De*rhog*C_T_G(c0,t0)[0]*(zt2-(y+h0)))*dx-M4_integ_minus;
M4_integ_minus=-De*rhog*C_T_G(c0,t0)[0]*(zt2-(y+h0))*dx;

C_UDMI(c0,t0,0)=patm-2*sigma/r+(rho*g-mu/kapa*(a0-2*Ht*b0)/(2*Ht*b)*(h2-h1)/dt)*(zt2-(y+h0))-mu/kapa/rho/Ht*((zt2-(y+h0))*M3_integ+M4_integ);


}
end_f_loop(c,t)
h1=h2;
zt1=zt2;
weight_loss=weight_loss_add+M1_integ*2*b*1000*dt;
weight_loss_add=weight_loss;


}



Any help would be appreciated. Thanks a lot in advance.

Jing
serene6390 is offline   Reply With Quote

Old   October 27, 2017, 00:49
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
Did you successfully compiled your code for 18 version?

Check you windows environment variable for fluent. may be it still uses path to 17 version. Fluent_inc is important
AlexanderZ is offline   Reply With Quote

Reply

Tags
compile, 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
UDF neither compiling nor interpreting. shan12 Fluent UDF and Scheme Programming 0 August 14, 2016 05:05
UDF compiling and Interpreting error aduramolasode95 Fluent UDF and Scheme Programming 3 April 19, 2016 21:09
compiling problem of a mass transfer udf majid_kamyab FLUENT 9 October 15, 2014 10:18
C_T(c,t) problem while compiling (OK interpreted) crevoise Fluent UDF and Scheme Programming 6 February 4, 2014 07:16
something wrong when compiling udf, however the code is correct when interpreting richard ben Fluent UDF and Scheme Programming 7 May 11, 2013 07:36


All times are GMT -4. The time now is 01:26.