![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Description
You can use
DEFINE_CAVITATION_RATE to model the cavitation source terms
and
in the vapor mass fraction transport equation used in the Singhal et. al model (see
this equation in the separate
Theory Guide ). Assuming
denotes the mass-transfer rate between liquid and vapor phases, we have
where
and
are the mass-fraction of the liquid and vapor phase, respectively.
DEFINE_CAVITATION_RATE is used to calculate
only. The values of
and
are computed by the solver, accordingly.
Usage
DEFINE_CAVITATION_RATE( name, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, m_dot) |
Argument Type | Description |
symbol name | UDF name. |
cell_t c | Cell index. |
Thread *t | Pointer to the mixture-level thread. |
real *p[c] | Pointer to shared pressure. |
real *rhoV[c] | Pointer to vapor density. |
real *rhoL[c] | Pointer to liquid density. |
real *mafV[c] | Pointer to vapor mass fraction. |
real *p_v | Pointer to vaporization pressure. |
real *cigma | Pointer to liquid surface tension coefficient. |
real *f_gas | Pointer to the prescribed mass fraction of |
non condensable gases. | |
real *m_dot | Pointer to cavitation mass transfer rate. |
Function returns | |
void | |
There are eleven arguments to DEFINE_CAVITATION_RATE: name, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, and m_dot. You supply name, the name of the UDF. c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, and m_dot are variables that are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to set the value referenced by the real pointer m_dot to the cavitation rate.
Example
The following UDF named c_rate, is an example of a cavitation model for a multiphase mixture that is different from the default model in ANSYS FLUENT. This cavitation model calculates the cavitation mass transfer rates between the liquid and vapor phase depending on fluid pressure ( *p), turbulence kinetic energy ( C_K(c,t)), and the liquid vaporization pressure ( *p_v).
In general, the existence of turbulence enhances cavitation. In this example, the turbulence effect is taken into account by increasing the cavitation pressure by 0.195* C_R(c,t) * C_K(c,t). The pressure p_vapor that determines whether cavitation occurs increases from p_v to
p_v + 0.195 * C_R(c,t) * C_K(c,t) |
When the absolute fluid pressure (
ABS_P) is lower than
p_vapor, then liquid evaporates to vapor (
). When it is greater than
p_vapor, vapor condenses to liquid (
).
The evaporation rate is calculated by
If ABS_P < p_vapor, then c_evap * rhoV[c] * sqrt(2.0/3.0*rhoL[c]) * ABS(p_vapor - ABS_P(p[c])) |
The condensation rate is
If ABS_P > p_vapor, then -c_con*rhoL[c] * sqrt(2.0/3.0*rhoL[c]) * ABS(p_vapor - ABS_P(p[c])) |
where c_evap and c_con are model coefficients.
/*********************************************************************** UDF that is an example of a cavitation model different from default. Can be interpreted or compiled. ************************************************************************/ #include "udf.h" #define c_evap 1.0 #define c_con 0.1 DEFINE_CAVITATION_RATE(c_rate,c,t,p,rhoV,rhoL,mafV,p_v,cigma,f_gas, m_dot) { real p_vapor = *p_v; real dp, dp0, source; p_vapor += MIN(0.195*C_R(c,t)*C_K(c,t), 5.0*p_vapor); dp = p_vapor - ABS_P(p[c], op_pres); dp0 = MAX(0.1, ABS(dp)); source = sqrt(2.0/3.0*rhoL[c])*dp0; if(dp > 0.0) *m_dot = c_evap*rhoV[c]*source; else *m_dot = -c_con*rhoL[c]*source; } |
Hooking a Cavitation Rate UDF to
ANSYS FLUENT
After the UDF that you have defined using DEFINE_CAVITATION_RATE is interpreted (Chapter 4) or compiled (Chapter 5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., c_rate) will become visible and selectable in the User-Defined Function Hooks dialog box in ANSYS FLUENT. See Section 6.3.1 for details.