Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Solving custom transport equations

    • James
      Subscriber

      Hello!

      I am looking to solve the following transport equation:

      it's a fluid phase mass balance used in packed beds. Anyway, since I will be defining a custom source term, I suppose fluent would use the transport equation for the UDS, in that case I noticed that having a custom UDS unlocks the "UDS diffusivity" option in the materials tab, but it's units are kg/ms, however, the units of the diffusion coefficient in my transport term are m2/s. How do I define a proper diffusivity coefficient in my case?

      Moreover, I have a porous zone in my model and I need to change its density for \rho_p in my transport equation, is that possible?

      Thank you for the help!

    • James
      Subscriber

       

      Okay so from what I found out, since fluent solves density*diffusion, the units (kg/m3 * m2/s) result in kg/ms. So I suppose when you are defining diffusivity in the “materials” tab, you multiply your diffusivity with the fluid density.

      My concern remains with the source term, will fluent automatically multiply density of the fluid or do I have to multiply is manually.

       

    • Rob
      Forum Moderator

      Scalars don't have a density value as it's not a species/phase/real. So you need to (generally) divide the diffusivity in the model by the fluid density. 

      The source term is whatever you want to add. For fluid mass you're adding some kg/m3/s but for a scalar it's a little different. 

      • James
        Subscriber

        Hello Rob,

        My apologies as this is an "old" thread now. I am still quite confused. Perhaps I should add more information. The units of C is mg/L, so while defining the boundary condition for C, I used the value of "specified value" that is in mg/L. So if that's the case, when fluent multiplies the fluid density, the dimension of the unsteady term, for example, will be kgmg/Lsm3. The convective term I suppose will follow, and so in this case I should supply the value of diffusivity in kg/ms right?

         

    • Rob
      Forum Moderator

      Diffusivity is what you add as a material property, and having used scalars with water we've found you need to divide a liquid diffusivity by density to get a good match for scalars. At the boundaries you're adding a value, but I can't see units specified anywhere. In the cell zones kg/m3/s are added, but I understand that's the amount per kg (in the cell) / m3 (cell volume) /s   

       

      • James
        Subscriber

        Very well, thank you.

        I have an additional question. I have a UDF that must be solved in conjunction with the UDS transport equation. The dq/dt is found using the scalar itself. So if I use the C_UDSI to calculate the value of dq/dt, will it work? 

    • Rob
      Forum Moderator

      Please can you rephrase that? I'm not quite sure what you're asking. 

      • James
        Subscriber

         

         

        The term dq/dt is a function of the scalar, so it’s basically a coupled PDE. So can I use C_UDSI macro in the function to input the value of the scalar? I am asking because in the past I tried this and I would get a segmentation error. I suppose it was because the scalar was not yet defined and I accessing it’s value (through C_UDSI macro). And therefore, since the value of the scalar wouldn’t be calculated in the current time step, would it still work or give me a segmentation error? I am sorry, this maybe a stupid question

         

         

    • Rob
      Forum Moderator

      What you may need to do is run a time step and then add the UDF. Some of the macros can also be called for a previous step which may be useful. 

Viewing 5 reply threads
  • The topic ‘Solving custom transport equations’ is closed to new replies.