# Help with DEFINE_CAVITATION_RATE macro

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

 July 1, 2016, 07:34 Help with DEFINE_CAVITATION_RATE macro #1 New Member   Join Date: Jun 2016 Posts: 5 Rep Power: 8 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.

 Tags cavitation