CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF Getting data from file

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

LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2009, 09:07
Default UDF Getting data from file
New Member
Join Date: Jul 2009
Posts: 3
Rep Power: 16
jreig is on a distinguished road
Hi everybody!!

I am trying to get some data from an input file to use it as an Energy source.

When interpreting the udf appears this message:

FLUENT received fatal signal (ACCESS_VIOLATION)

The error comes when trying to close the file, or to scan the file to get the data. If I comment the lines "fscanf" and "fclose" no error message appears.

Maybe the error is caused by a wrong oppening of the file.

Here is the code:


#include "udf.h"

real xc[ND_ND];
real q;
FILE *fp;
float data[108];
int i;
fp = fopen("out.txt","r");

while (i<108){


if (xc[0]>0.5)
return q;


Can anyone help me please??
jreig is offline   Reply With Quote


file, source, udf

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
I/O of a real value by "DEFINE_RW_FILE" (UDF) Pietro Asinari Fluent UDF and Scheme Programming 1 August 15, 2015 20:08
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 19:00
Regarding FoamX running Kindly help out hariya03 OpenFOAM Pre-Processing 0 April 18, 2008 05:26
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
how to handel transient data with less file space steven CFX 2 October 27, 2006 18:01

All times are GMT -4. The time now is 05:09.