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

the fluent was crashed and disapeared when run UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2015, 22:03
Question the fluent was crashed and disapeared when run UDF
  #1
New Member
 
Howard Zhang
Join Date: Oct 2014
Posts: 12
Rep Power: 12
hongfu2233 is on a distinguished road
#include"udf.h"
real vn=0.0;
FILE * fp;
DEFINE_CG_MOTION(dynamic_cylinder,dt,vel,omega,tim e,dtime)
{
vn=5*sin(5*time);
vel[1]=vn;
omega[2]=2;
}
DEFINE_EXECUTE_AT_END(execute_at_end)
{
int n;
fp=fopen("D:\\temp\\shiyan","a_v");
fprintf(fp,"% E\n",vn);
fclose(fp);
}
i want use the UDF above write a file to record the velocity data, but two problems puzzle me:

1 i have sucessfully compiled the UDF, but when i ran caculation the fluent was crashed, disapeared in the screen.(when i remove the macro DEFINE_EXECUTE_AT_END, the UDF run well)

2 i want the body move in vertical direction and rotate aroud its center simutaneously, but the coordinate of the body center is not (0,0), how should i do ?(2D caculation)
Could anyone can help me? many thanks in advance...
hongfu2233 is offline   Reply With Quote

Old   January 15, 2015, 07:01
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
What should the "a_v" do? I have never seen that before, if you want to append use "a".
pakk is offline   Reply With Quote

Old   January 16, 2015, 02:28
Default
  #3
New Member
 
Howard Zhang
Join Date: Oct 2014
Posts: 12
Rep Power: 12
hongfu2233 is on a distinguished road
Quote:
Originally Posted by pakk View Post
What should the "a_v" do? I have never seen that before, if you want to append use "a".
thank you very much! pakk, i use "a" and tried again, but the "fatal error" appeares on occasion, sometimes it works well. i donot know y, wish me luck...
hongfu2233 is offline   Reply With Quote

Old   January 16, 2015, 04:55
Default
  #4
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Make sure that you don't have the file (D:\\temp\\shiyan) open in a different program. That's all I can say.
pakk is offline   Reply With Quote

Old   January 18, 2015, 04:07
Default
  #5
New Member
 
Howard Zhang
Join Date: Oct 2014
Posts: 12
Rep Power: 12
hongfu2233 is on a distinguished road
Quote:
Originally Posted by pakk View Post
Make sure that you don't have the file (D:\\temp\\shiyan) open in a different program. That's all I can say.
Thanks for Ur reminding, pakk. i will check it again.
hongfu2233 is offline   Reply With Quote

Reply

Tags
define_execute_at_end, fluent crashed, udf, write data


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



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