欢迎来到天天文库
浏览记录
ID:27708968
大小:1.30 MB
页数:19页
时间:2018-12-04
《ansys 12.0 cfx 官方教程 11a》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、Chapter11CFXExpressionLanguage(CEL)IntroductiontoCFXCEL-CFXExpressionLanguageAllowstheusertocreateequations(canbefunctionsofsolution/systemvariables)thatcanbeusedinCFX-PreandCFD-PostExample:CELThesyntaxrulesarethesameasthoseforconventionalarithmetic.Operatorsarewrittenas:+(addition)-(sub
2、traction)*(multiplication)/(division)^(exponentiation)Variablesandexpressionsarecasesensitive(example:tvs.T)Expressionsmustbedimensionallyconsistentforadditionandsubtractionoperations(example:1.0[mm]+0.45[yds]isOK)YoucannotaddvalueswithinconsistentdimensionsFractionalanddecimalpowersareallo
3、wed(example:a^(1/2)+1.0^0.5)Unitsofexpressionsarenotdeclared–theyaretheresultofunitsintheexpression(example:a[kgm^-3]*b[ms^-1]hasunitsof[kgm^-2s^-1]SomeconstantsarealsoavailableinCELforuseinexpressions:eConstant:2.7182818gAccelerationduetogravity:9.806[ms^-2]piConstant:3.1415927RUniversalGa
4、sConstant:8314.5[m^2s^-2K^-1]CELRulesNumericalfunctionsandoperatorsarealsoavailableinCELRight-clickwhencreatingexpressionsforacompletelistCustomfunctionswithUserFortrancanalsobecreatedFunctionOperand’sDimensions[x]Operand’sValuesResult’sDimensionssin(x)AngleAnyDimensionlesscos(x)AngleAnyDim
5、ensionlesstan(x)***AngleAnyDimensionlessasin(x)Dimensionless-1£x£1Angleacos(x)Dimensionless-1£x£1Angleatan(x)DimensionlessAnyAngleexp(x)DimensionlessAnyDimensionlessloge(x)Dimensionless06、*AnyAnyAny(res1andres2musthavethesamedimensions)min(x,y)****AnyAny[x]max(x,y)****AnyAny[x]step(x)*DimensionlessAnyDimensionless*iffunctionscontainatest,andtworesultoutcomes.Thefirstoutcome,res1willbereturnediftestevaluatestotrue.Iftestevaluatestofalse,res2isreturned.Considerthefollowingexam7、ple,wherewewishtosetvolumefractionto1whenXisgreaterthan1[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
6、*AnyAnyAny(res1andres2musthavethesamedimensions)min(x,y)****AnyAny[x]max(x,y)****AnyAny[x]step(x)*DimensionlessAnyDimensionless*iffunctionscontainatest,andtworesultoutcomes.Thefirstoutcome,res1willbereturnediftestevaluatestotrue.Iftestevaluatestofalse,res2isreturned.Considerthefollowingexam
7、ple,wherewewishtosetvolumefractionto1whenXisgreaterthan1[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
此文档下载收益归作者所有