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

vofM or vofM[c]?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2014, 07:22
Default vofM or vofM[c]?
  #1
Senior Member
 
ghost82's Avatar
 
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27
ghost82 will become famous soon enough
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.
ghost82 is offline   Reply With Quote

Old   October 5, 2014, 11:48
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
Quote:
Originally Posted by ghost82 View Post
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?
Yes, it is because it is not an array. It is not automatically updated, but that is programmed in the line:
Code:
vofM=MIN(MAX(MIN_VOF,vofV[c]),MAX_VOF);
ghost82 likes this.
pakk is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 03:50.