-
-
December 12, 2020 at 7:47 am
bradenkerr
SubscriberHello, 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 -
December 12, 2020 at 8:04 am
DrAmine
Ansys EmployeeWhat about using abs function?n -
December 12, 2020 at 8:12 am
bradenkerr
SubscriberSince 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]December 12, 2020 at 12:26 pmDrAmine
Ansys EmployeeIf 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.nDecember 13, 2020 at 3:08 ambradenkerr
SubscriberIm a student so unfortunately cant access that page. nDecember 14, 2020 at 10:07 amDrAmine
Ansys EmployeeYou can access the Online Help Just hit F1.nDecember 14, 2020 at 10:15 amDrAmine
Ansys EmployeeSomething like this should work: if ( ((0[m]0.1[m])), Value if TRUE, Value if FALSE)nViewing 6 reply threads- The topic ‘If-elseif-else statements within cfd post expression’ is closed to new replies.
-
Innovation Space
Trending discussions
Top Contributors
-
5849
-
1906
-
1420
-
1305
-
1021
Top Rated Tags
© 2026 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.