Tagged: expressions, udf
-
-
September 21, 2022 at 10:56 pm
christopher.t.nemecek
SubscriberI wrote a UDF to return the maximum velocity within 2 inches of a specified surface. To accomplish this, I defined a cell register (boundary) to get all cells within 2 inches of that specified surface. I then used the register to separate out a new cell zone. The UDF loops over all cells within that new cell zone and returns the max velocity and cell centroid of where the max velocity occurs. I separated out the new cell zone for two reasons: 1) to reduce the number of cells to loop through and 2) to limit the cells to the surface of interest (ie, I wanted to exclude all other surfaces/walls other than the one I am interested in). Without separating out the cell zone, I would have had to loop over all cells in the entire domain and all face cells of the surface of interest to determine if the volume cell was within 2 inches.
I believe the above can be accomplished via expressions. However, I believe I can only return the maximum velocity within the cell register and not the location of that velocity using expressions.
Is there a way to accomplish the whole UDF (ie, find max velocity and location within 2 inches of desired surface) using expressions? Is there a better was to accomplish this via UDF? Is there a function that will calculate the distance between a face zone ID and cell or does that have to be programmed manually as described above (ie, looping over all cells and face cells)?
-
September 22, 2022 at 9:54 am
Rob
Ansys EmployeeMaximum something can be found in a cell zone with expressions, registers aren't available (yet). There is a cell-wall distance, but I suggest using it with care as it's also going to look for all of the walls.
Currently (2022R2) splitting the zone and reporting value via UDF is probably best if you also want the position.
-
- You must be logged in to reply to this topic.

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 in cfd post
-
2616
-
2098
-
1321
-
1108
-
461
© 2023 Copyright ANSYS, Inc. All rights reserved.