欢迎来到天天文库
浏览记录
ID:27695325
大小:1.44 MB
页数:19页
时间:2018-12-03
《ansys 12cfx 官方教程 11b》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter11CFXExpressionLanguage(CEL)IntroductiontoCFXCEL-CFXExpressionLanguageAllowstheusertocreateequations(canbefunctionsofsolution/systemvariables)thatcanbeusedinCFX-PreandCFD-PostExample:CELThesyntaxrulesarethesameasthoseforconventionalarithmeti
2、c.Operatorsarewrittenas:+(addition)-(subtraction)*(multiplication)/(division)^(exponentiation)Variablesandexpressionsarecasesensitive(example:tvs.T)Expressionsmustbedimensionallyconsistentforadditionandsubtractionoperations(example:1.0[mm]+0.45[yds]is
3、OK)YoucannotaddvalueswithinconsistentdimensionsFractionalanddecimalpowersareallowed(example:a^(1/2)+1.0^0.5)Unitsofexpressionsarenotdeclared–theyaretheresultofunitsintheexpression(example:a[kgm^-3]*b[ms^-1]hasunitsof[kgm^-2s^-1]Someconstantsarealsoava
4、ilableinCELforuseinexpressions:eConstant:2.7182818gAccelerationduetogravity:9.806[ms^-2]piConstant:3.1415927RUniversalGasConstant:8314.5[m^2s^-2K^-1]CELRulesNumericalfunctionsandoperatorsarealsoavailableinCELRight-clickwhencreatingexpressionsforacompl
5、etelistCustomfunctionswithUserFortrancanalsobecreatedFunctionOperand’sDimensions[x]Operand’sValuesResult’sDimensionssin(x)AngleAnyDimensionlesscos(x)AngleAnyDimensionlesstan(x)***AngleAnyDimensionlessasin(x)Dimensionless-1£x£1Angleacos(x)Dimensionless
6、-1£x£1Angleatan(x)DimensionlessAnyAngleexp(x)DimensionlessAnyDimensionlessloge(x)Dimensionless07、(x,y)****AnyAny[x]max(x,y)****AnyAny[x]step(x)*DimensionlessAnyDimensionless*iffunctionscontainatest,andtworesultoutcomes.Thefirstoutcome,res1willbereturnediftestevaluatestotrue.Iftestevaluatestofalse,res2isreturned.Considerthefollowingexample,wherewe8、wishtosetvolumefractionto1whenXisgreaterthan1[m],and0ifXislessthan1[m]:if(x>1[m],1,0)Inthiscase,iftheresultispreciselyequalto1[m],theresultis(res1+res2)/2**step(x)is0fornegativex,1forpositivexand0.5forx=0.***notethattan(x)isundefinedfornp/2whe
7、(x,y)****AnyAny[x]max(x,y)****AnyAny[x]step(x)*DimensionlessAnyDimensionless*iffunctionscontainatest,andtworesultoutcomes.Thefirstoutcome,res1willbereturnediftestevaluatestotrue.Iftestevaluatestofalse,res2isreturned.Considerthefollowingexample,wherewe
8、wishtosetvolumefractionto1whenXisgreaterthan1[m],and0ifXislessthan1[m]:if(x>1[m],1,0)Inthiscase,iftheresultispreciselyequalto1[m],theresultis(res1+res2)/2**step(x)is0fornegativex,1forpositivexand0.5forx=0.***notethattan(x)isundefinedfornp/2whe
此文档下载收益归作者所有