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

How to print the value of UDF!!

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

Like Tree1Likes
  • 1 Post By Sun

Reply
 
LinkBack Thread Tools Display Modes
Old   August 29, 2014, 01:14
Exclamation How to print the value of UDF!!
  #1
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 5
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, 02:22
Default
  #2
Sun
Member
 
Join Date: Nov 2010
Posts: 89
Rep Power: 7
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, 02:59
Default
  #3
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 5
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, 04:02
Default
  #4
Sun
Member
 
Join Date: Nov 2010
Posts: 89
Rep Power: 7
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, 04:24
Default
  #5
Member
 
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 5
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, 09:34
Default
  #6
Member
 
Join Date: Jul 2013
Posts: 74
Rep Power: 5
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

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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
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 01:53


All times are GMT -4. The time now is 05:45.