CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Question about expression in CFX-post(need help!) (http://www.cfd-online.com/Forums/cfx/110154-question-about-expression-cfx-post-need-help.html)

Anna Tian December 4, 2012 18:36

Question about expression in CFX-post(need help!)
 
2 Attachment(s)
Hi,

I defined some expressions in CFX-pre. After running the simulation, I open the result file(.res file) in CFX post, then press the button 'Apply'(like 'figure1' in the attachment) , an error message window jumps out.('figure2' in the attachment).

I look for the solution of this error in the tutorial, but do not find any helpful answer. I try to define some new expressions , but always have this error message no matter how do I change the unit.

May I ask how to solve this problem? How to write correct expression in CFX-post? Is the CFX-Post expression language different from CfX-Pre?

Thank you very much!

cdegroot December 4, 2012 19:15

What is the expression giving the error? It seems pretty clear there is a problem with units. It's saying you are trying to subtract a dimensionless quantity from a quantity with units of metres. It can't be the expression posted in your first image that is giving the error.

Anna Tian December 4, 2012 19:43

Quote:

Originally Posted by cdegroot (Post 395797)
What is the expression giving the error? It seems pretty clear there is a problem with units. It's saying you are trying to subtract a dimensionless quantity from a quantity with units of metres. It can't be the expression posted in your first image that is giving the error.


Another question

why

'if( -10 [m]< z && z <10 [m], Pressure, 0 [pa] )' gives error message

'ERROR: Error in 'if' statement at position 1. The 'true' and 'false' expressions have inconsistent dimensions.'?

Their units are [pa].

cdegroot December 4, 2012 21:22

The correct syntax for CEL if statements is:

if( cond_expr, true_expr, false_expr )

where:
cond_expr: is the logical expression used as the conditional test
true_expr: is the mathematical expression used to determine the result if the conditional test is true.
false_expr : is the mathematical expression used to determine the result if the conditional test is false.

I think the problem is that Pressure is a variable so it probably doesn't know where to evaluate it at. Just saying Pressure probably returns multiple values whereas 0 [Pa] is just one value.

cdegroot December 4, 2012 21:31

Actually the inconsistent dimensions may be referring to units. It could be confused if you put [pa] instead of [Pa].


All times are GMT -4. The time now is 09:27.