We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Help with expression

    • Maria Perez
      Subscriber

      I keep getting an error with the following expression for shear stress. I need to get sqrt(x) but only for the positive values (x>0). Can someone please help me? 

    • NickFL
      Subscriber
      There is a couple of things I notice here. Do you see how the ( is italicized before the [ ? That is letting you know it is treating the ( as part of the units. The easiest solution would be to add a * 1 before each of the units. This will multiply you scalar by a unit value of each. The alternative would be to put the units inside the (). I would also double check your order of operations. Do you want (15^3)/2 or do you want 15^1.5? I would assume 15 [m/s] ^ 1.5 to obtain units of pressure.
    • Maria Perez
      Subscriber

      That's not giving me an error, what gives me an error is the sqrt(X) 

      • NickFL
        Subscriber

        The sqrt root is giving you an error because the () are not closed on the function.

        • Maria Perez
          Subscriber

           

           

          It is closed, if I change X for 1[m] it works and gives me Pa as a result which is what I need. So the expression is not the problem. The problem is that the sqrt is taking negative values of X and that’s why it gives me an error. That’s why I specifically asked how to make the expression take only positive values of X. 

           

           

        • NickFL
          Subscriber

          X is based on the geometry. So if you have cells in your domain that have a negative X, then you will have problems. Basically in DesignModeler or SpaceClaim you created the domain with negative values of X. Without going back into these programs and having to remesh, the simple solution would be to scale it by adding whatever the min(X) to your X.

          Example, if you have a domain that has X values that go to -5 [ m ], change the X to ( X + 5 [m] ).

        • Rob
          Forum Moderator

          By Scale, you mean Transform: that'll allow you to shift the domain. I would question linking shear to domain position, but that's for your model. 

        • Maria Perez
          Subscriber

          Gotcha, I will try that. Thank you so much 

Viewing 2 reply threads
  • The topic ‘Help with expression’ is closed to new replies.