BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:1
3.5. Function Tool Example
Thefollowingexampleshowshowtocreateandapplyaboundaryconditionusinga
functionrepresentation.
Theconvectionheattransfercoefficientfromafluidflowingoveraflatplateisappliedasa
functionboundarycondition,[Link]
figurebelowshowstheflatplatewiththeappliedboundaryconditions.
[Link],wherethe
convectionboundaryconditionisbeingapplied,issplitintotworegimes:
Regime 1isdefinedforXbetween1 X<5,andtheconvectionheattransfercoefficient
isgivenby:
h(x)=0.332*(kxx/x)*Re**(1/2)*Pr**(1/3)
Regime 2isdefinedforXbetween5<X 10,andtheconvectionheattransfer
coefficientisgivenby:
h(x)=0.566*(kxx/x)*Re**(1/2)*Pr**(1/3)
Intheaboveequations,theReynoldsnumberReisgivenby:
Re=(dens*vel*x)/visc
andthePrandtlnumberPRisgivenby:
Pr=(visc*c)/kxx
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:2
Thepropertiesofthefluidovertheflatplateare:
Density(dens)=1,thermalconductivity(kxx)=10,specificheat(c)=10,andviscosity
(visc)=0.01
Thevelocityofthefluid(vel)overtheflatplateisequalto100forRegime1and50for
Regime2.Bulktemperatureforthefluidforbothregimesis100degrees.
1. CreatearectangleandassignelementtypePLANE55,defineyourmaterial
properties,andmesh:
/prep7rect,1,10,,.5et,1,55!DefineFluidPropertiesmp,KXX,1,10!Thermal
conductivitymp,DENS,1,1!Densitymp,C,1,10!Specificheatmp,VISC,1,0.01!
Viscosity!DefinePlatePropertiesmp,kxx,2,10mp,dens,2,10mp,c,2,5mat,2esize,,
25amesh,all
2. Definetheconvectionboundaryconditionasafunction.
SelectUtility Menu> Parameters> Functions> Define/Edittobringupthe
[Link]
function,[Link]
Function Editordialogbox,clickontheradiobuttonforMultivaluedfunction
basedonregimevariableandtypexlocasthenameoftheregimevariableinthe
[Link]
definexloc,selectXfromthedropdownboxonthelowerhalfofthedialog
[Link]:
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:3
3. [Link]
theRegime [Link],youwilldefinetheequationforthefirst
regime,1 X 5.Type1and5intheRegime1Limitstextentryboxes.
4. Forthesakeofconvenience,definethoseexpressionsintheequationsthatyou
willusemorethanonceorthatarepartofaverylongequation,andstorethem
inmemory.
Inthisexample,expressionsfortheReynold'snumberandPrandtlnumberare
[Link]
canbestoredandusedthroughoutthefunctioneditor,inallregimes.
TostoretheReynold'snumber,[Link]
primaryvariablesDENS,X,andVISC(shownin{brackets})fromthedropdown
[Link]
functionssuchas*and/.Yourdialogboxshouldlooklikethis:
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:4
ClickonSTO,thenonM0onthenumberpadtostoretheexpressioninmemory
location0.
TostorethePrandtlnumber,cleartheResultsboxbyclickingtheClearbutton
[Link],SPHT,andKXXfrom
[Link]:
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:5
ClickonSTO,thenonM1onthenumberpadtostoretheexpressioninmemory
location1.
5. Defineanexpressionfortheheat-transfercoefficientforRegime1.
[Link]
[Link]
theprimaryvariables({KXX}and{X})fromthedrop-downlist.ThetermsM0and
[Link],
clickontheINVbutton,andthenRCL,thenM0andM1respectively.
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:6
6. DefinetheequationforRegime2.
[Link],enter10astheupperlimitfortheregime
[Link]
[Link]
[Link]
shownbelow.YoucanusethesamestoredmemorylocationsM0andM1to
replaceexpressionsforReynold'snumberandPrandtlnumber,[Link]
dialogboxshouldlooklikethis:
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:7
7. Optional:Entercommentsforthisfunction.
SelectFile> Comments.
8. Savethefunction.
SelectFile> [Link].
[Link],youcanthenload
itasatableparameterintoANSYS.
9. [Link] Menu> Parameters> Functions> Read
from [Link] Loader
dialogboxappears.
10. Provideatableparameternamethatyouwillusewhenapplyingthefunctionasa
boundarycondition.
Typeheatcfforthisexample.(Theparameternamecannotcontainmorethan
sevencharacters.)Providevaluesforanyvariablesthatyoudefinedinthe
FunctionEditor.
ClickontheRegime 1tabandenter1forthematerialID(toobtainthe
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:8
materialprimaryvariables)andenter100forthevelocity.(TheFunctionTool
promptsyouforthematerialIDonlyifyouhaveusedamaterialpropertyinyour
expression.)Yourdialogboxshouldlooklikethis:
Note:Onlynumericdataissupportedfortheconstantvaluesin
[Link]
notsupportedasconstantvalues.
11. ClickontheRegime 2tabandenter1forthematerialIDandenter50forthe
BasicAnalysisGuide
ContainsproprietaryandconfidentialinformationofANSYS,Inc.
anditssubsidiariesandaffiliates
Page:9
velocity.
NoticethattheOKbuttonisnotactiveuntilallrequiredvariableshavebeen
[Link].
12. [Link]
condition,usethetablenamethatyouassignedearlier.
nsel,s,loc,y,0d,all,temp,25nsel,s,loc,y,0.5sf,all,conv,%heatcf%,100Applythe
functionasaboundaryconditionfinish/solutime,1deltim,.1outres,all,allallsel
solvefinish/post1set,last/psf,conv,hcoe,2,0.e+00,1/replot!showsurfaceload
symbolsfinish
Release14.5-SASIP,[Link].