|
[Sponsors] |
October 4, 2014, 07:22 |
vofM or vofM[c]?
|
#1 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
Hi!
the code below is an example of an old define cavitation rate for fluent v.6. Can somebody please explain me why in the code below there is vofM and not vofM[c]? Is this because vofM is declared as real and not as array and its value is automatically updated at every cell iteration, whilst rhoV, rhoL, vofV are arrays? Code:
#include "udf.h" #define MIN_VOF 1.e-5 #define MAX_VOF 0.99999 DEFINE_CAVITATION_RATE(Rayleigh, c, t, p, rhoV, rhoL, vofV, p_v, n_b, m_dot) { real p_vapor = *p_v; /* vapor pressure */ real n_bubbles = *n_b; /* bubbles per liquid volume */ real dp, vofM, radV, Rdot; dp = p_vapor-ABS_P(p[c],op_pres); /* p_vap - p_abs */ /* vapor volume fraction restricted to [1.e-5,1.0-1.e-5] */ vofM=MIN(MAX(MIN_VOF,vofV[c]),MAX_VOF); /* bubble radius */ radV = pow(3.0*vofM/((1.-vofM)*4.0*M_PI*n_bubbles), 1./3.); /* radius time derivative */ if (dp > 0.0) {/* bubble grow */ Rdot = sqrt(2.*dp/(3.*rhoL[c])); } else {/* bubble collapse */ Rdot = -sqrt(-2.*dp/(3.*rhoL[c])); if (vofV[c]<=MIN_VOF) { Rdot=0.0; } } /* compute interphase mass flow rate per unit volume */ *m_dot = rhoV[c]*rhoL[c]*vofM*(1.0-vofM)/(vofM*rhoV[c]+(1.0-vofM)*rhoL[c]) *3.0/radV*Rdot; } Last edited by ghost82; October 4, 2014 at 09:42. |
|
October 5, 2014, 11:48 |
|
#2 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
Code:
vofM=MIN(MAX(MIN_VOF,vofV[c]),MAX_VOF); |
||
|
|