CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

BUG cavitation UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By ghost82

Reply
 
LinkBack Thread Tools Display Modes
Old   November 3, 2014, 12:19
Default BUG cavitation UDF
  #1
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
----------------

Last edited by ghost82; November 18, 2014 at 09:01.
ghost82 is offline   Reply With Quote

Old   November 5, 2014, 10:48
Default
  #2
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
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_vapor-ABS_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;
}
Equations are here:
http://www.arc.vt.edu/ansys_help/flu...avitation.html

Can anybody confirm if there is a bug or something else?
ghost82 is offline   Reply With Quote

Old   November 6, 2014, 09:28
Default
  #3
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
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.
ghost82 is offline   Reply With Quote

Old   November 13, 2014, 10:42
Default
  #4
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
Ok, this is the update from Ansys support, and I agree with their comments:

1-mafV in udf is vapor mass fraction
2-in 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
3-in fluent post-processing 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 cfd-post; I will update this thread if confirmed.
__________________
Google is your friend and the same for the search button!
ghost82 is offline   Reply With Quote

Old   November 18, 2014, 08:48
Default
  #5
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 918
Rep Power: 15
ghost82 will become famous soon enough
Ok, this is solution to questions, thanks to Ansys support!

1- It is confirmed the bug in CFD-POST 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 CFD-POST 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 CFD-POST 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.
pakk likes this.
__________________
Google is your friend and the same for the search button!

Last edited by ghost82; November 18, 2014 at 11:07.
ghost82 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
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
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 11:55
HELP! adding a mass source to VOF eqn. by UDF??? ROOZBEH FLUENT 4 May 29, 2003 09:54


All times are GMT -4. The time now is 21:27.