|
[Sponsors] |
March 13, 2016, 08:50 |
read external file nxn as udf
|
#1 |
New Member
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17 |
I am trying to read a large data table (.txt) file into my udf to use it as bondary condition heat flux on a square surface,
I tried some udf ,for example : DEFINE_ON_DEMAND ,DEFINE_EXECUTE_ON_LOADING ,DEFINE_EXECUTE_AFTER_CASE/DATA ,DEFINE_RW_FILE . but it does not work. can any one help please. here is my udf ,there is some thing wrong ? ------------------------------------------------------------------------- #include "udf.h" DEFINE_ON_DEMAND(my_demand) { Domain *domain; /* domain is declared as a variable */ domain = Get_Domain(1); /* returns fluid domain pointer */ Thread *t; cell_t c; FILE *fp; fp = fopen ("cubical1.txt","r"); if ( fp != NULL ) { char line [ 100000 ]; /* or other suitable maximum line size */ while ( fgets ( line, sizeof line, fp ) != NULL ) /* read a line */ } ------------------------------------------------------------------------- Last edited by arriftou; March 14, 2016 at 09:20. Reason: explanation |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 02:41 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
ParaView Compilation | jakaranda | OpenFOAM Installation | 3 | October 27, 2008 12:46 |