Fluids

Fluids

Using IF statements in material property expression function

    • rh19536
      Subscriber

      Hi, I want to put an IF statement in my viscosity parameter for material. I want the viscosity to be 10000 when static temp (I defined static_t = statictemperature in expression section of tree) is less than 320 kelvin and if it is more than 320 kelvin it should use my expression function for Viscosity defined in the expression section of the tree. However when I implement this statement I get the error seen in screen snip below. But I have seen in Ansys documentation that the units do not have to be the same. Any advice on this error would be appreciated.

    • Rob
      Ansys Employee
      You need to assign units to all of the values, so 320 [K], 10000 [kg/m/s], viscosity [kg/m/s] Expressions differ from UDFs in that the units aren't assigned until you add them; UDFs assume everything is in SI and you can't not use SI units.
    • rh19536
      Subscriber
      Yep I ended up doing that and it solved my problem . Thank you very much

    • DrAmine
      Ansys Employee
      :)
Viewing 3 reply threads
  • You must be logged in to reply to this topic.