|
[Sponsors] |
'execute on demand' shut down fluent automatically |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2013, 11:14 |
'execute on demand' shut down fluent automatically
|
#1 |
Member
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 14 |
Code:
#include "udf.h" extern float plasma[4]; DEFINE_ON_DEMAND(read_data) { int i; FILE *rfile; /* declare a FILE pointer */ rfile = fopen("try.txt", "r"); /* open file for reading */ Message("file opened\n"); /* loop to read file */ i=0; /* initialize before to loop */ for (i=0;i<4;i++) { fscanf (rfile, "%f", &plasma[i]); /* that supposes one value per line */ } fclose(rfile); Message("file closed\n"); }
__________________
Best, Rexxar |
|
September 26, 2013, 16:43 |
|
#2 |
Member
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 14 |
It turns out that I need to interpret a UDF before do the execute. I don't know why, but it is working now.
__________________
Best, Rexxar |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Two questions on Fluent UDF | Steven | Fluent UDF and Scheme Programming | 7 | March 23, 2018 04:22 |
How to open Icem mesh in Ansys Fluent? | emmkell | FLUENT | 27 | February 6, 2018 04:34 |
Error in reading Fluent 13 case file in fluent 12 | apurv | FLUENT | 2 | July 12, 2013 08:46 |
fluent parallel problem in win7 x64 system | dunga82 | FLUENT | 8 | April 19, 2012 21:23 |
Fluent 6.3 32bit vs Fluent 12.0 64bit | ibex7 | FLUENT | 7 | April 18, 2011 03:44 |