-
-
May 11, 2023 at 4:34 pm
Anthony Bowers
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
- /forum/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
Forum ModeratorThe 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
Anthony Bowers
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
Forum ModeratorThanks 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.Â
-
- The topic ‘Volume Fraction Gradient’ 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
- I am doing a corona simulation. But particles are not spreading.
- Guidance needed for Conjugate Heat Transfer Analysis for a 3s3p Li-ion Battery
- Centrifugal Fan Analysis for Determination of Characteristic Curve
- 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
-
3882
-
1414
-
1241
-
1118
-
1015
© 2025 Copyright ANSYS, Inc. All rights reserved.