CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Writing txt file in an UDF

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

LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2014, 12:11
Default Writing txt file in an UDF
New Member
Sayan Bose
Join Date: Apr 2013
Posts: 17
Rep Power: 13
sayan_bose is on a distinguished road
I want to write the particle accelerations in a separate txt file, in a DPM_BODY_FORCE UDF, by performing a file operation, to do that I added this few line in the DPM body force UDF, which logically should have worked.

But after loading the udf, when I am executing calculation fluent is getting closed when the particle update is about to happen, and the txt files created doe not have any thing in them, they are just blank.

This is the code, which just show the file operation part along with the conventional DPM body force codes, please tell me where I have gone wrong and what should I do to correct it.

FILE *x_comp;
FILE *y_comp;
FILE *z_comp;

real bforce,bforcex,bforcey,bforcez;


modr=............................................. ........


Ax = bforcex/P_MASS(p);

else if(i==1.)
Ay = bforcey/P_MASS(p);

else if(i==2.)
Az = bforcez/P_MASS(p);




sayan_bose is offline   Reply With Quote

Old   February 3, 2014, 07:52
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
It can be that you still have the files opened in some editor (notepad or whatever). I think I did that once and then Fluent also shut down without warning.
pakk is offline   Reply With Quote


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 104 February 16, 2021 08:46
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00

All times are GMT -4. The time now is 01:36.