CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Error in expression unit (https://www.cfd-online.com/Forums/cfx/149776-error-expression-unit.html)

banu March 8, 2015 08:05

Error in expression unit
 
Hi,
To create velocity profile at inlet I have used the following expression

15[m/s]*(z/0.3)^(1/7)
where 15 is my reference velocity, 0.3 is my reference height and 0.143 is power law exponent and z is height at any point in z direction

after plotting I am getting the exact values which I require but with invalid units.
the error is as follows:

Expression resolves to invalid units ('m^0.143 s^-1') in value set for parameter 'Normal Speed' in object '/FLOW:Flow Analysis 1/DOMAIN:Domain 1/BOUNDARY:inlet/BOUNDARY CONDITIONS/MASS AND MOMENTUM'. Expected units: 'm s^-1'.

I am unable to resolve this error. Please shed some light as to what needs to be added or rectified.

CCl for reference:

# State file created: 2015/03/08 17:16:04
# CFX-14.5 build 2012.09.19-21.47

FLOW: Flow Analysis 1
DOMAIN: Domain 1
BOUNDARY: inlet
Boundary Type = INLET
Location = INLET
BOUNDARY CONDITIONS:
FLOW REGIME:
Option = Subsonic
END
MASS AND MOMENTUM:
Normal Speed = 15[m/s]*(z/0.3)^(1/7)
Option = Normal Speed
END
TURBULENCE:
Option = Medium Intensity and Eddy Viscosity Ratio
END
END
END
END
END
COMMAND FILE:
Version = 14.5
END

ghorrocks March 8, 2015 17:21

You just cancel out the length dimension before you do the exponent:

15[m/s]*(z/0.3[m])^(1/7)

This happened because you forgot that your reference length has the units of length (presumably metres). If you included the dimension in your expression it works fine.

banu March 10, 2015 05:16

Hello,
Thank you for responding to my query. I tried the correction you suggested and the expression works fine.

However in solver I am getting an error because of the expression. The error is as follows:

PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE |
| |
| The CFX expression language was evaluating: |
| Normal Speed |
| |
| The problem was: |
| INVALID-EXPONENTIATION |
| |
| FURTHER INFORMATION |
| |
| The problem was encountered in executing the expression for: |
| $SCALAR_0 |
| The complete expression is: |
| 15[m/s]*(z/0.3[m])^0.143 |
| The error occurs on sub-expression: |
| (z/0.3[m])^0.143 |
| |
| BACKGROUND INFORMATION |
| |
| The error was detected at one location. The same problem may be |
| present at other locations - that has not been investigated. |
| The following values are for the first location which has the |
| problem. |
| |
| In this expression, these sub-expressions have been calculated: |
| |
| Sub-expression = Value |
| |
| 15[m/s] = 15.0000 |
| These values were set before reaching the current expression: |
| |
| Name = Expression = Value |
| |
| z = $LOCAL_z = -6.245005E-17 |
| |
| END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE

I am unable to interpret what exactly is wrong in the subexpression.

Lance March 10, 2015 05:24

when z is negative the result of your expression (z/0.3[m])^0.143 becomes imaginary, which CFX cannot handle. If you only have positive Z values in your domain I would add an abs() to z.

banu March 11, 2015 04:25

Hello,

Thank you for explaining about the reasoning behind the error. I tried the expression by including abs(z) and now i am not getting any errors in solver.

Thanks and Regards

Banu:)

Bdew8556 July 14, 2016 05:37

Hey guys,

I had a similar error:

ERROR PROBLEM ENCOUNTERED WHEN EXECUTING CFX EXPRESSION LANGUAGE The CFX expression language was evaluating: Input from CFX-5 The problem was: INVALID-EXPONENTIATION FURTHER INFORMATION The problem was encountered in executing the expression for: HSOut The complete expression is: HIn+cpRef*tIn*((pOut/pIn)^((gamma-1)/gamma)-1) The error occurs on sub-expression: (pOut/pIn)^((gamma-1)/gamma) BACKGROUND INFORMATION In this expression, these sub-expressions have been calculated: Sub-expression = Value cpRef*tIn = 165221. These values were set before reaching the current expression: Name = Expression = Value tIn = massFlowAveAbs(Temperature)= 164.497 pOut = 1 [atm] + massFlowAveAbs(Pr= -50895.4 pIn = 1 [atm] + massFlowAveAbs(Pr= 117734. gamma = 1.40000 cpRef = massFlowAveAbs(Specific Hea= 1004.40 HIn = massFlowAveAbs(Static Entha= -134241. END OF DIAGNOSTIC OUTPUT FOR CFX EXPRESSION LANGUAGE

Any thoughts?

Brett


All times are GMT -4. The time now is 22:36.