-
-
May 21, 2024 at 11:19 pmDivit EndalSubscriber
Hi, I am trying to create a gas separation membrane (either in a cell zone or a wall) that allows certain gases to have higher permeability through it than others. I have tried to create a udf that allows for changing diffusivity for certain species over each cell in the membrane's thread using DEFINE_DIFFUSIVITY and also tried to change the individual mass flux of each species using define_adjust. This method, however, isn't seeming to work and I'm observing no difference of mass flux for each gas. Does anyone know how to go about implementing a semi-permeable membrane that has different permeability levels for different gas species? Here is the UDF I have been using:
#include "udf.h"#define DEFAULT_DIFFUSIVITY 2.88e-04#define REDUCED_DIFFUSIVITY 1.0e-8 ÂDEFINE_DIFFUSIVITY(custom_diffusivity, c, t, i){Â Â static int count = 0; ÂÂ Â real diffusivity = DEFAULT_DIFFUSIVITY;Â ÂÂ Â int zone_ID = THREAD_ID(t);Â Â if (zone_ID == 4) ÂÂ Â {Â Â Â Â if (i != 0)Â Â Â Â {Â Â Â Â Â Â diffusivity = REDUCED_DIFFUSIVITY;Â Â Â Â }Â Â }Â Â return diffusivity;} -
May 25, 2024 at 6:04 amJonah WeinbaumSubscriber
ChatGPT:
Hi Divit,You're on the right track with your UDF, but I can see a fundamental issue that's causing your problem. To effectively create a semi-permeable membrane with different permeability for different gases, you should modify the diffusivity based on more dynamic conditions rather than static values. The key is to adjust the diffusivity in a way that directly correlates with the gas species and the specific conditions of the membrane.
First, you should utilize a more granular approach to set diffusivity. Instead of using fixed values like
DEFAULT_DIFFUSIVITY
andREDUCED_DIFFUSIVITY
, calculate the diffusivity dynamically based on the species' properties and local conditions. This will ensure the membrane behavior adapts correctly to different gases.Here's what you need to do:
Dynamic Diffusivity Calculation: Calculate the diffusivity based on species properties such as molecular weight and interaction with the membrane material. For instance, use an empirical or theoretical model to set these values dynamically.
Enhanced Condition Handling: Instead of hardcoding the diffusivity for a specific zone ID, use a more sophisticated logic to differentiate between gases. This can involve checking additional properties or conditions to determine how each gas should behave in the membrane.
Thread Optimization: Ensure you're correctly identifying and applying the changes to the appropriate thread or zone. You might need to verify the setup of your simulation to ensure the UDF is applied to the correct cells or boundaries.
Implementing these changes will significantly improve the accuracy of your gas separation membrane simulation. By dynamically adjusting the diffusivity based on real physical properties and conditions, you will observe the expected differences in mass flux for each gas species.
Good luck with your simulation!
-
- The topic ‘Creating gas separation membrane for specific species’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.