Fluent-UDF-14.5-L04-UDS

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

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

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

资源描述

©2012ANSYS,Inc.June17,20131Release14.514.5ReleaseChapter4UserDefinedMemoriesandScalarsUserDefinedFunctionsinANSYSFluent©2012ANSYS,Inc.June17,20132Release14.5UserDefinedMemorySometimesitisusefultodefineextrafieldvariablestostoreandretrievevaluesdefinedbytheuser.UserDefinedMemories(UDMs)aredefinedin:Define→UserDefined→UserDefinedMemory•Upto500UDMscanbeusedtostoreandretrieveuservalues.•Theycanbeplottedincontoursandaresavedinthedatafile.•ThesevaluesarenotchangedbyFluent,onlyinaUDFwith:•C_UDMI(c,ct,i)=my_cell_value;•F_UDMI(f,ft,i)=my_face_value;(Onlyonboundaryfaces)©2012ANSYS,Inc.June17,20133Release14.5PostProcessingwithUDMsThisADJUSTUDFsetsaUDMtothemagnitudeofthespatialgradientvectorofaUDSsothatcontoursandotherpost-processingcanbedoneonthegradient.#includeudf.hDEFINE_ADJUST(set_uds0_gradient_magnitude,domain){Thread*ct;cell_tc;intindex;index=0;/*CoulddoaloopoverN_UDS,thenumberofUDSs*//*oroverN_UDM,thenumberofUDMsdefined.*/thread_loop_c(ct,domain){begin_c_loop(c,ct){/*Thegradientvectorofmanycalculatedvaluescanbegot*//*byadding_Gtothestandardvariablename:C_T_G(c,ct)*/C_UDMI(c,ct,index)=NV_MAG(C_UDSI_G(c,ct,index));}end_c_loop(c,ct)}}©2012ANSYS,Inc.June17,20134Release14.54User-DefinedScalarsFLUENTcansolvethetransportequationsfortheNUserDefinedScalars(UDS)governedbythegenericPDEs:•ThemenuisaccessedthroughDefineModelsUser-DefinedScalars…•UserspecifiesnumberofUser-DefinedScalarsandUDFcanbeusedforpartsofscalartransportequation:Advectiveflux:DEFINE_UDS_FLUXforthenon-defaultdefinitionUnsteadyterm:DEFINE_UDS_UNSTEADYDiffusivity:DEFINE_DIFFUSIVITY©2012ANSYS,Inc.June17,20135Release14.5User-DefinedScalarsEachscalarcanbesettoonlybecalculatedinfluidzones,solidzones,allzonesorjustselectedzones.EachscalarcanhaveadifferentFluxFunctionsetting.©2012ANSYS,Inc.June17,20136Release14.5UserDefinedScalarsWhenaUDSisdefined,thediffusivityofthescalarmustbedefinedinthematerialpropertypanelforeachmaterial:Define→MaterialProperty•Thedefaultdiffusivityforallscalarsis1.0•ThisconstantcanbechangedtoadifferentvalueormodifiedusingaDEFINE_DIFFUSIVITYUDF©2012ANSYS,Inc.June17,20137Release14.5UserDefinedScalarsBoundaryconditionsforthescalarscanbedefinedusing:Define→BoundaryConditions→....OptionsforspecifyingaconstantvalueorfluxoruseofaUDFProfileforeither.©2012ANSYS,Inc.June17,20138Release14.5UserDefinedScalarsTheSourcetermsforthescalarsaresetusingthestandardDEFINE_SOURCEmacrointroducedbefore.Theothertermsinthetransportequationcanbecustomizedusing:−TheFluxtermcanbemodifiedusing:DEFINE_UDS_FLUX•Thismacroreturnsthedotproductofthefluxvectorandthefaceareavectorofeachfaceofacell−TheUnsteadytermissetusing:DEFINE_UDS_UNSTEADY•SeetheUDSworkshopfortheunsteadyUDSfunction

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

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

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

×
保存成功