CFX用户手册-User Fortran.docx

上传人:lao****ou 文档编号:873179 上传时间:2024-07-05 格式:DOCX 页数:25 大小:71.98KB
下载 相关 举报
CFX用户手册-User Fortran.docx_第1页
第1页 / 共25页
CFX用户手册-User Fortran.docx_第2页
第2页 / 共25页
CFX用户手册-User Fortran.docx_第3页
第3页 / 共25页
CFX用户手册-User Fortran.docx_第4页
第4页 / 共25页
CFX用户手册-User Fortran.docx_第5页
第5页 / 共25页
亲,该文档总共25页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《CFX用户手册-User Fortran.docx》由会员分享,可在线阅读,更多相关《CFX用户手册-User Fortran.docx(25页珍藏版)》请在第一文库网上搜索。

1、UserFortranIntroductionThechapterdiscusses: I:SeTCE1FUnC1iO1SandRc)U1ineS USerJ1mCtionBOXRoUtineS Shared1ibrarieS USCrParamoterS Iti1i1yROU1inCSforUSCrFUnC1iOnS ANSYSCFXMe1norYManaEC【nonISys1cm(MMS) USerCE1EXamP1eS USer血nctionBOXEXan1PIeS USingCFX-4RoUtineSinANSYSCFXToa11owyoutoaddadditiona1features

2、andphysica1mode1stoANSYSCFX,youcanwriteyourownsubroutinesinFortranandhavetheANSYSCFX-So1verca11theseroutinesthroughasourcecodeinterface.Youmaya1sowishtoimp1ementcustomizedphysica1mode1swhichwou1dneverbeavai1ab1einANSYSCFXduetoconfidentia1ityconsiderations.ANSYSCFXsupportsusersubroutineswritteninFort

3、ran77orFortran90.A1istofsupportedcompi1ersforeachp1atformisavai1ab1e.UsingFortran77wheneverpossib1eisrecommended.Twodifferentkindsofuserroutinesareavai1ab1einANSYSCFX:CFX可以利用两种不同的方式应用用户子程序 UserdefinedCE1(CFXExpression1anguage)functionscanbeusedwithinaCE1expression,fo11owingthestandardCE1ru1es.Fordet

4、ai1s,SeeUSerCE1FUnCtionSandRoutines.用户定义CE1(UserdefinedCE1)函数可以在CE1表达式中使用 Junctionboxroutinescanbeusedatsevera1p1acesintheANSYSCFX-So1vertoexecuteusercode.ForCIetaiIs,SeeUSorJUCCtiOnBOXRoutines.Junctionboxroutines可以在ANSYSCFX-So1ver中执行用户代码Thefo11owingtaskscanbeaccomp1ishedwithusersubroutinesinANSYSCF

5、X:通过用户程序可以在CFX中完成以下内容: Inputofuserdata(e.g.,datarequiredforprofi1eboundaryconditionsorexterna11ygeneratedsources). User-specifiedboundaryconditions(e.g.,profi1eboundaryconditions). User-specifiedinitia1conditions(e.g.,externa11ygeneratedf1owfie1ds,randomdistributionordisturbanceofexistingso1utions).

6、 User-specifiedsourceterms(e.g.,externa11ygeneratedbodyforcesorgenera1additiona1sourcetermsusedtoimp1ementnewphysica1mode1s). Junctionboxroutinesca11edeverytimestepwhichactsasagenera1interfacebetweentheANSYSCFX-So1verandothersoftware(e.g.,structuremechaniccodes).Junctionboxesa1soofferaninterfacefora

7、dvancedmonitoringandso1utionoutput. Userpartic1eroutinesareusedtospecifysourcesofmomentum,heatandmasstransfer,andcana1sobeusedtospecifyinjectionregionsforpartic1es.Thestructureofpartic1euserroutinesisthesame.Anexamp1eofthisfunctiona1ityisavai1ab1e.FOrdetai1s,SeeStrUCtUreOfIJSerCE1FUnCtiOns.Fordetai1

8、s,SeePartiCIeUSerSources.Fordetai1s,seeUserDefined.NotethatANSYSCFXinc1udesfeaturessuchasadvancedmonitoringofso1utionvariab1esorg1oba1va1uesandextendedCE1functiona1ity,whichmayreduceyourneedforusersubroutines.Tousejunctionboxroutines,youwi11needtobefami1iarwiththeANSYSCFXMMS(MemoryManagementSystem)t

9、osetupandpassarounduserdataforaccessinanysubroutine.Foid。Iai1s,SCCANSYSCFXMenK)IyVanag。IncnISyStem(MMS).Shared1ibrariesa11owsubroutinestobere-usedwithoutrecompi1ationforsuccessiveANSYSCFX-So1verrunsorevenfordifferentapp1ications.The1ocationofashared1ibraryisspecifiedinANSYSCFX-Pre.Duringexecutionoft

10、heANSYSCFX-So1ver,theusersubroutinesare1oadedfromthespecifiedshared1ibraries.Fordetai1s,seeShared1ibraries.UserCE1FunctionsandRoutinesUserCE1functionsa1IowyoutocreateyourownfunctionsinadditiontothepredefinedCE1functions(e.g.,sin,cos,step,etc.).YoucanthenusethesefunctionsinanyexpressionwhereaCE1funct

11、ioncanbeused.AuserCE1functionpassesanargument1isttoasubroutinethatyouhavewritten,andthenusesthereturnedva1uesfromthesubroutinetosetva1uesforthequantityofinterest.Thefigurebe1owdemonstratestheconcept.UserCE1FuuctiousH11dRoutinesUserCE1fimctnsa11owyoucreateyourownfunebonsvadd-ontotherede6nedCE1funcfao

12、ns(eg,an.co.ftcp.CtC)YoucmIbCnuetbeefuactocuaanyeqcffiCwhereaCE1fuctotCAabeusedAuserCE1func1ionpassesanargumentbetoaubroudnthatyouhavesvntten.andthenusestheEtUmedva1uesfromIherurotjhnetoetveforr斗IafmryOftntwnTnPfigurebe1owdwonff1tP?theconceptA11variab1esthatareavai1ab1eforuseinstandardCE1expressions

13、area1soavai1ab1eforuseinUserCE1Expressions.A1istofthesevariab1esisavai1ab1e.Fordetai1s,SeeVariabieSAVaiiabieforUSeinCE1Expressions.Detai1soncreatinguserCE1functionsinANSYSCFX-Preanddefiningquantitiesviaanexpressionwithanargument1istareavai1ab1e. Fordetai1s,SeeUSerROUtineDetaiISView. FOrdetai1s,SeeUS

14、erFUnCtiOnS.Detai1soncreatingshared1ibrariesandcompi1ingsubroutinesareavai1ab1e.FOrdetai1s,SeeShared1ibraries.Examp1esofusinguserCE1functionsareavai1ab1e.Forde1ai1s,SeeUSerCE1Examp1es.StructureofUserCE1FunctionsAUserFortranfiIemaycontainsevera1userroutinesthatcanbeca11edfromtheANSYSCFX-So1ver,aswe11

15、asanysecondaryroutinesthatareca11edon1yfromotherroutinesinthisfi1e.Inadditiontoanycommentsanddec1arationsthatyoumaywishtoadd,thebasicstructureofauserCE1functionis:ftinc1ude,zcfx5ext.hd11export()SUBROUTINE(&N1OC,NRET,NARG,RET,ARGS,CRES1T,CZ,DZ,IZ,1Z,RZ)CINTEGERN1OC,NARG,NRETCHARACTERCRES1T*(*)REA1RGS(N1OC,NARG),RET(N1OC,NRET)CINTEGERIZ(*)CHARACTERCZ(*)*(1)DOUB1EPRECISIONDZ(*)1OGICA11Z(*)REA1RZ(*)C.executab1estatementsENDThed11export()macroisusedtoensurethataca11ingnameisknownexterna11yonthosep1atformsthatrequireitforsuccessfu1runtime1inking.Themacroisdefinedinaninc1udefi1esoItinc1udecfx5

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 应用文档 > 工作总结

copyright@ 2008-2022 001doc.com网站版权所有   

经营许可证编号:宁ICP备2022001085号

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有,必要时第一文库网拥有上传用户文档的转载和下载权。第一文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第一文库网,我们立即给予删除!



客服