Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

If-elseif-else statements within cfd post expression

    • bradenkerr
      Subscriber
      Hello, nI am new to using Fluent and I am looking to create an expression in CFD post that has if-elseif-else structure. I am modeling two cylinders that are parallel in the z-axis direction and I have flow in the x direction. Hence, I have flow over the top and bottom of two cylinders. I want to plot the pressure vs theta around the cylinder, so I was hoping to use the following format but keep getting errors nif ( 0[m] Y>-.1[m], acos(X/.05[m], acos(X/.05[m]))nThis would define theta as positive when its in on the upper half of either cylinder, or negative when its on the bottom. nI want to do this so I can create a chart that has all four lines overlaid and from what I understand all four need the same x axis variable to do that. nAny help is appreciated. n
    • Amine Ben Hadj Ali
      Ansys Employee
      What about using abs function?n
    • bradenkerr
      Subscriber
      Since I would like to chart all four halfs of the cylinders that are visable, using abs would map the bottom half of the upper and the lower half cylinder on the same values. Instead, I would like the bottom half of the top cylinder to be 0 to -90 and the top half of the bottom cylinder to be 0 to 90, hence the need for the or conditional. I realize my original if statement doesn't actually do that, so here is the fixed version, now I just need help figuring out how to properly implement it. n if ( 0[m]
    • Amine Ben Hadj Ali
      Ansys Employee
      If relying on this https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v202/en/cfx_ref/i1346469.html is not working I will then check next week. Try to put the operands in parentheses.n
    • bradenkerr
      Subscriber
      Im a student so unfortunately cant access that page. n
    • Amine Ben Hadj Ali
      Ansys Employee
      You can access the Online Help Just hit F1.n
    • Amine Ben Hadj Ali
      Ansys Employee
      Something like this should work: if ( ((0[m]0.1[m])), Value if TRUE, Value if FALSE)n
Viewing 6 reply threads
  • The topic ‘If-elseif-else statements within cfd post expression’ is closed to new replies.