Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF for source term only at edge walls

    • zdfrankman
      Subscriber

      I am writing a UDF to have a source term only on the nodes that make up the walls. I was using this previously:

      /******************************************************************
      UDF that adds species source term to duct flow
      *******************************************************************/

      #include "udf.h"

      #define CON .01

      DEFINE_SOURCE(cell_x_source, cell, thread, dS, eqn)
      {
        real source;

      /******************************************************************
      This loop checks if the cell has a near-zero velocity. If it does, it sets the source rate to the species concentration, mimicking a reaction
      *******************************************************************/

        if (C_U(cell,thread) <= .000001)
        {
          source = C_YI(cell,thread, 1);

        }
        else
        {
          source =  0.;
        }

        return source;
      }

       

       

       

      However, the entire cell acts as a source. I would instead like for only the nodes that make up the wall to act as a source. How can I do that?

       

      Thank you!

    • Rob
      Forum Moderator

       

      There’s not a source term for walls, so you will need to add material to the whole cell. I suggest looking at the cell loop options, using a low velocity may cause problems if you have a recirculation zone. You can set a species flux/concentration at the walls, will that do?

       

      • zdfrankman
        Subscriber

        Hello Rob,

         

        A flux or source term will linearly add or subtract a species from the channel. I require a simulation to accurately model the concentration-dependent nature of a wall surface reaction.

         

        Is there a way to perform a wall surface reaction that does not also permit wall surface species diffusion through the wall?

    • Rob
      Forum Moderator

      Where are you setting wall diffusion? 

      • zdfrankman
        Subscriber

        In the code I wrote, the channel walls are unchanged from normal settings, and therefore the Species -> Species Boundary Condition ->O2 and N2 are set to "Zero Diffusive Flux"

    • Rob
      Forum Moderator

      That's to let you disolve material off a wall as needed. 

      • zdfrankman
        Subscriber

        Understood!

         

        Is there any way to prevent species diffusion through the wall during a wall surface reaction?

Viewing 3 reply threads
  • The topic ‘UDF for source term only at edge walls’ is closed to new replies.