Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Creating gas separation membrane for specific species

    • Divit Endal
      Subscriber

      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;
      }
    • Jonah Weinbaum
      Subscriber

      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 and REDUCED_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:

      1. 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.

      2. 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.

      3. 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!

Viewing 1 reply thread
  • The topic ‘Creating gas separation membrane for specific species’ is closed to new replies.