Sei sulla pagina 1di 5

3/1/2015

FLUENT6.3User'sGuide7.24.2ExampleofaUserDefinedFan

7.24.2ExampleofaUserDefinedFan
Usageoftheuserdefinedfanmodelisbestdemonstratedbyanexample.Withthisinmind,considerthedomainshowninFigure7.24.1.Aninletsuppliesairat10
m/stoacylindricalregion,1.25mlongand0.2mindiameter,surroundedbyasymmetryboundary.Atthecenteroftheflowdomainisacircularfan.Apressure
outletboundaryisatthedownstreamend.

Figure7.24.1:TheInlet,Fan,andPressureOutletZonesforaCircular
FanOperatinginaCylindricalDomain
SolvingthisproblemwiththeuserdefinedfanmodelwillcauseFLUENTtoperiodicallywriteoutaradialprofilefilewiththecurrentsolutionvariablesatthefan
face.Thesevariables(staticpressure,pressurejump,axial,radial,andswirling(tangential)velocitycomponents)willrepresentaveragedquantitiesoverannular
sectionsofthefan.Thesizesoftheannularregionsaredeterminedbythesizeofthefanandthenumberofradialpointstobeusedintheprofiles.
Oncetheprofilefileiswritten,FLUENTwillinvokeanexecutable,whichwillperformthefollowingtasks:
1.Readtheprofilefilecontainingthecurrentflowconditionsatthefan.
2.Performacalculationtocomputenewvaluesforthepressurejump,radialvelocity,andswirlvelocityforthefan.
3.Writeanewprofilefilethatcontainstheresultsofthesecalculations.
FLUENTwillthenreadthenewprofilefileandcontinuewiththecalculation.

SettingtheUserDefinedFanParameters
SpecificationoftheparametersfortheuserdefinedfanbeginsintheUserDefinedFanModelpanel(Figure7.24.2).
Define

UserDefined

FanModel...

Figure7.24.2:TheUser
DefinedFanModelPanel
Inthispanel,youcanselectthefanzone(s)onwhichyourexecutablewilloperateunderFanZones.Inthisexample,thereisonlyonefan,fan8.Ifyouhave
http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node294.htm

1/5

3/1/2015

FLUENT6.3User'sGuide7.24.2ExampleofaUserDefinedFan

multiplefanzonesinasimulation,forwhichyouhavedifferentprofilespecifications,youcanselectthemallatthispoint.Yourexecutablewillbeableto
differentiatebetweenthefanzonesbecausethezoneIDforeachfanisincludedinthesolutionprofilefile.Theexecutablewillbeinvokedonceforeachzone,and
separateprofilefileswillbewrittenforeach.
Theexecutablefilewillbecalledontoupdatetheprofilefileperiodically,basedontheinputfortheIterationUpdateInterval.Aninputof10,asshowninthe
panel,meansthatthefanexecutableinthisexamplewillactevery10iterationstomodifytheprofilefile.
ThenumberofpointsintheprofilefiletobewrittenbyFLUENTisenteredunderOutputProfilePoints.Thisprofilefilecanhavethesameoradifferentnumber
ofpointsastheonethatiswrittenbytheexternalexecutable.
Finally,thenameoftheexecutableshouldbeenteredunderExternalCommandName.Inthecurrentexample,thenameoftheexecutableisfantest.
Iftheexecutableisnotlocatedinyourworkingdirectory,thenyoumusttypethecompletepathtotheexecutable.

SampleUserDefinedFanProgram
TheexecutablefilewillbebuiltfromtheFortranprogram,fantest.f,whichisshownbelow.Youcanobtainacopyofthissubroutineandthetwothatitcalls(to
readandwriteprofilefiles)bycontactingyourFluenttechnicalsupportengineer.
c
cThisprogramisinvokedatintervalsbyFLUENTto
creadaprofileformatfilethatcontainsradially
caverageddataatafanface,computenewpressurejump
candswirlvelocitycomponents,andwriteanewprofile
cfilethatwillsubsequentlybereadbyFLUENTto
cupdatethefanconditions.
c
cUsage:fantest<input_profile>output_profile
c
integernpmax
parameter(npmax=900)
integerinp!input:numberofprofilepoints
integeriptype!input:profiletype(0=radial,1=point)
realir(npmax)!input:radialpositions
realip(npmax)!input:pressure
realidp(npmax)!input:pressurejump
realiva(npmax)!input:axialvelocity
realivr(npmax)!input:radialvelocity
realivt(npmax)!input:tangentialvelocity
character*80zoneid
integerrfanprof!functiontoreadaprofilefile
integerstatus
c
status=rfanprof(npmax,zoneid,iptype,
$inp,ir,ip,idp,iva,ivr,ivt)
if(status.ne.0)then
write(*,*)'errorreadinginputprofilefile'
else
do10i=1,inp
idp(i)=200.010.0*iva(i)
ivt(i)=20.0*ir(i)
ivr(i)=0.0
10continue
callwfanprof(6,zoneid,iptype,inp,ir,idp,ivr,ivt)
endif
stop
end

Afterthevariabledeclarations,whichhavecommentsontheright,thesubroutinerfanprofiscalledtoreadtheprofilefile,andpassthecurrentvaluesoftherelevant
variables(asdefinedinthedeclarationlist)tofantest.Aloopisdoneonthenumberofpointsintheprofiletocomputenewvaluesfor:
Thepressurejumpacrossthefan,idp,whichinthisexampleisafunctionoftheaxialvelocity,iva.
Theswirlingortangentialvelocity,ivt,whichinthisexampleisproportionaltotheradialposition,ir.
Theradialvelocity,ivr,whichinthisexampleissettozero.
Aftertheloop,anewprofileiswrittenbythesubroutinewfanprof,shownbelow.(Formoreinformationonprofilefileformats,seeSection7.26.2.)
subroutinewfanprof(unit,zoneid,ptype,n,r,dp,vr,vt)
c
cwritesaFLUENTprofilefileforinputbythe
cuserfanmodel
c
integerunit!outputunitnumber
character*80zoneid
integerptype!profiletype(0=radial,1=point)
integern!numberofpoints
realr(n)!radialposition
realdp(n)!pressurejump
realvr(n)!radialvelocity

http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node294.htm

2/5

3/1/2015

FLUENT6.3User'sGuide7.24.2ExampleofaUserDefinedFan

realvt(n)!tangentialvelocity
character*6typenam
if(ptype.eq.0)then
typenam='radial'
else
typenam='point'
endif
write(unit,*)'((',zoneid(1:index(zoneid,'\0')1),'',
$typenam,n,')'
write(unit,*)'(r'
write(unit,100)r
write(unit,*)')'
write(unit,*)'(pressurejump'
write(unit,100)dp
write(unit,*)')'
write(unit,*)'(radialvelocity'
write(unit,100)vr
write(unit,*)')'
write(unit,*)'(tangentialvelocity'
write(unit,100)vt
write(unit,*)')'
100format(5(e15.8,1x))
return
end

Thissubroutinewillwriteaprofilefileineitherradialorpointformat,basedonyourinputfortheintegerptype.(SeeSection7.26formoredetailsonthetypesof
profilefilesthatareavailable.)Thenamesthatyouuseforthevariousprofilesarearbitrary.Onceyouhaveinitializedtheprofilefiles,thenamesyouusein
wfanprofwillappearasprofilenamesintheFanpanel.

InitializingtheFlowFieldandProfileFiles
Thenextstepinthesetupoftheuserdefinedfanistoinitialize(create)theprofilefilesthatwillbeused.Todothis,firstinitializetheflowfieldwiththeSolution
Initializationpanel(usingthevelocityinletconditions,forexample),andthentypethecommand(updateuserfans)intheconsolewindow.(Theparenthesesare
partofthecommand,andmustbetypedin.)
Thiswillcreatetheprofilenamesthataregiveninthesubroutinewfanprof.

SelectingtheProfiles
Oncetheprofilenameshavebeenestablished,youwillneedtovisittheFanpanel(Figure7.24.3)tocompletetheproblemsetup.(SeeSection7.20forgeneral
informationonusingtheFanpanel.)

Figure7.24.3:TheFanPanel
Atthistime,theFanAxis,FanOrigin,andFanHubRadiuscanbeentered,alongwiththechoiceofprofilesforthecalculationofpressurejump,tangential
velocity,andradialvelocity.Withtheprofileoptionsenabled,youcanselectthenamesoftheprofilesfromthedropdownlists.Inthepanelabove,theselected
http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node294.htm

3/5

3/1/2015

FLUENT6.3User'sGuide7.24.2ExampleofaUserDefinedFan

profilesarenamedfan8pressurejump,fan8tangentialvelocity,andfan8radialvelocity,correspondingtothenamesthatwereusedinthesubroutine
wfanprof.

PerformingtheCalculation
Thesolutionisnowreadytorun.Asitbeginstoconverge,thereportintheconsolewindowshowsthattheprofilefilesarebeingwrittenandreadevery10
iterations:
itercontinuityxvelocityyvelocityzvelocityk
!1residualnormalizationfactorschanged(continuity
11.0000e+001.0000e+001.0000e+001.0000e+001.0000e+00
!2residualnormalizationfactorschanged(continuity
21.0000e+001.0000e+001.0000e+001.0000e+009.4933e01
36.8870e017.2663e017.3802e017.5822e016.1033e01
......
......
......
92.1779e019.8139e023.0497e012.9609e012.8612e01
Writing"fan8out.prof"...
Done.
Reading"fan8in.prof"...
Readingprofilefile...
10"fan8"radialprofilepoints,r,pressurejump,
radialvelocity,tangentialvelocity.
Done.
101.7612e017.4618e022.5194e012.4538e012.4569e01
111.6895e018.3699e022.0316e012.0280e012.1169e01
......
......

Thefilefan8out.profiswrittenoutbyFLUENTandreadbytheexecutablefantest.Itcontainsvaluesforpressure,pressurejump,axialvelocity,radialvelocity,
andtangentialvelocityat20radiallocationsatthesiteofthefan.Thefilefan8in.profisgeneratedbyfantestandcontainsupdatedvaluesforpressurejumpand
radialandtangentialvelocityonly.Itisthereforeasmallerfilethanfan8out.prof.Theprefixforthesefilestakesitsnamefromthefanzonewithwhichthe
profilesareassociated.Anexampleoftheprofilefilefan8in.profisshownbelow.Thisrepresentsthelastprofilefiletobewrittenbyfantestduringthe
convergencehistory.
((fan8radial10)
(r
0.24295786E010.33130988E010.41966137E010.50801374E010.59636571E01
0.68471842E010.77307090E010.86142287E010.94963484E010.95353782E01
)
(pressurejump
0.10182057E+030.98394081E+020.97748657E+020.97787750E+020.97905228E+02
0.98020668E+020.98138817E+020.98264198E+020.98469681E+020.98478783E+02
)
(radialvelocity
0.00000000E+000.00000000E+000.00000000E+000.00000000E+000.00000000E+00
0.00000000E+000.00000000E+000.00000000E+000.00000000E+000.00000000E+00
)
(tangentialvelocity
0.48591572E+000.66261977E+000.83932275E+000.10160275E+010.11927314E+01
0.13694369E+010.15461419E+010.17228458E+010.18992697E+010.19070756E+01
)

Results
AplotofthetransversevelocitycomponentsatthesiteofthefanisshowninFigure7.24.4.Asexpected,thereisnoradialcomponent,andthetangential(swirling)
componentincreaseswithradius.

http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node294.htm

4/5

3/1/2015

FLUENT6.3User'sGuide7.24.2ExampleofaUserDefinedFan

Figure7.24.4:TransverseVelocitiesattheSiteoftheFan
Asafinalcheckontheresult,anXYplotofthestaticpressureasafunctionof positionisshown(Figure7.24.5).ThisXYplotismadeonalineat =0.05m,or
atabouthalftheradiusoftheduct.Accordingtotheinputfileshownabove,thepressurejumpatthesiteofthefanshouldbeapproximately97.8Pa/m.Examination
ofthefiguresupportsthisfinding.

Figure7.24.5:StaticPressureJumpAcrosstheFan
Previous:7.24.1StepsforUsing
Up:7.24UserDefinedFanModel
Next:7.25HeatExchangerModels
FluentInc.20060920

http://aerojet.engr.ucdavis.edu/fluenthelp/html/ug/node294.htm

5/5

Potrebbero piacerti anche