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 Equation 17–485 in the 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.
DEFINE_CAVITATION_RATE (name, c, t, p, rhoV, rhoL, mafV, p_v, cigma, f_gas, m_dot)
|
Argument Type |
Description |
|---|---|
|
|
UDF name. |
|
|
Cell index. |
|
|
Pointer to the mixture-level thread. |
|
|
Pointer to shared pressure. |
|
|
Pointer to vapor density. |
|
|
Pointer to liquid density. |
|
|
Pointer to vapor mass fraction. |
|
|
Pointer to vaporization pressure. |
|
|
Pointer to liquid surface tension coefficient. |
|
|
Pointer to the prescribed mass fraction of non condensable gases. |
|
|
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.
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;
}
After the UDF that you have defined using DEFINE_CAVITATION_RATE is interpreted (Interpreting UDFs)
or compiled (Compiling UDFs), the name
of the argument that you supplied as the first DEFINE macro argument (for example, c_rate) will
become visible and selectable in the User-Defined Function
Hooks dialog box in ANSYS Fluent. See Hooking DEFINE_CAVITATION_RATE UDFs for details.