-
-
May 24, 2024 at 1:37 amZwernjaydenSubscriber
My udf works when I select the planar option, even with an axis BC, but when I select axisymmetric, the heat flux is 10x higher than expected. I only want the heat flux radial direction (y direction), which is maybe why.
#include "udf.h"#include#define rho 950 // kg/m^3#define Hg 2033631 // J/Kg#define Hf -310000 // J/Kg#define T_ref 298 // K#define A1 0.01104 // m/s#define A2 3.9648 // m/s#define Cp 1500 // J/(Kg*K)#define E1 20557.188 // J/mol#define E2 55893.78 // J/mol#define R_u 8.314 // J/(mol*K)#define alpha 0.3DEFINE_PROFILE(surface_temperature_profile, t, position){face_t f;real Ts, heat_flux, heat, a_face, Hv, r, Ts_old, Ts_new, error, Ts_new_prime, Area[ND_ND];int iter;begin_f_loop(f, t){Ts = F_T(f, t); // Current temperature at the faceprintf("Temp of face %d: %g K\n", f, Ts);heat = BOUNDARY_HEAT_FLUX(f, t); // Calculating the heat flux at face f in wattsF_AREA(Area, f, t);a_face = NV_MAG(Area);heat_flux = heat / a_face; // Heat flux in W/m^2printf("Heat flux on face %d: %g W/m^2\n", f, heat_flux);Ts_old = Ts;iter = 0;error = 1;while (error > 1e-6 && iter < 100){Hv = Hg - Hf + Cp * (Ts - T_ref); // Calculation heat of formationr = (fabs(heat_flux)) / (Hv * rho); // Regression rateif (Ts_old > 722){Ts_new = E1 / (R_u * (log(A1) - log(r))); // New surface temperature for high temperature}else{Ts_new = E2 / (R_u * (log(A2) - log(r))); // New surface temperature for low temperature}error = fabs(Ts_new - Ts_old); // Error calculationTs_old = Ts_new; // Update Ts_old for next iterationiter++; // Increment iteration count}Ts_new_prime = Ts + (alpha * (Ts_new - Ts));r = (fabs(heat_flux)) / (Hv * rho);printf("New Temp %d: %g K\n", f, Ts_new_prime);printf("r_dot %d: %g mm/s\n", f, r*1000);F_PROFILE(f, t, position) = Ts_new_prime; // Update the face temperature profile}end_f_loop(f, t)} -
July 29, 2024 at 2:19 pmSRPAnsys Employee
Hi,
In axisymmetric simulations, Fluent automatically accounts for the circumferential integration when calculating fluxes and forces. In an axisymmetric case, the heat flux needs to be interpreted correctly. Fluent handles the circumferential scaling internally, so your calculations need to be adjusted accordingly. Specifically, the heat flux should be divided by 2*pi*r.
Thank you.
-
Viewing 1 reply thread
- The topic ‘UDF works in planar option but not axisymmetric’ is closed to new replies.
Ansys Innovation Space
Trending discussions
- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script error Code: 800a000d
- Cyclone (Stairmand) simulation using RSM
- Fluent fails with Intel MPI protocol on 2 nodes
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
Top Contributors
-
1236
-
543
-
523
-
225
-
209
Top Rated Tags
© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.