CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Write data in UDF similar to XY-plot

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Seppl Huber

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

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
Seppl is offline   Reply With Quote

Old   June 18, 2012, 09:39
Default journal
  #2
Member
 
Join Date: Oct 2011
Posts: 34
Rep Power: 14
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)
;
/plot/plot
;node values? [yes]
yes
;filename [""]
"simDataTempAxial.dat"
;order points? [no]
no
;Y Axis direction vector? [no]
no
;Y Axis curve length? [no]
no
;cell function
temperature
;X Axis direction vector? [no]
yes
;ix [1]
1
;iy [0]
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
3
;surface id/name(2) [()]. below space is required

;
;
;
chittipo is offline   Reply With Quote

Old   June 19, 2012, 10:35
Default
  #3
New Member
 
N/A
Join Date: Aug 2011
Posts: 2
Rep Power: 0
Seppl Huber is on a distinguished road
Hi,

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;
static 
Thread *t0 NULL;/*thread of the cell containing the monitoring point*/
Thread *t;
real x[ND_ND], d2 1.0e9d20 1.0e9;
FILE *pf;
 
if(
NULL == t0)
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
NV_V(x,-=,pos);
d2 NV_MAG2(x);
if(
d2 d20)
{
d20 d2;
t0 t;
c0 c;
}
}
end_c_loop(c,t)

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

Reply


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
Write UDF to add a sink term for PEM fuel cell design kitrax Fluent UDF and Scheme Programming 0 March 15, 2012 04: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 14: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 12:10


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