资源预览内容
第1页 / 共15页
第2页 / 共15页
第3页 / 共15页
第4页 / 共15页
第5页 / 共15页
第6页 / 共15页
第7页 / 共15页
第8页 / 共15页
第9页 / 共15页
第10页 / 共15页
亲,该文档总共15页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
第十四章14:CFX 表达式语言 (CEL)CFX Expression Language (CEL) is an interpreted, declarative language that has been developed to enable CFX users to enhance their simulations without recourse to writing and linking separate external Fortran routines.You can use CEL expressions anywhere a value is required for input in ANSYS CFX.CEL can be used to: Define material properties that depend on other variables. Specify complex boundary conditions. Add terms to the solved equations.You can also monitor the value of an expression during the solution using monitor points.Important: There is some CEL that works elsewhere in ANSYS CFX, but not in CFD-Post. Any expression created in CFX-Pre and used as a Design Exploration output parameter could potentially cause fatal errors during the Design Exploration run, so you should create all expressions for Design Exploration output parameters in CFD-Post.Values and ExpressionsCEL can be used to generate both values and expressions. Values are dimensional (that is, with units) or dimensionless constants. The simplest type of definition is the dimensionless value, for example:b = 3.743You can also specify a value with units, for example:g = 9.81 m s-2The dimensions of the quantities of interest for CFD calculations can be written in terms of mass, length, time, temperature and angle. The concept of units is fundamental to the behavior of values and expressions.Values can be used directly, or they can be used as part of an expression. For example, you can use an expression to add two values together:=+In this example, you may want to predefineand, but this is not required. However, in order to add two quantities together,they must have the same dimension; that is, it is meaningful to add a quantity in inches to one expressed in meters, but it is not meaningful to add one expressed in kilograms to one in square feet.Expressions can also be functions of other (predefined) expressions:=+Units follow the conventions in the rest of CFX, in that a calculation has a set of solution units (by default, SI units), and that any quantity can be defined either in terms of the solution units, or any other set of units with the correct form.An expression does not have its own units string, but if it references quantities that have dimensions, these will determine the resulting units for the expression. For example, if an expression depends inversely on the square of the xcoordinate, then it hasimplied dimensionsof length to the power -2.1.Using Locators in ExpressionsA CFX simulation has physics areas and mesh areas; physics areas are boundaries while mesh areas are regions. These two types of area can occupy completely different spaces in a simulation; however, there is no requirement that area names be unique between physics and mesh. This can lead to ambiguities when you use these names in expressions.To avoid these ambiguities, ANSYS CFX first checks to see if is a physics name; if this is not found, the name is checked in the list of mesh names. Thus if in1 is both the name of a physics area and the name of a mesh area, is taken to indicate the physics area.ANSYS CFX also has REGION CEL syntax so that you can identify a named area as being a mesh area. Thus to identify the mesh area in1, you would use the syntax:REGION:in1Note that if does not appear as a physics name or a mesh name, the expression fails.CFX Expression Language StatementsThe CFX Expression Language is declarative. You declare the name and definition of the expression using expression language statements. The statements must conform to a predefined syntax that is similar to Fortran mathematical statements and to C statements for logical expressions.The statement must consist of the following: a number, optionally with associated units. This defines aconstant. Constants without units are termeddimensionless. for mathematical expressions, one or more references to mathematical constants, system variables, or existing user variables, separated by+(addition),-(subtraction),*(multiplication),/(division) and(exponentiation), with optional grouping of these by parentheses. The syntax rules for these expressions are the same as those for conventional arithmetic. for logical expressions involving relational operators, one or more references to mathematical constants or results from mathematical expressions, separated by=(is less than or equal to),(is greater than) and=(is greater than or equal to) with optional grouping of these by parentheses. for logical expressions involving logical operators, one or more references to logical constants or results from relational operations separated by!(negation),&(logical AND) and|(logical OR), with optional grouping by parentheses.1.Use of
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号