|
[Sponsors] |
I/O of a real value by "DEFINE_RW_FILE" (UDF) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 18, 2003, 06:05 |
I/O of a real value by "DEFINE_RW_FILE" (UDF)
|
#1 |
Guest
Posts: n/a
|
Hi all,
I'm trying to add a real value to DATA file by "DEFINE_RW_FILE" macro (UDF). In the following, find the code. The first sub writes the correct value (I have verified the DATA file) while the second one fails. The same code works well if you consider an integer value (%d), like reported in the UDF manual. I have tried unsuccessfully other file formats (%e,%f,%1.6e,...). What's the matter ? Thanks a lot, Pietro ------------------------------------------------------ #include "udf.h" real XREAL; DEFINE_RW_FILE(writer, fp) { XREAL = 23.678; printf("Writing UDF data to data file...\n"); fprintf(fp, "%g\n",XREAL); /* write to data file */ printf("\n XREAL = %g \n",XREAL); } ------------------------------------------------------ DEFINE_RW_FILE(reader, fp) { printf("Reading UDF data from data file...\n"); fscanf(fp, "%g\n",&XREAL); /* read from data file */ printf("\n XREAL = %g\n",XREAL); } ------------------------------------------------------ Writing UDF data to data file... XREAL = 23.678 Done. Reading UDF data from data file... XREAL = 5.44921e-315 Done. |
|
August 15, 2015, 20:08 |
|
#2 |
New Member
Pranay Chakraborty
Join Date: Aug 2015
Posts: 2
Rep Power: 0 |
Hi Pietro,
I want to know from you how to find the saved value of XREAL. I have saved my data and case file after a specific time for my case. I loaded the result in CFD_POST. I couldn't see the saved data. Please let me know about this. Sorry it is not relevant to your question. Appreciate!! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
NOx UDF | Abhishek Asthana | FLUENT | 5 | October 12, 2016 08:24 |
UDF for wall slipping | HFLUENT | Fluent UDF and Scheme Programming | 0 | April 27, 2011 13:03 |
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! | alban | Fluent UDF and Scheme Programming | 2 | June 8, 2010 19:54 |
Help Parallelizing UDF | AndresC | FLUENT | 0 | February 25, 2010 16:50 |
udf error | Rashmi | FLUENT | 0 | December 27, 2005 06:35 |