-
-
April 7, 2023 at 11:54 am
jack forster
SubscriberI am simulating flow into a combustion chamber. I am trying to obtain the swirl number at multiple cross sectional planes. I have compiled the UDF source code with no errors but I do not know how to extract the value at a specific plane. Is this done within report definitions?
This is the UDF code I am using:
include "udf.h"
DEFINE_ON_DEMAND(calculate_swirl_number)
{
Domain*d;
Thread *t;
cell_t c;
real rho, mu, U_axial, U_radial, U_circumferential, Swirl_Number;
real angular_momentum = 0.0, axial_momentum = 0.0;
d = Get_Domain(1);
/* Get the density and viscosity of the fluid */
rho = RP_Get_Real("operating-density");
mu = RP_Get_Real("operating-viscosity");
/* Loop over all cells in all threads */
thread_loop_c (t, d)
{
begin_c_loop (c, t)
{
/* Get the axial, radial, and circumferential velocities */
U_axial = C_U(c,t);
U_radial = C_V(c,t);
U_circumferential = C_W(c,t);
/* Calculate the angular momentum and axial momentum */
axial_momentum += rho * U_axial * C_VOLUME(c,t);
angular_momentum += rho * (C_UDMI(c,t,0)) * C_VOLUME(c,t);
}
end_c_loop (c, t)
}
/* Calculate the swirl number */
Swirl_Number = 2 * angular_momentum / (axial_momentum * mu);
/* Print the swirl number to the console */
Message("Swirl Number: %g\n", Swirl_Number);
}Any help would be greatly appreciated.
-
April 11, 2023 at 2:29 pm
Rob
Ansys EmployeeHave you looked in the Contour plots? Under Velocity you'll find axial & tangential velocity. In Mesh you'll find Axial and Radial positions. These are relative to the local cell zone axis (set in the Cell Zone panel(s)). You may want a Custom Field Function. You can then report these using the surface reports and/or plot the contours.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5162
-
3251
-
2443
-
1308
-
956
© 2023 Copyright ANSYS, Inc. All rights reserved.