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

How to print the value of UDF!!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Sun

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 29, 2014, 02:14
Exclamation How to print the value of UDF!!
  #1
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14
lehoanganh07 is on a distinguished road
Hi,
I have simple UDF to modify the turbulence viscosity as the program below. I want to know the code is work or not. So I put an message to print on the screen. But the message did not print out.

#include "udf.h"
#include "math.h"
#include "mem.h"

DEFINE_TURBULENT_VISCOSITY(reboud_mut,cell,thread)
{
#if PARALLEL
real mut;
real rhol=995.7;
real rhov=0.03009;
real cmu = 0.0845;
real damp;
real a1;
real k =C_K(cell,thread);
real d =C_D(cell,thread);
a1=(C_R(cell,thread)-rhov)/(rhol-rhov);
damp=rhov+(rhol-rhov)*pow(a1,10);
mut=damp*cmu*k*k/d;
return mut;
Message("update turbulence vis %g\n",mut);
#endif
}

Please help me how to print the message !
Thank you !
lehoanganh07 is offline   Reply With Quote

Old   August 29, 2014, 03:22
Default
  #2
Sun
Senior Member
 
Sun's Avatar
 
Join Date: Nov 2010
Posts: 103
Rep Power: 16
Sun is on a distinguished road
wouldn't it be better to store "mut" in an UDMI and monitor it via GUI rather than printing it out?
Cheers!
lehoanganh07 likes this.
Sun is offline   Reply With Quote

Old   August 29, 2014, 03:59
Default
  #3
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14
lehoanganh07 is on a distinguished road
Quote:
Originally Posted by Sun View Post
wouldn't it be better to store "mut" in an UDMI and monitor it via GUI rather than printing it out?
Cheers!
Thank you for your quick answer!

I try like this: C_UDMI(c,t,0)=mut

but I dont know how to monitor via GUI
lehoanganh07 is offline   Reply With Quote

Old   August 29, 2014, 05:02
Default
  #4
Sun
Senior Member
 
Sun's Avatar
 
Join Date: Nov 2010
Posts: 103
Rep Power: 16
Sun is on a distinguished road
you can do it like any other solution variables such as pressure, velocity etc. Imagine you are monitoring the velocity over time on a surface, line or the entire domain, instead of velocity select UDMI0. Have a look at Step3 of this tutorial:

http://www.arc.vt.edu/ansys_help/flu_tg/x1-210002.13.html


in "Field Variable" drop down menu select UDMI0.
cheers!
Sun is offline   Reply With Quote

Old   August 29, 2014, 05:24
Default
  #5
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14
lehoanganh07 is on a distinguished road
Thank you very much!
This is really helpful for me.
lehoanganh07 is offline   Reply With Quote

Old   September 1, 2014, 10:34
Default
  #6
Member
 
Join Date: Jul 2013
Posts: 80
Rep Power: 13
upeksa is on a distinguished road
"Return" it is used for exiting the function, so when your code reach the line "Message", your code skips that line.

If you print the message and the you use "return", it will work.
upeksa 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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01
PRINT VALUE FROM UDF Pravesh Kumar FLUENT 5 October 9, 2002 02:53


All times are GMT -4. The time now is 13:46.