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

condensation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By 2phase

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 18, 2017, 10:32
Default condensation
  #1
New Member
 
komeil
Join Date: Feb 2016
Posts: 14
Rep Power: 10
kz21 is on a distinguished road
I want to model my condensation. Does anyone have a training model in this case?
kz21 is offline   Reply With Quote

Old   December 8, 2017, 07:33
Default
  #2
New Member
 
Martin
Join Date: Apr 2017
Location: Germany
Posts: 26
Rep Power: 9
2phase is on a distinguished road
Hi,

as far as I could find out, condensation is only possible via UDF (at least in case of DPM, might be different for other multiphase problems).
In the "fluent customization manual" you can find an example for a UDF that replaces standard heat mass transfer, I think it is called DEFINE_DPM_HEAT_MASS.

Have a look at that and try to modify it according to your needs. Note: the example again does not cover condensation, if dm/dt is negative, it is set to zero, so you have to adjust this part. If you already have particles, condensation should generally work. If you have no particles where condensation could take place than you would have to model instantaneous condensation and that's for sure a very difficult thing.

Find attached my version, which is not validated nor verified by now, so use is at your own risk. I took the ANSYS example and some code snippets from a colleague to build this
I highly appreciate any review and feedback.

Cheers
Martin

Code:
/***********************************************************************
   UDF for defining the heat and mass transport for
   multicomponent particle vaporization
   
   - initial version from Fluent Customization Manual
   - modified by mho, August 2017
   
   changes:
   - replaced Nusselt / added Sherwood-Correlation
   - added Stefan-Strom correction in mass flux term
   - removed (multicomponent) boiling
   - not valid any more for multicomponent drops, restricted to water drops!

   
   
   implicated simplifications to heat/mass-transfer:
   - no radiative heat exchange
   - no Stefan-Strom correction for heat transfer
   - UDF only valid for non boiling conditions
   - only valid for 1 component transferred through the 'wall' (droplet surface); see equation for Bm using (m-1) in denominator
   - Temperature in vapor film equals droplet temperature
   - 
   
 ***********************************************************************/
 #include "udf.h"
 
 DEFINE_DPM_HEAT_MASS(multivap_mho,p,Cp,hgas,hvap,cvap_surf,Z,dydt,dzdt)
 {
   int ns;                                                  /* number/index of gas species */
   Material *sp;
   int nc = TP_N_COMPONENTS(p);                             /* number of particle components */
   Thread *t0 = P_CELL_THREAD(p);                           /* thread where the particle is in*/
   Material *gas_mix = THREAD_MATERIAL(DPM_THREAD(t0, p));  /* gas mixture material */
   Material *cond_mix = P_MATERIAL(p);                      /* particle mixture material*/
   cphase_state_t *cell = &(p->cphase);                     /* cell information of particle location*/
   
   double molwt[MAX_SPE_EQNS];                                /* molar weight of gas species in kg/kmol */
   double Tp = P_T(p);                                        /* particle temperature */
   double mp = P_MASS(p);                                     /* particle mass */
   double molwt_bulk = 0.;                                    /* average molecular weight in bulk gas */
   double Dp = DPM_DIAM_FROM_VOL(mp / P_RHO(p));              /* particle diameter */
   double Ap = DPM_AREA(Dp);                                  /* particle surface */
   double Pr = cell->sHeat * cell->mu / cell->tCond;                   /* Prandtl number ---   sHeat = specific heat capacity    in J/kg/K
                                                                                             tCond = thermal conductivity      in  W/m/K*/
   double Cp_p = Cp;                                          /* Particle heat capacity */
   
/* Nusselt number according to Whitaker aus Kneer, Waerme- und Stoffuebertragung Skript*/
      double mu_surf = MATERIAL_PROP_POLYNOMIAL(gas_mix, PROP_mu, Tp);      /* laminar viscosity of vapor in boundary layer kg/m/s   (dynamic viscosity?)   */
      double Nu = 2.0 + (0.4 * pow(p->Re, 1./2.) + 0.06 * pow(p->Re, 2./3.) ) * pow(Pr, 0.4) * pow( (cell->mu / mu_surf), 1./4.);
      double h_low = Nu * cell->tCond / Dp;                             /* Heat transfer coefficient at low mass transfer conditions */
   
/* calculating average molar mass */ 
      mixture_species_loop(gas_mix,sp,ns)
      {
           molwt[ns] = MATERIAL_PROP(sp,PROP_mwi);               /* molar weight of gas species */
           molwt_bulk += cell->yi[ns] / molwt[ns];               /* reciproke average molar weight */
      }

      /* prevent division by zero */
      molwt_bulk = MAX(molwt_bulk,DPM_SMALL);
      molwt_bulk = 1.0 / molwt_bulk;                               /* average molar weight */

/* loop over gas species for mass transfer on each species */
    for (ns = 0; ns < nc; ns++)
      {
      int gas_index = TP_COMPONENT_INDEX_I(p,ns);  /* gas species index of vaporization */
      if(gas_index >= 0)
         {
          /* condensed material */
          Material * cond_c = MIXTURE_COMPONENT(cond_mix, ns);
                    
          /* diffusion coefficient in m^2/s */
          double D = DPM_BINARY_DIFFUSIVITY(p,cond_c,P_T(p));
          
/* Schmidt number */
          double Sc = cell->mu / (cell->rho * D); /* mu in Pa s */
          
/* Sherwood number according to Brauer 1979 aus Kraume, 2012, S.221 */
          double f_k = 0.66 * pow( (1.0 + pow( (0.84 * pow(Sc, 1./6.)), 3.0)), -1./3.);
          double Sh  = 2.0 + f_k * ( pow(p->Re*Sc, 1.7) / ( 1.0 + pow(p->Re*Sc, 1.2)) );
          
/* mass fractions of water */
          /* mass fractions of water */
          double y_water_vap_bulk   = cell->yi[gas_index];
          double molwt_air = 28.949;
          /* double x_water_liq = 1.0; */
          double x_water_vap_surf = DPM_VAPOR_PRESSURE(p,cond_c,Tp) / cell->pressure;
          double y_water_vap_surf = x_water_vap_surf * molwt[ns] / (x_water_vap_surf * molwt[ns] + (1.0 - x_water_vap_surf) * molwt_air);
          
/* mass transfer calculation with Stefan-Strom correction from 'A Heat Transfer Text Book', Lienhard , page 658 ff */          
          /* mass transfer coefficient for low rates */
          double g_low = Sh *  (cell->rho) * D / Dp;            /* kg/(m^2 s) */
          /* mass transfer coefficient correction for high rates; Bm is calculated only for case of only 1 species evaporating */
          double Bm = (y_water_vap_bulk - y_water_vap_surf) / (y_water_vap_surf - 1);
          double g  = g_low * ( log(1. + Bm) / Bm );            /* kg/(m^2 s) */
          
/* vaporization rate */
          double vap_rate = g * Ap * Bm;
          
          /* no vaporization below vaporization temperature, no condensation  --- !!! disengaged to allow condensation*/
          /* vaporization temperature 
          double vap_temp = MATERIAL_PROP(cond_c,PROP_vap_temp);
          if (Tp < vap_temp)    || vap_rate < 0.0 
            vap_rate = 0.; */

          dydt[1+ns] -= vap_rate;   
          dzdt->species[gas_index] += vap_rate;
 
/* heat transfer coefficient for high mass flow rates; see 'A Heat Transfer Textbook, eq. 11.115 */ 
          /* specific heat of (water) vapor at drop temperature */
          double Cp_i = MATERIAL_PROP_POLYNOMIAL(cond_c,PROP_Cp,Tp);
          double h = vap_rate * Cp_i / ( exp(vap_rate * Cp_i / h_low) - 1.0 );
          
          double dh_dt = h * (cell->temp - Tp) * Ap;        /* heat source term for heat transfer */
          
      /* dydt[0]: particle temperature source term: dT/dt = dh/dt /(m Cp_p) */
          dydt[0] += dh_dt / (mp * Cp_p);                         /*sensible heating*/
          dydt[0] -= hvap[gas_index] * vap_rate / (mp * Cp_p);    /*phase change*/
          
          
      /* gas enthalpy source term */
          dzdt->energy -= dh_dt;
          dzdt->energy += hgas[gas_index] * vap_rate;
          


/* removed multicomponent boiling --- UDF only valid for non boiling conditions */
         }
      }
 }
Benzouz and MohammedGhazi like this.
2phase is offline   Reply With Quote

Old   December 13, 2017, 14:23
Default
  #3
New Member
 
komeil
Join Date: Feb 2016
Posts: 14
Rep Power: 10
kz21 is on a distinguished road
Quote:
Originally Posted by 2phase View Post
Hi,

as far as I could find out, condensation is only possible via UDF (at least in case of DPM, might be different for other multiphase problems).
In the "fluent customization manual" you can find an example for a UDF that replaces standard heat mass transfer, I think it is called DEFINE_DPM_HEAT_MASS.

Have a look at that and try to modify it according to your needs. Note: the example again does not cover condensation, if dm/dt is negative, it is set to zero, so you have to adjust this part. If you already have particles, condensation should generally work. If you have no particles where condensation could take place than you would have to model instantaneous condensation and that's for sure a very difficult thing.

Find attached my version, which is not validated nor verified by now, so use is at your own risk. I took the ANSYS example and some code snippets from a colleague to build this
I highly appreciate any review and feedback.

Cheers
Martin

Code:
/***********************************************************************
   UDF for defining the heat and mass transport for
   multicomponent particle vaporization
   
   - initial version from Fluent Customization Manual
   - modified by mho, August 2017
   
   changes:
   - replaced Nusselt / added Sherwood-Correlation
   - added Stefan-Strom correction in mass flux term
   - removed (multicomponent) boiling
   - not valid any more for multicomponent drops, restricted to water drops!

   
   
   implicated simplifications to heat/mass-transfer:
   - no radiative heat exchange
   - no Stefan-Strom correction for heat transfer
   - UDF only valid for non boiling conditions
   - only valid for 1 component transferred through the 'wall' (droplet surface); see equation for Bm using (m-1) in denominator
   - Temperature in vapor film equals droplet temperature
   - 
   
 ***********************************************************************/
 #include "udf.h"
 
 DEFINE_DPM_HEAT_MASS(multivap_mho,p,Cp,hgas,hvap,cvap_surf,Z,dydt,dzdt)
 {
   int ns;                                                  /* number/index of gas species */
   Material *sp;
   int nc = TP_N_COMPONENTS(p);                             /* number of particle components */
   Thread *t0 = P_CELL_THREAD(p);                           /* thread where the particle is in*/
   Material *gas_mix = THREAD_MATERIAL(DPM_THREAD(t0, p));  /* gas mixture material */
   Material *cond_mix = P_MATERIAL(p);                      /* particle mixture material*/
   cphase_state_t *cell = &(p->cphase);                     /* cell information of particle location*/
   
   double molwt[MAX_SPE_EQNS];                                /* molar weight of gas species in kg/kmol */
   double Tp = P_T(p);                                        /* particle temperature */
   double mp = P_MASS(p);                                     /* particle mass */
   double molwt_bulk = 0.;                                    /* average molecular weight in bulk gas */
   double Dp = DPM_DIAM_FROM_VOL(mp / P_RHO(p));              /* particle diameter */
   double Ap = DPM_AREA(Dp);                                  /* particle surface */
   double Pr = cell->sHeat * cell->mu / cell->tCond;                   /* Prandtl number ---   sHeat = specific heat capacity    in J/kg/K
                                                                                             tCond = thermal conductivity      in  W/m/K*/
   double Cp_p = Cp;                                          /* Particle heat capacity */
   
/* Nusselt number according to Whitaker aus Kneer, Waerme- und Stoffuebertragung Skript*/
      double mu_surf = MATERIAL_PROP_POLYNOMIAL(gas_mix, PROP_mu, Tp);      /* laminar viscosity of vapor in boundary layer kg/m/s   (dynamic viscosity?)   */
      double Nu = 2.0 + (0.4 * pow(p->Re, 1./2.) + 0.06 * pow(p->Re, 2./3.) ) * pow(Pr, 0.4) * pow( (cell->mu / mu_surf), 1./4.);
      double h_low = Nu * cell->tCond / Dp;                             /* Heat transfer coefficient at low mass transfer conditions */
   
/* calculating average molar mass */ 
      mixture_species_loop(gas_mix,sp,ns)
      {
           molwt[ns] = MATERIAL_PROP(sp,PROP_mwi);               /* molar weight of gas species */
           molwt_bulk += cell->yi[ns] / molwt[ns];               /* reciproke average molar weight */
      }

      /* prevent division by zero */
      molwt_bulk = MAX(molwt_bulk,DPM_SMALL);
      molwt_bulk = 1.0 / molwt_bulk;                               /* average molar weight */

/* loop over gas species for mass transfer on each species */
    for (ns = 0; ns < nc; ns++)
      {
      int gas_index = TP_COMPONENT_INDEX_I(p,ns);  /* gas species index of vaporization */
      if(gas_index >= 0)
         {
          /* condensed material */
          Material * cond_c = MIXTURE_COMPONENT(cond_mix, ns);
                    
          /* diffusion coefficient in m^2/s */
          double D = DPM_BINARY_DIFFUSIVITY(p,cond_c,P_T(p));
          
/* Schmidt number */
          double Sc = cell->mu / (cell->rho * D); /* mu in Pa s */
          
/* Sherwood number according to Brauer 1979 aus Kraume, 2012, S.221 */
          double f_k = 0.66 * pow( (1.0 + pow( (0.84 * pow(Sc, 1./6.)), 3.0)), -1./3.);
          double Sh  = 2.0 + f_k * ( pow(p->Re*Sc, 1.7) / ( 1.0 + pow(p->Re*Sc, 1.2)) );
          
/* mass fractions of water */
          /* mass fractions of water */
          double y_water_vap_bulk   = cell->yi[gas_index];
          double molwt_air = 28.949;
          /* double x_water_liq = 1.0; */
          double x_water_vap_surf = DPM_VAPOR_PRESSURE(p,cond_c,Tp) / cell->pressure;
          double y_water_vap_surf = x_water_vap_surf * molwt[ns] / (x_water_vap_surf * molwt[ns] + (1.0 - x_water_vap_surf) * molwt_air);
          
/* mass transfer calculation with Stefan-Strom correction from 'A Heat Transfer Text Book', Lienhard , page 658 ff */          
          /* mass transfer coefficient for low rates */
          double g_low = Sh *  (cell->rho) * D / Dp;            /* kg/(m^2 s) */
          /* mass transfer coefficient correction for high rates; Bm is calculated only for case of only 1 species evaporating */
          double Bm = (y_water_vap_bulk - y_water_vap_surf) / (y_water_vap_surf - 1);
          double g  = g_low * ( log(1. + Bm) / Bm );            /* kg/(m^2 s) */
          
/* vaporization rate */
          double vap_rate = g * Ap * Bm;
          
          /* no vaporization below vaporization temperature, no condensation  --- !!! disengaged to allow condensation*/
          /* vaporization temperature 
          double vap_temp = MATERIAL_PROP(cond_c,PROP_vap_temp);
          if (Tp < vap_temp)    || vap_rate < 0.0 
            vap_rate = 0.; */

          dydt[1+ns] -= vap_rate;   
          dzdt->species[gas_index] += vap_rate;
 
/* heat transfer coefficient for high mass flow rates; see 'A Heat Transfer Textbook, eq. 11.115 */ 
          /* specific heat of (water) vapor at drop temperature */
          double Cp_i = MATERIAL_PROP_POLYNOMIAL(cond_c,PROP_Cp,Tp);
          double h = vap_rate * Cp_i / ( exp(vap_rate * Cp_i / h_low) - 1.0 );
          
          double dh_dt = h * (cell->temp - Tp) * Ap;        /* heat source term for heat transfer */
          
      /* dydt[0]: particle temperature source term: dT/dt = dh/dt /(m Cp_p) */
          dydt[0] += dh_dt / (mp * Cp_p);                         /*sensible heating*/
          dydt[0] -= hvap[gas_index] * vap_rate / (mp * Cp_p);    /*phase change*/
          
          
      /* gas enthalpy source term */
          dzdt->energy -= dh_dt;
          dzdt->energy += hgas[gas_index] * vap_rate;
          


/* removed multicomponent boiling --- UDF only valid for non boiling conditions */
         }
      }
 }
I wanted to pass the flow of air with 90% moisture from the computational point, and the temperature would be from -20C to -20C, so that I could see the condensation. Can I be distracted by this time?
Thank you for giving your time to read this message
kz21 is offline   Reply With Quote

Old   February 23, 2018, 04:56
Default
  #4
New Member
 
Martin
Join Date: Apr 2017
Location: Germany
Posts: 26
Rep Power: 9
2phase is on a distinguished road
Hi, I am sorry to answer only now... somehow I did not recognize your post.

Unfortunately I am not sure about what exactly you want(ed) to know.
Perhaps you can specify your question
2phase 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How accurate can CFX model condensation? JuPa CFX 7 January 20, 2019 17:17
Problem setting up Condensation cwl STAR-CCM+ 2 September 1, 2017 06:35
Boiling plus condensation in a closed domain edmondlam Fluent Multiphase 0 December 28, 2015 23:26
combustion radiation and condensation in cfx siden CFX 1 February 3, 2011 17:39
condensation on horizontal tube??? Wikie FLUENT 0 July 30, 2010 04:53


All times are GMT -4. The time now is 17:12.