CFD9–1DavidApsley9.THECFDPROCESSSPRING20119.1Introduction9.2Thecomputationalmesh9.3Boundaryconditions9.4FlowvisualisationExamples9.1Introduction9.1.1StagesofaCFDAnalysisAcompleteCFDanalysisconsistsof:•pre-processing;•solving;•post-processing.Thiscoursehasfocusedonthe“solving”process,butthisisoflittleusewithoutpre-processingandpost-processingfacilities.CommercialCFDvendorssupplementtheirflowsolverswithgrid-generationandflow-visualisationtools,aswellasgraphicaluserinterfaces(GUIs)tosimplifythesetting-upofaCFDanalysis.Pre-ProcessingThepre-processingstageconsistsof:–determiningtheequationstobesolved;–specifyingtheboundaryconditions;–generatingacomputationalmeshorgrid.Itdependsupon:–thedesiredoutputsofthesimulation(e.g.forcecoefficients,heattransfer,...);–thecapabilitiesofthesolver.SolvingIncommercialCFDpackagesthesolverisoftenoperatedasa“blackbox”.Nevertheless,userinterventionisnecessary–tosetunder-relaxationfactorsandinputparameters,forexample–whilstanunderstandingofdiscretisationmethodsandinternaldatastructuresisrequiredinordertosupplymeshdatainanappropriateformandtoanalyseoutput.Post-ProcessingTherawoutputofthesolverisahugesetofnumberscorrespondingtothevaluesofeachfieldvariable(u,v,w,p,…)ateachpointofthemesh.Thismustbereducedtosomemeaningfulsubsetand/ormanipulatedfurthertoobtainthedesiredpredictivequantities.Forexample,asubsetofsurfacepressuresandcell-faceareasisrequiredtocomputeadragcoefficient.Commercialpackagesroutinelyprovide:–plottingtoolstovisualisetheflow;–analysistoolstoextractandmanipulatedata.CFD9–2DavidApsley9.1.2CommercialCFDThetablebelowlistssomeofthemorepopularcommercialCFDpackages.Developer/distributorCode(s)Webaddress(liabletochange!)CDadapcoSTARCDSTARCCM+(nowownedbyAnsys)FLUENT://://://://://:•cellvertices;•connectivityinformation.Preciselywherethenodesarerelativetotheverticesdependsonwhetherthesolveruses,forexample,cell-centredorcell-vertexstorage.Furthercomplexityisintroducedifastaggeredvelocitygridisemployed.Theshapesofcontrolvolumesdependonthecapabilitiesofthesolver.Structured-gridcodesusequadrilateralsin2-dandhexahedrain3-dflows.Unstructured-gridsolversoftenusetriangles(2-d)ortetrahedra(3-d),butnewercodescanusearbitrarypolyhedra.hexahedrontetrahedroncell-centredstoragecell-vertexstorageupvstaggeredvelocitymeshCFD9–3DavidApsleyInallcasesitisnecessarytospecifyconnectivity:thatis,whichcellsareadjacenttoeachother,andwhichfacetheyshare.Forstructuredgrids,with(i,j,k)numberingthisisstraightforward,butforunstructuredgridsquitecomplicateddatastructuresmustbesetuptostoreconnectivityinformation.9.2.2Areas,VolumesandCell-AveragedDerivatives(****MScOnly****)Incontinuummechanics,conservationlawstaketheform:rateofchange+netflux=sourceTocalculatefluxesrequiresthevectorareasofcellfaces;e.g.Au•=fluxmassTofindthetotalamountofsomepropertyinacellrequiresitsvolume;e.g.ϕ=VamountAreasandvolumesareeasytoevaluateinCartesianmeshes,butgeneral-purposeCFD,whichemploysarbitrarypolyhedralmeshes,requiresmoresophisticatedgeometricaltechniques.AreasTriangles.Thevectorareaofatrianglewithsidevectorss1ands2is2121ssA∧=Theorientationdependsontheorderofvectorsinthecrossproduct.Quadrilaterals4pointsdonot,ingeneral,lieinaplane.However,sincethesumoftheoutwardvectorareasfromanyclosedsurfaceiszero,i.e.0d=⌡⌠∂VAor0=∑facesfAanysurfacespanningthesamesetofpointshasthesamevectorarea.Byaddingvectorareasof,e.g.,triangles123and134,thevectorareaofanysurfacespannedbythesepointsandboundedbythesidevectorsisfound(seeExamples)tobehalfthecrossproductofthediagonals:)()(241321241321rrrrddA-∧-=∧=(Again,theorderofpointsdeterminestheorientationoftheareavector).GeneralpolygonsThevectorareaofanarbitrarypolygonalfacemaybefoundbybreakingitupintotrianglesandsummingtheindividualvectorareas.Again,thevectorareaisindependentofhowitisbrokenup.s1s2AAAr34r1r2rCFD9–4DavidApsleyVolumesIf),,(zyx≡risthepositionvector,then3=∂∂+∂∂+∂∂=•∇zzyyxxr.Hence,integratingoveranarbitrarycontrolvolumeandusingthedivergencetheoremgivesforthevolumeofacell:⌡⌠•=∂VVArd31Ifthecellhasplanefacesthiscanbeevaluatedas∑•=facesffVAr31whererfisanyconvenientpositionvectoronafaceandAfisthefacevectorarea,since,foranyothervectorrinthatface,44344210)(=•-+•=•fffffArrArArThelasttermvanishesbecauser–rfisperpendiculartoAfforanypointonaplaneface.Ifthecellfacesarenotplanar,thenthevolumedependsonhowthesefacesarebrokendownintotriangles.Typicallytheareaofaparticularfacecanberegardedasanassemblageoftriangularelementsconnectingtheverticesofthatfacewithacentralreferencepointformed,e.g.∑=verticesifNrr1Examplesforthecommonestshapesfollow.TetrahedraThevolumeofatetrahedronformedfromsidevectorss1,s2,s3(takeninaright-handedsense)is32161sss∧•