-
-
May 11, 2023 at 4:34 pm
AnthonyB08
SubscriberHi all,
I need some advice/assistance in evaluating a drift flux, see image below.
I am able to extract the velocities and VOF, but I am struggling to extract the gradient of the VOF. I have done some research on this topic and have found the following
Source I have read regarding this task :
- https://www.cfd-online.com/Forums/fluent-udf/240253-gradient-volume-fraction-c_vof_g.html
- https://forum.ansys.com/forums/topic/fluent-udf-command-c_vof_g-causing-error-crash/
- https://www.cfd-online.com/Forums/fluent-udf/196046-problems-acces-vof-gradients-source-udf.html
- https://www.cfd-online.com/Forums/fluent-udf/218643-how-get-data-mass-fraction-udf-2.html
Based on my research, prior to resorting to this forum, I experimented with two methods. The first method was directly taken from a forum post with some editing to fit my simulation while the second method was given to me by a friend who used Ansys back in 2018-2019.
Method 1. Use Define Adjust, Define Demand, and UDS to calculate, store, and describe the gradient of VOF
Method 2. Loop through all cells to extract the gradient after the first iteration. For this method solve/set/expert freed memory was set to yes but it returned a warning that this is not compatible with parallel simulation. So I attempted to re-start fluent with 0 processors in the parallel tab, but it auto-reverted to 1.
The first method is returning an error and the second is returning a zero gradient value. I have read the section on gradients and reconstructed gradients in the ANSYS UDF manual, but it was no help in developing the code If I am being honest.
-
May 12, 2023 at 12:08 pm
Rob
Ansys EmployeeThe Fluent solver is entirely parallel now, but with 1 core set it's sort of serial. Most of the issues with parallel and UDFs are linked to double counting cells on the partitions rather than causing a failure in the code.
There's a note somewhere about retaining data, /solve/set/advanced/retain-temporary-solver-mem You may need that for the gradients.
-
May 12, 2023 at 1:15 pm
AnthonyB08
SubscriberHi Rob,
I apologize, I was wrong in saying that the ANSYS UDF manual was no help. I eventually figured out my problem. I will snap shot the code below for other users with similar interests. Also, /solve/set/advanced/retain-temporary-solver-mem only works in serial, as this as well gives me a warning saying this is not compatible with parallel simulation.
Step 1. Copy and paste ANSY UDF manual code (section 3.2.12.6)
Step 2. Enable UDS with UDM of 1
Step 3. Turn off the UDS equation in the control
Step 4. Extract UDS value and take the gradient of the UDS (see below)
-
-
May 12, 2023 at 1:38 pm
Rob
Ansys EmployeeThanks for posting a solution.
Just to clarify, the warning re not retaining data in parallel is linked to adapted meshes in parallel. So, if the mesh hasn't been adapted it ought to work.
-
- 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
-
3275
-
2449
-
1308
-
956
© 2023 Copyright ANSYS, Inc. All rights reserved.