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

Help with DEFINE_CAVITATION_RATE macro

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 1, 2016, 07:34
Exclamation Help with DEFINE_CAVITATION_RATE macro
  #1
New Member
 
Join Date: Jun 2016
Posts: 5
Rep Power: 2
rsedaaghi is on a distinguished road
Hi,
I'm trying to use the DEFINE_CAVITATION_RATE macro with the tutorial.

Code:
#include"udf.h"
#define c_evap 1.0
#define c_con 0.1
DEFINE_CAVITATION_RATE(user_cav_rate, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, m_dot)
{
   real p_vapor = *p_v;
   real dp, dp0, source;
   p_vapor += MIN(0.195*C_R(c,t)*C_K(c,t), 5.0*p_vapor);
   dp = p_vapor - ABS_P(p[c], op_pres);
   dp0 = MAX(0.1, ABS(dp));
   source = sqrt(2.0/3.0*rhoL[c])*dp0;
   if(dp > 0.0)
      *m_dot = c_evap*rhoV[c]*source;
   else
      *m_dot = -c_con*rhoL[c]*source;
}
I got some questions:

1. What is op_pres? (solved it stands for operating pressure!!! )
2. I don't get this: ABS_P(p[c], op_pres) shouldn't it be: ABS_P(C_P(c, t), op_pres) I mean what are the differences? (solved p[c] refers to shared pressure I don't the background for this but it seems that it differs from the simple old C_P(c,t)!!!)
3. How does ABS_P differ from ABS? (solved ABS_P stands for absolute pressure and it's a function with 2 arguments!!! As you know ABS is mathematical function which stands for absolute value!!!)
4. Does FLUENT run this macro for each cell? What I mean is: Does it do a loop on all cells when it uses this macro or does it call this macro for each and every cell?
5. How does FLUENT calculate or know about rhoV and rhoL? (solved when one introduces liquid phase (as phase-1) and vapor phase (as phase-2) to the code it uses liquid phase's density as rhoL and vapor phase's density as rhoV!!!)

Thank you.

Last edited by rsedaaghi; July 1, 2016 at 16:26.
rsedaaghi is offline   Reply With Quote

Reply

Tags
cavitation

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
Macro within a Macro shubham2941 Tecplot 1 September 4, 2015 18:33
How to use the thread_storage macro? lxlxlxt FLUENT 0 February 10, 2014 22:53
StarCCM+ Command line options and Macro execution isidp STAR-CCM+ 8 January 29, 2013 06:00
Macro problem cfddummy CD-adapco 1 April 9, 2007 12:37
Call a macro from a macro Flav CD-adapco 2 July 1, 2004 05:42


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