Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

how to modify the diffusive flux through udf or expr to species eq

    • Shyam Prasad V Atri
      Subscriber

      Hello

      I would like to modify this term

      i would like to add this term to the equation -vec(c)Y into this equation please tell me how can this be achieved

    • Rob
      Forum Moderator

      You've only really got access to the diffusivity, so it's not overly simple. What is the extra term for?

    • Shyam Prasad V Atri
      Subscriber

      the extra term is to account for a separate drift velocity of the field (vec(c)). i thought of adding it as source term but the source term is adding or removing species right. Can we do it that way? if so can you please suggest how?

    • Rob
      Forum Moderator

      Won't convection of the flow handle that? 

    • Shyam Prasad V Atri
      Subscriber

      convection only has fluid velocity field. I have another field acting in the domain. 

    • Rob
      Forum Moderator

      If you're thinking of species drift and separation then you're breaking the species model mixture assumption. The multiphase models allow for phase specific forces but don't have diffusion. There's nothing stopping you having a species volume fraction linked source term. 

    • Shyam Prasad V Atri
      Subscriber

      no so the extra drift velocity is acting on all species. I am adding the body force term in the momentum equation to account for that.

    • Shyam Prasad V Atri
      Subscriber

      so i am able to make the source term work. but the drift velocity and inlet velocity is different (but the values are correct). and my simulations are diverging I don't know why and how to fix it if inlet velocity is 0.1m/s my drift velocity is 3m/s if the difference is so steep. How can I prevent divergence? I would appreciate any input.

    • Rob
      Forum Moderator

      If you're accelerating mass so that it's faster than the inflow, what fills the empty space? 

    • Shyam Prasad V Atri
      Subscriber

      i have inlet velocity condition. and i was running it in transient mode. it still diverged. so I am trying to run it in steady state using UDS instead of species model. 

    • Rob
      Forum Moderator

      If you set pressure on both ends of the model and a zero pressure drop how does your code perform? What happens to the flow? 

    • Shyam Prasad V Atri
      Subscriber

      so currently i have inlet velocity and pressure outlet.

      you are saying make both as pressure outlet is it?

      i cant do that because uds had a value of 1 at the inlet and it flows into the domain. But even if I tried to give that I get reverse flow and I get same results as what I was getting when I have velocity inlet. Anyway I fixed the divergence problem but now there is another problem where the value of uds is going above 1. I give inlet value as 1 and as the uds is solved its value becomes more than 1. why would this happen? and how to fix it

    • Rob
      Forum Moderator

      The idea was to see how the UDF was pulling the flow - ie what is it doing to the flow without an assist from the inlet. Good to know it's working. 

      Re the scalar value, if the value on the inlet is 1, what happens as the scalar is pushed into adjacent cells? Species has a cap on volume fraction, there aren't as many checks on scalars as they for doing "stuff" with. 

    • Shyam Prasad V Atri
      Subscriber

      so as the scalar moves to adjacent cells the mass flux udf acts on it and the convective velocity is modified. so suppose I want to limit the value of the species where should I do it? I am using this Solution method : Pressure velocity coupling : scheme : Simple . based on this when I look at the documentation I see this is the solution sequence 

      Now based on this can you please tell me at which point in the flow chart the uds is solved. I will put a check to limit the uds to not exceed 1 at that point. Can you please tell me which udf should I use to limit the value of uds?

    • Shyam Prasad V Atri
      Subscriber

      Hey i found a way to limit the uds to a value of 1 by using execute in end. But that is not complete solution. I have two almost identical udf but one of them causes the numerical instability the other also does but it stops at 1.1.

      the uds gets accumulated around the wall in the inflation region. like this 

      how to fix this issue? please let me know

    • Rob
      Forum Moderator

      Replot with node values off. I'd expect some diffusion but also have no idea how long the model has been running, how the flow is and what your UDF is doing. 

    • Shyam Prasad V Atri
      Subscriber

      no that is not the problem.

      So I have the adjust function where I am taking a gradient of potential and computing electric field

      I want to store the value of the gradient in the faces. To do that, I do this.

      If I put the value of the computed gradient in the face, I get the solution above.

      if I comment out line 83-94 I see a correct result

       

      Is there any better way of doing this? There is still one or two cells where the high number occors. The simulations are converged and the velocity field is correct

      Any suggestions would be helpful

       
    • Shyam Prasad V Atri
      Subscriber

      Solutions are converged

    • Rob
      Forum Moderator

      Check the cell sizes - are you adding a value per cell or per m^3 in the near wall cell? 

    • Shyam Prasad V Atri
      Subscriber

      its added per cell.

      will adding per m^3 help?

      if so how would you recommend doing it?

      i don't want the final answer to be in per cell.

      and one more q

      in this do you think and condition is better or using a or condition is better in the if statement?

       

       

    • Rob
      Forum Moderator

      I'm not commenting on code. The query about cell or m3 was whether you were adding the scalar at the same rate into the same space. 

    • Shyam Prasad V Atri
      Subscriber

      i dont understand what statement and what it has to do with volume?

      I am controlling the rate of addition of scalar based on drift velocity. It is computed to every cell in the mass flux udf.

      are you suggesting I compute velocity per unit volume? i am not sure what is the meaning of this statement "The query about cell or m3 was whether you were adding the scalar at the same rate into the same space. "

       

    • Rob
      Forum Moderator

      I don't know what you are adding where, I am giving general pointers to remain within the Forum rules for staff. Source terms add a "value" into a cell, and depending on your maths you may, or may not, account for cell volume when doing this.

      If you are adding based on velocity is that speed, u, v or w component or something else? How does it account for zero velocity and recirculation zones? 

Viewing 22 reply threads
  • You must be logged in to reply to this topic.