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

read external file nxn as udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 13, 2016, 08:50
Default read external file nxn as udf
  #1
New Member
 
arrif toufik
Join Date: Apr 2009
Posts: 9
Rep Power: 17
arriftou is on a distinguished road
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
arriftou is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 00:34.