CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > 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

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

  Reply With Quote

Old   August 15, 2015, 20:08
Default
  #2
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.
Appreciate!!
pc_UNR is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


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


All times are GMT -4. The time now is 15:38.