|
[Sponsors] |
October 21, 2019, 12:58 |
Conditional IF statement errors in CEL
|
#1 |
New Member
Join Date: Oct 2019
Posts: 2
Rep Power: 0 |
I am using ANSYS Windmodeller for ANSYS CFX 18.0. This uses .pre files written in CEL to set up the physics.
I am making modifications to a .pre file as below: original working .pre file: Code:
LIBRARY: CEL: EXPRESSIONS: DX = exp(-0.5* (3.5*(RXdir-RD)/WDH) ^2) [kg m^-3 s^-1]) Code:
LIBRARY: CEL: EXPRESSIONS: DX = exp(-0.5* (3.5*(RXdir-RD)/WDH) ^2) [kg m^-3 s^-1]) if( x>0, DX = DX, DX = 0 ) ERROR – CCL parser failed with message: Invalid parameter name “if(x>0, DX” : contains invalid character ‘(‘ the same '(' are used in other parts of the .pre file so I am unsure of what is causing the problem |
|
October 21, 2019, 18:20 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
You are not using the if statement correctly. Try this:
temp = exp(-0.5* (3.5*(RXdir-RD)/WDH) ^2) [kg m^-3 s^-1]) DX = if( x>0, temp, 0 )
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
October 23, 2019, 06:51 |
|
#3 |
New Member
Join Date: Oct 2019
Posts: 2
Rep Power: 0 |
Thank you very much for the input, it works. Unsurprisingly the answer was right in front of me in the docs - I just misinterpreted it
|
|
Tags |
cel expression, conditional if statement |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
Stuck in a Rut- interDyMFoam! | xoitx | OpenFOAM Running, Solving & CFD | 14 | March 25, 2016 08:09 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 03:20 |
Help for the small implementation in turbulence model | shipman | OpenFOAM Programming & Development | 25 | March 19, 2014 11:08 |