TAGGED: udf
-
-
August 15, 2023 at 2:42 am
Ding HC
SubscriberHello everyone, I have a question regarding the usage of a User-Defined Function (UDF) to define the interphase heat transfer coefficient for the Eulerian model (Two-Fluids Model,TFM) within ANSYS FLUENT. I'm wondering whether the UDF should return the heat transfer coefficient 'h' (measured in W/m²K) directly, or if it should return the product of the heat transfer coefficient 'h' and the interface area 'Ai' (measured in 1/m). Additionally, I have a few minor questions to ask:
I've developed a UDF based on the Ranz-Marshall correlation to compute the interphase heat transfer coefficient between the liquid phase and the interface. However, the computed results differ from those obtained using FLUENT's internal Ranz-Marshall correlation. I'm seeking insights into the potential reasons for this disparity.
Concerning the correlation itself, should the 'Pr' value in the correlation refer to the Prandtl number of the gas phase? I came across this information in the FLUENT Theory Guide, but I'm uncertain about its accuracy.
Here is the UDF code I have written:
include "udf.h"
DEFINE_EXCHANGE_PROPERTY(htc_1, c, mixthread, pi1, pi2)
{
Thread* liqthread, * vapthread;
real Nu, h, h_eff, Re, Pr, vel,d,k,cp,mu,Ai;
real NV_VEC(v);
liqthread = THREAD_SUB_THREAD(mixthread, pi1);
vapthread = THREAD_SUB_THREAD(mixthread, pi2);
d = C_PHASE_DIAMETER(c, vapthread);
k = C_K_L(c, vapthread);
cp = C_CP(c, vapthread);
mu = C_MU_L(c, vapthread);
Pr = (cp * mu) / k;
NV_DD(v, =, C_U(c, liqthread), C_V(c, liqthread), C_W(c, liqthread), -, C_U(c, vapthread), C_V(c, vapthread), C_W(c, vapthread));
vel = NV_MAG(v);
Re = (C_R(c, liqthread) * vel * d) / (C_MU_L(c, liqthread));
Nu = 2.0 + 0.6 * pow(Re, 0.5) * pow(Pr, 1. / 3.);
h = C_K_L(c, liqthread) * Nu / d;
Ai = 6.0 * C_VOF(c, vapthread) / d;
h_eff = h * Ai;
return h_eff;
}Thanks!?
-
August 16, 2023 at 12:01 pm
Atharva Nagarkar
Ansys EmployeeHello,
Please refer to the UDF Manual for detailed explanation on the DEFINE_EXCHANGE_PROPERTY macro. I have attached the link below for your reference. Check section 2.4.3 as well as example 3 (section 2.4.3.5) which is related to your topic. As per the manual, the UDF will need to return the real value of the effective heat transfer coefficient to the solver. So, if the quantity being modeled by your UDF depends on the interfacial area, your UDF should return the coefficient multiplied by the interfacial area.
2.4. Multiphase DEFINE Macros (ansys.com)
As per the Fluent Theory Guide, for the Ranz-Marshall model, the relative Reynolds number is based on the diameter of one phase which is liquid in your case. The Prandtl number is defined for the other phase which must be gas. Please check the section 14.5.17.1.3 of the Theory guide, the link of which is given below.
14.5.17. Description of Heat Transfer (ansys.com)
If you are not able to access the links, please refer to this forum discussion: Using Help with links (ansys.com)
Thanks!
-
August 16, 2023 at 12:34 pm
Ding HC
SubscriberThank you very much!
Let me confirm once again that the User-Defined Function (UDF) needs to provide the actual volumetric heat transfer coefficient in units of W/m²*K. This coefficient should be calculated using the properties of the gas to define the Prandtl number.
This information is mentioned in both the theoretical manual and the UDF manual. However, I've noticed a discrepancy between this information and the heat transfer coefficient UDF example provided in the UDF manual. So, I would like to verify this once again for clarity.
In the example 2.4.3.5 provided in the UDF manual, the returned heat transfer coefficient is multiplied by the interface area density. However, according to the definitions and descriptions given earlier, the expected return value should be the true, unmodified heat transfer coefficient. Does this mean that there is an error in the provided example? Below is a screenshot of the code from the example.
-
-
August 16, 2023 at 12:47 pm
Atharva Nagarkar
Ansys EmployeeHello,
Please check my earlier post for clarification. It says that "The UDF will need to return the real value of the effective heat transfer coefficient to the solver. So, if the quantity being modeled by your UDF depends on the interfacial area, your UDF should return the coefficient multiplied by the interfacial area."
This is why in the example, the returned value is multiplied by the interface area.
Thanks!
-
August 16, 2023 at 1:02 pm
Ding HC
SubscriberThank you for your reply!
This means that in the UDF definition for the phase interaction of heat transfer coefficient, what I need to return is the effective heat transfer coefficient, which is the product of the volumetric heat transfer coefficient and the interface area. Instead of the Single volumetric heat transfer coefficient introduced and mentioned in the manual earlier, right?
-
-
- The topic ‘The UDF of Heat Transfer Coefficient In Two-Fluids Model (Eulerian Model)’ is closed to new replies.
- air flow in and out of computer case
- Varying Bond model parameters to mimic soil particle cohesion/stiction
- Eroded Mass due to Erosion of Soil Particles by Fluids
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- I am doing a corona simulation. But particles are not spreading.
- Issue to compile a UDF in ANSYS Fluent
- JACOBI Convergence Issue in ANSYS AQWA
- affinity not set
- Resuming SAG Mill Simulation with New Particle Batch in Rocky
-
3862
-
1414
-
1231
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.