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

Write data in UDF similar to XY-plot

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

Like Tree1Likes
  • 1 Post By Seppl Huber

LinkBack Thread Tools Display Modes
Old   June 18, 2012, 09:08
Default Write data in UDF similar to XY-plot
New Member
Join Date: Jan 2012
Posts: 4
Rep Power: 7
Seppl is on a distinguished road

I am trying to write an UDF for the following problem:

* I have an instationary simulation where I want to save the velocity components across a straight line
* When doining it only once, I would define a line and use in the GUI the XY-plot function with th option write.
* However I want to save the data of approx. 1000 time steps for later post processing (e.g. in MATLAB).
* How does Fluent interpolate the points in the XY-Plot and are there some UDF macros available?

Thanks in advance
Seppl is offline   Reply With Quote

Old   June 18, 2012, 09:39
Default journal
Join Date: Oct 2011
Posts: 33
Rep Power: 8
chittipo is on a distinguished road
I think, you just need to write a journal.
For e.g the following journal commands writes the temperature data along the center.

; Data of Axial Temperature Profile (simDataTempAxial.dat)
;node values? [yes]
;filename [""]
;order points? [no]
;Y Axis direction vector? [no]
;Y Axis curve length? [no]
;cell function
;X Axis direction vector? [no]
;ix [1]
;iy [0]
;surface id/name(1) [()] 3. 3 represents "Axis" in this case and data file. This will be changed base on our requirement. eg for pressureOutlet 4 here
;surface id/name(2) [()]. below space is required

chittipo is offline   Reply With Quote

Old   June 19, 2012, 10:35
New Member
Join Date: Aug 2011
Posts: 2
Rep Power: 0
Seppl Huber is on a distinguished road

somewhere on this forum I found the following code which identifies the closest cell centroid to a given point:

PHP Code:
real pos[ND_ND] = {0.05,0.2,0.3};/*the position of the monitoring point*/
static cell_t c0 = -1;/*index of the cell containing the monitoring point*/
cell_t c;
Thread *t0 NULL;/*thread of the cell containing the monitoring point*/
Thread *t;
real x[ND_ND], d2 1.0e9d20 1.0e9;
FILE *pf;
NULL == t0)
d2 NV_MAG2(x);
d2 d20)
d20 d2;
t0 t;
c0 c;

In princeple the only thing to do is to define the line from a number of point and to calculate the value of the quantity in this point from the value in the cell centroid, the gradient there and the distance to the point on the line.
mm.abdollahzadeh likes this.
Seppl Huber 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
Write UDF to add a sink term for PEM fuel cell design kitrax Fluent UDF and Scheme Programming 0 March 15, 2012 05:56
how write data with udf zzyan FLUENT 5 July 27, 2010 00:50
How to save 2-D data in contour plot mssound FLUENT 0 February 15, 2010 15:01
UDF to write a data file lichun Dong FLUENT 2 August 4, 2005 11:21
UDF to write interp files Karl FLUENT 6 February 7, 2002 13:10

All times are GMT -4. The time now is 06:17.