-
-
February 26, 2021 at 7:41 pm
vedama
SubscriberHello,nI have created an expression using the Named Expressions feature and I would like to adapt the grid based off this expression. Let's say my expression p=AdaptionSpaceGradient(StaticPressure)*.01 and I would like to adapt the top 10% of cells that correspond to this expression, similar to what we do with Adapt-Cell Registers-Field Variables.nHowever, when I export this expression into the adapt dialog box, I getnExpected type is Bool, Expression type is Double.nI understand what this means but is there a way to go about adapting the expression based on the top 10% as mentioned earlier? Or has anyone been able to find a workaround for defining Named Expressions as Bools without using IF? Any help would be much appreciated.nnThanksn -
February 26, 2021 at 7:56 pm
YasserSelima
SubscriberFirst, add this expressionnIF( p>0 , TRUE, FALSE) let's call it boolean_pnThen select boolean_p for adaption expression and check the number of cells marked for refinement.Now you need a trial and error process ... replace zero in the expression with a number and check how many cells are marked for Adaption .. repeat the process until you have 10% of the original number of cellsn n -
February 26, 2021 at 8:16 pm
vedama
SubscriberFirst, add this expressionIF( p>0 , TRUE, FALSE) let's call it boolean_pThen select boolean_p for adaption expression and check the number of cells marked for refinement. Now you need a trial and error process ... replace zero in the expression with a number and check how many cells are marked for Adaption .. repeat the process until you have 10% of the original number of cells/forum/discussion/comment/108396#Comment_108396
Sorry I don't understand, but what are TRUE and FALSE? If I enter that expression as is, I get:nNameError: name 'TRUE' is not definednI understand your logic but I'm unsure as to how TRUE and FALSE would apply in my case. I also would like to have this as a dynamic process so I can do multiple iterations of adaption by taking 10% every time. But that's a question for once I just get past this first hurdle.n -
February 26, 2021 at 9:29 pm
YasserSelima
Subscriberreplace true and false with 1 and 0 ... let\s seen -
February 26, 2021 at 9:30 pm
YasserSelima
SubscriberI am not sure how you can select the top 10% by another expression. sorryn
-
Viewing 4 reply threads
- The topic ‘Fluent Adaptation with Named Expressions’ is closed to new replies.
Innovation Space
Trending discussions
Top Contributors
-
6765
-
1906
-
1485
-
1330
-
1097
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.