|
[Sponsors] |
June 19, 2017, 15:14 |
fscanf fonction load value txt file
|
#1 |
New Member
Join Date: Dec 2015
Posts: 11
Rep Power: 11 |
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; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
"parabolicVelocity" in OpenFoam 2.1.0 ? | sawyer86 | OpenFOAM Running, Solving & CFD | 21 | February 7, 2012 12:44 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 18:18 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |