simple CEL expression debuging
Hi
I'd like to define a position dependent variable by: ' length = 0.0033 [m] heat transfer coefficient = 0.1-x*(0.1-0.07)/length [m s^-1] ' . But the error message is ' Units ([m s^-1]) are associated with a term that is not dimensionless. ' It is quite strange because the unit of 'x' is [m], right? I'm really confused. Could anyone help? |
The error message is quite clear. You assigne dthe variable "length" units of [m], but then try to re-assign it units [m s^-1] in the next line. You need to fix this by putting the units against the constants in both equations, do not put units against variables.
|
Quote:
If it's written in this way: ' length = 0.0033 [m] ratio = x/length [] heat transfer coefficient = 0.1-(0.1-0.07)/ratio [m s^-1] ' , then the error message will be ' Error at position 10. Units ([]) are associated with a term that is not dimensionless. ' . |
:)
You cannot just assign x/length (which is dimensionless) a dimension. Instead multiply it by 1[m/s] to convert it to a velocity. But then you will have to make the 0.1 a velocity as adding a dimensionless number with a velocity is not meaningful either. And finally you appear to be setting a variable which looks like a heat transfer coefficient with a velocity and that does not make sense either. It's late. I'm going to bed. |
Quote:
If it's written in this way: ' length = 0.0033 [m] ratio = x/length [] heat transfer coefficient = 0.1-x*(0.1-0.07)/ratio [m s^-1] ' , then the error message will be ' Error at position 10. Units ([]) are associated with a term that is not dimensionless. ' Btw, sorry that it does not mean heat transfer coefficient. It is wall function transfer coefficient. I just name it as 'heat transfer coefficient'. You can ignore the name 'heat transfer coefficient'. |
All times are GMT -4. The time now is 22:30. |