|
[Sponsors] |
August 29, 2014, 02:14 |
How to print the value of UDF!!
|
#1 |
Member
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14 |
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 ! |
|
August 29, 2014, 03:22 |
|
#2 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
wouldn't it be better to store "mut" in an UDMI and monitor it via GUI rather than printing it out?
Cheers! |
|
August 29, 2014, 03:59 |
|
#3 |
Member
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14 |
||
August 29, 2014, 05:02 |
|
#4 |
Senior Member
Join Date: Nov 2010
Posts: 103
Rep Power: 16 |
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! |
|
August 29, 2014, 05:24 |
|
#5 |
Member
le hoang anh
Join Date: Oct 2012
Posts: 96
Rep Power: 14 |
Thank you very much!
This is really helpful for me. |
|
September 1, 2014, 10:34 |
|
#6 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
"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. |
|
|
|
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 |