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

UDF for Nucleation site density - contact angle - latent heat

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 20, 2021, 10:30
Default UDF for Nucleation site density - contact angle - latent heat
  #1
New Member
 
Kevin Fontaine
Join Date: Mar 2020
Posts: 8
Rep Power: 6
fonk is on a distinguished road
Good morning,

I am trying to write a UDF to implement the Hibiki-Ishii formulation of the Nucleation site density in my Fluent simulation and there are 4 points for which I would appreciate some help:

1)This formulation depends on the contact angle. I was wondering if there was a way to access the contact angle value using a macro as Fluent has to calculate it to determine the bubble departure diameter when the Kocamustafaogullari - Ishii formulation is used to assess it or if I had to compute the contact angle within the UDF. I could not find any macro yet.

In the surface tension tab of the phase interaction window, I do use surface Tension Force Modelling using a continuum Surface Force and a constant value of the surface tension.

2)Is it possible to access, using a macro, the Standard State Enthalpy specified in the material properties? Indeed, I need the latent heat for the Hibiki - Ishii formulation of the nucleation site density. Right now I define the latent heat within the UDF but having access to it would be more convenient.

3)I would also like to know what will the macro C_R(c0,pt0[gas_phase]) give if there is no gas in the cell.

4) I have trouble to understand how the lines to get the specified surface tension work, specifically the line starting with the pointer property definition and the T_sfc definition. (I got that part in the customization manual where the surface tension is retrieved in the example 2 of DEFINE_EXCHANGE_PROPERTY.). I could not find any explanation about the macro used in the manual nor elsewhere.

here is the code for now:
Code:
#include "udf.h"

#define Nn_bar 4.72e5
#define mu 0.722
#define lambda_prim 2.5e-6
#define R 8.31
#define lat_heat 3.966077e4
DEFINE_BOILING_PROPERTY(nucleate_site_density,f,t,c0,t0,from_index,from_species_index,to_index,to_species_index)
 {	
 // f : 					wall face
 // t :						pointer to the wall face thread
 // c0 : 					cell index of the cell next to the wall
 // to :					pointer to mixture level thread
 // from_index :			        Liquid phase 
 // from_species_index :	        ID of liquid species
 // to_index :				Vapor phase
 // to_species_index :		        ID of vapor species
   real nuc_site_d, T_sfc, rho_plus, f_rho_plus, Rc, sigma, theta;
   
   int liq_phase = from_index;
   int gas_phase = to_index;
   Thread **pt0 = THREAD_SUB_THREADS(t0);
   real T_SAT = C_STORAGE_R(c0,t0,SV_SAT_TEMPERATURE);
   real T_l = C_T(c0, pt0[liq_phase]); 
   real rho_g = C_R(c0,pt0[gas_phase]); 
   real rho_l = C_R(c0,pt0[liq_phase]);
   real P_l = C_P(c0,pt0[liq_phase]);
   real T_g = C_T(c0,pt0[gas_phase]);  

   /* ------ Get surface tension  ------ */
   Property *prop = DOMAIN_COMPLEX_PROP_PROPERTY(DOMAIN_INTERACTION(root_domain),
COMPLEX_PROP_sfc_tension_coeff,liq_phase,gas_phase);
   T_sfc = (sg_temperature &&
NNULLP(THREAD_STORAGE(pt0[liq_phase],SV_T)))? C_T(c,pt0[liq_phase]) :  T_REF;
   if(prop == NULL || PROPERTY_METHOD(prop,0) == PROP_METHOD_NONE)
	{
		Error("Hibiki-Ishii nucleation site density: Please set value for surface tension !");
	}
	sigma = generic_property(c,t,prop,(Property_ID)0,T_sfc);
	if (sigma < 0.)
	{
		Error("Hibiki-Ishii nucleation site density: Please provide a nonzero value for surface tension");
	}  
   /*------------------------------------*/

   theta = 	

   rho_plus = log10((rho_l - rho_g)/rho_g);
   f_rho_plus = -0.01064 + 0.48246*rho_plus - 0.22712*rho_plus^2 +0.05468*rho_plus^3;
   Rc = (2*sigma*(1+(rho_g/rho_l))/P_l)/(exp(lat_heat*(T_g - T_SAT)/(R*T_g*T_SAT)-1);
   nuc_site_d = Nn_bar*(1-exp(-theta/(8*mu^2)))*(exp(f_rho_plus*lambda_prim/Rc)-1);
   return nuc_site_d;

 }
Thank you very much for your time.
fonk is offline   Reply With Quote

Reply

Tags
contact angle, latent heat, nucleation site density, surface tension


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
UDF for dynamic Contact Angle Wolfgang.Black FLOW-3D 0 May 26, 2020 16:20
How to deal latent heat during phase change through source term udf dkb_bg Fluent UDF and Scheme Programming 4 April 12, 2018 21:26
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50


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