CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

I/O of a real value by "DEFINE_RW_FILE" (UDF)

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 18, 2003, 05:05
Default I/O of a real value by "DEFINE_RW_FILE" (UDF)
Pietro Asinari
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,



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

  Reply With Quote

Old   August 15, 2015, 19:08
New Member
Pranay Chakraborty
Join Date: Aug 2015
Posts: 2
Rep Power: 0
pc_UNR is on a distinguished road
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.
pc_UNR is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
NOx UDF Abhishek Asthana FLUENT 5 October 12, 2016 07:24
UDF for wall slipping HFLUENT Fluent UDF and Scheme Programming 0 April 27, 2011 12:03
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 18:54
Help Parallelizing UDF AndresC FLUENT 0 February 25, 2010 16:50
udf error Rashmi FLUENT 0 December 27, 2005 06:35

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