
[Sponsors] 
November 3, 2014, 12:19 

#1 
Senior Member
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 995
Rep Power: 17 
It seems there's something more then this...I cannot compare results with the built in Schnerr and Sauer model with a custom udf in which is coded the same model. Results are completely different
I tried both vofV=mafV[c] and vofV=mafV[c]*C_R(c,t)/rhoV[c] but no luck... This is udf: Code:
#include "udf.h" DEFINE_CAVITATION_RATE(custom_cav, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, m_dot) { real p_vapor = *p_v; real n_bubbles = 1.e12; real dp, Rb, vofV, source; dp = p_vaporABS_P(p[c],op_pres); vofV = mafV[c]; /* by printing on the console mafV is volume fraction not the mass fraction, probably a fluent bug */ Rb=pow((3.0*vofV/((1.vofV)*4.0*M_PI*n_bubbles)), 1./3.); if (dp > 0.0) { source = sqrt(2/3*fabs(dp)/rhoL[c]); } else { source = sqrt(2/3*fabs(dp)/rhoL[c]); } *m_dot = rhoV[c]*rhoL[c]/C_R(c,t)*3.*vofV*(1.vofV)/Rb*source; } http://www.arc.vt.edu/ansys_help/flu...avitation.html Can anybody confirm if there is a bug or something else? Last edited by wyldckat; November 29, 2015 at 07:26. Reason: first post had been deleted, had to merge both posts to not delete thread 

November 6, 2014, 09:28 

#2 
Senior Member
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 995
Rep Power: 17 
I wrote to ansys support..let's see what they say..
__________________
Google is your friend and the same for the search button! Last edited by ghost82; November 6, 2014 at 14:12. 

November 13, 2014, 10:42 

#3 
Senior Member
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 995
Rep Power: 17 
Ok, this is the update from Ansys support, and I agree with their comments:
1mafV in udf is vapor mass fraction 2in the initialization panel the vapor fraction is mass fraction for Singhal et al cavitation model and volume fraction for the other models; so for custom cavitation udf the initialization panel requests mass fraction 3in fluent postprocessing when you plot vapor volume fraction, vapor volume fraction is plotted for every cavitation model My error was to consider in the initialization panel always vapor volume fraction. So, fluent (solver and post processing) is ok, however, it seems the bug is in cfdpost; I will update this thread if confirmed.
__________________
Google is your friend and the same for the search button! 

November 18, 2014, 08:48 

#4 
Senior Member
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 995
Rep Power: 17 
Ok, this is solution to questions, thanks to Ansys support!
1 It is confirmed the bug in CFDPOST 15.0.7: if you define a custom cavitation udf (and maybe when using the Singhal et al cavitation model), save the cas and dat files in fluent, open CFDPOST and load the dat file, if you plot the vapor volume fraction variable it is plotted the vapor mass fraction. However, if you export from fluent the vapor volume fraction variable and you open the exported files (ascii or binary) in CFDPOST the plotted vapor volume fraction is correct. A request to solve the bug was posted. 2 Another problem I had is that if you define in udf the vapor volume fraction as: vofV = 1./(1.+(rhoV[c]/rhoL[c])*(1./mafV[c]1.)) and you copy vofV values into C_UDMI: C_UDMI(c,t,0) = vofV if you plot in fluent cell centered values of C_UDMI(c,t,0) and vapor volume fraction values are different: this is because when you define a custom cavitation mass rate you have to turn on the Singhal et al cavitation model; this model takes into account also the incondensable mass fraction; if it is not zero when you plot the vapor volume fraction in fluent you are plotting secondary phase volume fraction (in my case steam+incondensable, and not only the steam volume fraction). If incondensable mass fraction is zero C_UDMI and vapor volume fraction values are the same.
__________________
Google is your friend and the same for the search button! Last edited by ghost82; November 18, 2014 at 11:07. 

November 24, 2015, 20:02 

#5  
New Member
John
Join Date: Nov 2015
Posts: 1
Rep Power: 0 
Quote:
Thanks for your important and attractive posts. 

August 3, 2016, 09:10 

#6 
New Member
Mehmet Kaya
Join Date: Jan 2010
Posts: 10
Rep Power: 9 
Dear Ghost82 and others,
Please check Fluent UDF manual the following for define_cavitation_rate;  ''Assuming mdot denotes the masstransfer rate between liquid and vapor phases, we have Re=max [mdot,0] fl Rc=max [mdot,0] fv where fl and fv are the massfraction of the liquid and vapor phase, respectively. DEFINE_CAVITATION_RATE is used to calculate mdot only. The values of Re and Rc are computed by the solver, accordingly.''  It seems the source terms Re and Rc are computed by multiplying mdot with mass fraction terms by the solver. Therefore, considering your UDF for the Schnerr model, I think we need to divide your mdot expression for Re by fl as seen below. m_dot = rhoV[c]*rhoL[c]/C_R(c,t)*3.*vofV*(1.vofV)/Rb*source / (1mafV[c]f_gas) What do you think? With kind regards, 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Dynamic Mesh UDF  Qureshi  FLUENT  6  January 17, 2017 10:50 
HELP! adding a mass source to VOF eqn. by UDF???  ROOZBEH  FLUENT  5  December 3, 2016 18:53 
How to add a UDF to a compiled UDF library  kim  FLUENT  3  October 26, 2011 21:38 
Help Parallelizing UDF  AndresC  FLUENT  0  February 25, 2010 16:50 
DEFINE_DPM_OUTPUT macro UDF HELP  Puneet  FLUENT  3  November 28, 2003 11:55 