Sunteți pe pagina 1din 10

26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

curiosityFluids

CFD,CFDFROMSCRATCH,OPENFOAM

NumericalSolutionoftheCompressibleLaminar
BoundaryLayerEquations
JUNE10,2016|CURIOSITYFLUIDSADMIN1|LEAVEACOMMENT
InthispostIgooverthenumericalsolutiontothecompressibleboundarylayerequations.Thisisveryuseful
whenaquickestimateofshearstress,wallheatflux,orboundarylayerheightifnecessary.

Thesectionsofthispostare:

1.Introduction
2.Compressibilitytransformation
3.Usingthegeneralparabolicform
4.NumericalsolutionusingCrankNicolson
5.ResultsandcomparisontoOpenFOAM
6.Conclusions

Introduction

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 1/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

Foracompressibleflow,theboundarylayerequationsare:

(Continuity)

(Momentum)

(Energy)

Since(ingeneral)weareonlyconcernedwiththesteadystateboundarylayertheseequationsreduceto:

(Continuity)

(Momentum)

(Energy)

These equations are a parabolic partial differential equation. Essentially what this means for us (the person
tryingtosolveit)isthattheboundarylayerequationsareaninitialvalueproblem.Soifweknowtheinitial
boundary layer profile (for example on a flat plate) then the solution can be achieved by marching forward
alongthewallboundary.Thisiswhatwewilldohere.

Inthispostintendtosolvetheaboveequationsallowingforflowwithpressuregradient,heattransfer,and
compressibility.

CompressibilityTransformation

Because of the complicated nature of the above equations, it is common practice to use a compressibility
transformation. In general, compressibility transformations refer to a change of variables that allow the
compressible flow equations to be solved using the same numerical methods and approaches as the
incompressible boundary layer equations. In particular these transformation typically correct for the fact that
densityisnowavariablethatisdirectlycoupletothepressureandtemperaturefieldsthroughtheequationof
state,andthetemperaturedependenceofviscosity.

HerewewillusetheLevyLeescoordinatetransformation.Thischangeofvariablesis:

(Forthedirectiontangentialtothewall)

(Forthedirectionnormaltothewall)

Additionallywedefinesomenewdependentvariables:

Ascaledvelocityparameter:

Ascaledtotalenthalpyparameter:

TheChapmanRubesonconstant:

ThePrandtlnumber:
https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 2/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

Adimensionlesspressuregradientparameter:

When these variables and the transformations are applied to the boundary layer equations the following
equationsresult:

Continuity:

Momentum:

Energy:

In the above equations the primes () denote a derivative in the direction, and the subscript denote a
derivativeinthetransformedstreamwise( )direction.

TheseequationscanbefoundintheEXCELLENTtextbookonboundarylayeranalysisfromSchetz.Youcan
findthedetailsofthetextbookinthereferencessectionofthispost.

UsingtheGeneralParabolicForm

Thetransformedequationsabovearenonlinearandquiteannoyingtosolve.However,thereisasimpletrick
thatcanbeperformedthatmakesnumericalsolutionmucheasier.

ThegeneralparabolicPDEfortwoindependentvariablesis:

Itobviousfrominspectionthatournewcontinuity,momentumandenergyequationsARENOTinthegeneral
parabolicform.However,wecanmakeanapproximationbylumpingsomeofthetermsintothecoefficientsof
thetermsofthegeneralparabolicequations.

Soforexamplethemomentumequationbecomes:

Where:

Similarlyfortheenergyequation:

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 3/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

Where:

We now have two equations written in the general parabolic form which can be easily solved numerically
(explainedinthenextsection).Supplementingthesetwoequationsisthecontinuityequationwhichcansimply
beintegratedateachstreamwiselocation:

We now have 3 equations that can be solved for the 3 unknowns: F, G, and V. The boundary conditions for
theseequationsare:

, , , and

SolutionoftheEquationsusingCrankNicolson

Theequationsabovearenowinaformthatcanbesolvedinmanydifferentwaysdependingonyourpreferred
flavorofPDEsolution.InthispostIamgoingtousemypreferredmethodforthisproblemwhichistheCrank
Nicolsonmethod.

Recallthatinfacttheboundarylayerproblemisaninitialvalueproblem.Tosolvethiswestartataknown
stationontheboundaryandmarchthesolutiondownstream.Thiscanbedoneexplicitly,orimplicitly. When
wesolveexplicitly,thismeansthatallofthederivativesandcoefficientsarecalculatedatthepresentlocation
and used to predict the next step downstream. An implicit solution means that all of the derivatives are
evaluated both at the current step (therefore as knowns) and at the next downstream step (therefore remain
unknowns).Thiscreatesamatrixwhichmustthenbesolved.Themethodwewillusehere(CrankNicolson)is
animplicitmethod.

Additionally, we are going to use an uncoupled approach. This means that the momentum, energy and
continuityequationsaresolvedinseries,notsimultaneously.Inacoupledapproachtheseequationsaresolved
simultaneouslyinonelargesolutionateachstep.

Sincethemomentumandenergyequationsareintheidenticalparabolicform,Iwilljustdoageneralprooffor
thesolutionprocedureusingadummyvariable, .

Recallthatthegeneralparabolicequationis:

Now,theCrankNicolsonalgorithmisasfollows.Givenanequationoftheform(usingourvariableshere):

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 4/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

Thesolutionisobtainedby:

Indexn,referstothestreamwiselocation,andindexireferstothenormallocation.Thisisdemonstratedinthe
figurebelow.

Intheequation,allderivativesarecalculatedusingfinitedifferenceapproximations.Nowwewillapplythisto
ourgeneralparabolicPDE.Tostart,werearrangetheequationtoputthestreamwisederivativeontheLHSof
theequation:

Insertthe2ndordercentraldifferenceapproximationsforfirstandsecondnormalderivatives,anduseCrank
Nicolsonforthestreamwisederivative.

Nextweplacealloftheknowns(indexn)ontheRHS,andalloftheunkowns(indexn+1)ontheLHS,and
collectliketerms.Thisyields:

The above equation creates a tridiagonal matrix that is solved at each step. Notice that in order to solve the
equations this way we do not apply the CrankNicolson algorithm to the coefficients A, C, or D. This is
becauseitwouldcreateanonlinearmatrixsolution.Becauseofthis,thepresentapproachisinfactonlysemi
implicit.
https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 5/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

Afigureshowingtheconstructionofthetridiagonalmatrixformedfromthisequationisshownbelow:

SolutionAlgorithm

NowthatweunderstandtheCrankNicolsonmethodandhowitcanbeusedtoformulateatridiagonalmatrix
wecanformulateoursolutionalgorithm.ForsimplicityIhavemappedoutthealgorithminthefigurebelow:

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 6/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

AsIsaidbefore,thisalgorithmisasegregated(oruncoupled),semiimplicitsolutiontotheboundarylayer
equations.

Ishouldpointoutthatthealgorithmshowninthefigureabovecaneasilybeimprovedupon.Forinstance,the
coefficients A thru D can be evaluated as an average between the current step at the next step. This is an
applicationofthetrapezoidalruleandthesolutionthenbecomesiterative.Intheseiterationsaswell,onecan
easily add an update step to account for changing thermophysical properties such as viscosity, thermal
conductivityandspecificheatsthatdependonthesolution!

All of these improvements are in fact included in the code used for comparison in the next section. This is
because we are comparing the solver to a simulation in rhoCentralFOAM that also accounts for changing
thermophysicalproperties.

ResultsandComparisontorhoCentralFoam

Asatestcase,wearegoingtosolvealaminarboundarylayerbehindanobliqueshockonaflat..Iamnotgoing
togointoverymuchdetailfortheobliqueshockcasesetupsinceitissosimple,andIhavedoneonevery
similarhere(https://curiosityfluids.wordpress.com/2016/03/28/mach15flowover23degreewedge
https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 7/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

rhocentralfoam/).

Aschematicofthesimulationisshownhere:

Fig:SimulationSetup

Theabovesimulationsetupisaverysimplewayachieveanobliqueshocksolution.Theboundaryconditions
forthissimulationwere:

P=101Pa,T=298K,U=[650.391,236.723,0](ApproximatelyMach2)
Walltemperaturewas:Tw=283.15
Withaplatelength(L)of0.1mthesepropertiescorrespondtoafreestreamReynoldsnumberof4452.
Sutherlandslawwasusedforviscosity
NASAJanafpolynomialswereusedforspecificheatcapacityandenthalpy

Heresavideoofthesimulationresult:

Fig:Simulationvideo(20degree,Mach2,ObliqueShock)

Now to use our compressible boundary layer solver we must recognize that the external properties of the
boundarylayerwillbethepostshockconditions.Sothiscanbecalculatedeitherusingtheknownoblique
shockrelations,orbyextractingthemfromtheOpenFOAMsimulation(Ididthelatter).

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 8/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

TocomparethesolutionsIextractedthewallheatflux,andthewallshearstressfromthesimulation.Thisis
doneusingtheOpenFOAMutilitieswallHeatFlux,andwallShearStress.

Fig:PredictedWallHeatFluxComparison

Fig:PredictedShearStressComparison

Wecanseethatoursolutionisprettygood!Boththeshearstressandthewallheatfluxrunrightontopofeach
other!Obviouslyforthisproblemthesolveroutlinedinthispostisadequate.

Conclusions

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 9/10
26/4/2017 Numerical Solution of the Compressible Laminar Boundary Layer Equations | curiosityFluids

InthispostIoutlinedhowonecanwriteanumericalsolverforthecompressiblelaminarboundarylayer
equations.IthencomparedittoasolutionachievedusingOpenFOAMscompressibleflowsolver
rhoCentralFOAMandachievedverycloseresults.

PleaseletmeknowifImadeanymistakes!Therewerealotofequationstotranscribefrommynotebookso
ImsureImessedsomeup.

IfyouwantmoredetailforsomepartsIwillgladlyaddtothispostuponrequest!Iskippedoversomestepsto
keepthelengthofthispostdown.ForinstanceIdidntshowhowthealgorithmchangeswhenusingaveraged
coefficients.

SomeUsefulReferences

[1]Schetz,J.andBowersox,R.(2011).Boundarylayeranalysis.Reston,VA:AmericanInstituteofAeronautics
andAstronautics.

BOUNDARYLAYERANALYSIS BOUNDARYLAYEREQUATIONS NUMERICAL


SOLUTIONTOBOUNDARYLAYER RHOCENTRALFOAM WALLHEATFLUX WALL
SHEARSTRESS WALLHEATFLUX WALLSHEARSTRESS

https://curiosityfluids.com/2016/06/10/numerical-solution-of-the-compressible-laminar-boundary-layer-equations/ 10/10

S-ar putea să vă placă și