Fluent-UDF-14.5-L02-Compilation

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

©2012ANSYS,Inc.June17,20131Release14.514.5ReleaseChapter2UDFCompilationandInterpretationUserDefinedFunctionsinANSYSFluent©2012ANSYS,Inc.June17,20132Release14.5HowtouseUDFsUDFsmustbecompiledandlinkedtothemaincodeTherearetwooptions:•Interpreted–TheUDFistranslatedintoassemblycodewhichisexecutedona“line-by-line”basisatruntime–Doesnotneedaseparatecompiler(completelyautomatic)–Slowerexecutionandusesmorememory–OnlybasiclanguageandFLUENTfeaturesimplemented–Restrictedfunctionalityinparallelcases•Compiled–TheUDFfilesarecompiledandlinkedtothemaincode–FullClanguageandallstandardlibraries–AccesstofullFLUENTfunctionset–NeedsacompilerforeveryOStobeusedon©2012ANSYS,Inc.June17,20133Release14.5InterpretedUDFsTheinterpreterdoesnothaveallofthecapabilitiesofthestandardCcompilerInterpretedUDFscannotcontain•declarationsoflocalstructures,unions,pointerstofunctions,andarraysoffunctions•directstructurereferencesCanaccessdatastoredinaFLUENTstructureonlyviaalimitedsetofmacrosUsersarestronglyencouragedtousecompilationforallbutthemostsimpleUDFs©2012ANSYS,Inc.June17,20134Release14.5Define→UserDefined→InterpretedInterpretingtheUDFsClickInterpretDefaultstacksizemightbetoosmallforlargearrayssomayneedincreasingTheassemblylanguagecodewillbedisplayedifnoerrorsarefound.©2012ANSYS,Inc.June17,20135Release14.5CompilingtheUDFsDefine→UserDefined→Function→Compiled•ClickBuild•Thecompilerwillbuildthesharedobjectfiles•Loadthesharedlibrary•OnWindowstorecompileyouwillneedtounloadapreviouslycompiledUDFlibraryusing:–Define→UserDefined→Function→Manage–SelectthelibraryandthenclickUnload©2012ANSYS,Inc.June17,20136Release14.5libudfntx86w-profile.cmakefileuser_nt.udflibudf.dllmakefileuser_nt.udfsrcWindowsTree3d2dlibudfMakefilesrcultramakefileUnixTreew-profile.c3d2dMachinedependent:ultrawin64lnamd64ntx86DirectoryTreeforaCompiledUDFLibrarymakefilelibudf.dllw-profile.clibudf.souser.udfw-profile.clibudf.souser.udfmakefileSymboliclinks,notcopies

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功