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

SAving variables using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 14, 2015, 19:49
Default SAving variables using UDF
  #1
New Member
 
Ahmed Jalal
Join Date: Mar 2015
Posts: 22
Rep Power: 11
A.Jalal is on a distinguished road
Hello Guys,

I have a question regarding saving certain values into a text file or excel file. Can I save the values that I am asking my UDF to display? In my case DT_CG and Spring Force as shown in the UDF below?
The reason is I want to plot a graph of DT_CG/Spring Force with respect to time.
Any help would be appreciated. I am aware it is a DEFINE AT END Function but I just need help on how to set it up.

Thank You




#include
"udf.h"
#define spring_constant 300 /*N/m*/
#define original_valve_cg_y 0.029972
DEFINE_SDOF_PROPERTIES(spring_check_valve, prop, dt, time, dtime)
{
real valve_movement_y;
prop[SDOF_MASS] = 0.00297817;
prop[SDOF_IXY] = 3.33709e-12;
prop[SDOF_IXX] = 2.27698e-06;
prop[SDOF_IYY] = 2.53895e-07;
prop[SDOF_IZZ] = 2.53088e-06;
prop[SDOF_ZERO_TRANS_X] = TRUE;
prop[SDOF_ZERO_TRANS_Z] = TRUE;
prop[SDOF_ZERO_ROT_X] = TRUE;
prop[SDOF_ZERO_ROT_Y] = TRUE;
prop[SDOF_ZERO_ROT_Z] = TRUE;
valve_movement_y = (DT_CG(dt)[1] - original_valve_cg_y);
Message(
"DT_CG = %e, %e, %e\n",DT_CG(dt)[0], DT_CG(dt)[1], DT_CG(dt)[2]);
prop[SDOF_LOAD_F_Y] = - spring_constant * valve_movement_y;
Message(
"spring force = %e\n",prop[SDOF_LOAD_F_Y]);
}
A.Jalal is offline   Reply With Quote

Reply

Tags
save, txt, udf


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
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF acasas CFD Freelancers 1 January 23, 2015 08:26
UDF to read and file flow variables pramode77 Fluent UDF and Scheme Programming 0 December 1, 2014 16:18
Setting up a parametric simulation with UDF variables rohinibc Fluent UDF and Scheme Programming 4 November 19, 2014 11:52
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF for mean variables Gab FLUENT 0 September 28, 2007 17:17


All times are GMT -4. The time now is 19:53.