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

fscanf fonction load value txt file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2017, 14:14
Default fscanf fonction load value txt file
  #1
New Member
 
Join Date: Dec 2015
Posts: 11
Rep Power: 10
fersim is on a distinguished road
Hello,

I have a question and I will like if anyone can help me to write the following DEFINE_SOURCE:
I inform you that the values of T_mean and Time is in a txt file named result.txt.

I want to write an udf program that uses the found values of the text file.
I ran the progame and I did not find any errors but the program does not give me the values of
T_mean and Time. Help me please.


DEFINE_SOURCE(Source_AIR, c, t, dS, eqn)
{
real source, Time,T_mean;
FILE *pFile;
pFile=fopen("c:/result.txt","r");
fscanf(pFile,"%g %g\n",&Time,&T_mean);
fclose(pFile);
source =32*T_mean*Time;
dS[eqn] = 0.0;
return source;
}
fersim 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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 06:42
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
pisoFoam compiling error with OF 1.7.1 on MAC OSX Greg Givogue OpenFOAM Programming & Development 3 March 4, 2011 17:18
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23


All times are GMT -4. The time now is 19:40.