CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   Finding max value using Field Functions (https://www.cfd-online.com/Forums/star-ccm/251304-finding-max-value-using-field-functions.html)

kev11 August 8, 2023 15:34

Finding max value using Field Functions
 
Hello all,

I am currently trying to refine my mesh using AMR, and I am using field functions as criteria. One of my field functions is dependent on cell length, where cell length is the largest dimension of the cell.

For instance, I have three variables, ${CellLengthAxi}, ${CellLength2D}, & ${CellLength3D}. I want to save my variable ${CellLength} as the max of the three length variables listed above. I tried writing a whole boolean statement, but it isn't working, unfortunately.

Is there a way to save those three length variables in an array, and just call a max function to obtain the max and save that value as ${CellLength} :D. If there is an easy way to do this, let me know! Thanks in advance!!

FliegenderZirkus August 9, 2023 03:22

There are many ways to achieve this, for example you can nest two max functions: max(max(${CellLengthAxi}, ${CellLength2D}),${CellLength3D})


All times are GMT -4. The time now is 08:45.