ETSEIAT&UPC*
Motoglider*CFD*Study*
Airfoil*and*aircraft*analysis*
!
Josep&Mª&Carbonell&Oyonarte&&&Oriol&Chandre&Vila&
24/11/2015&
!
!
!
! !
!
! 1!
LIST*OF*CONTENTS*
1.! INTRODUCTION* 3!
2.! AIRFOIL*ANALYSIS* 4!
2.1.! Aim&of&the&analysis& 4!
2.2.! Script& 4!
2.3.! Results&and&verification& 5!
2.4.! Conclusions& 8!
3.! AIRPLANE*STUDY* 9!
3.1.! Aim&of&the&study& 9!
3.2.! Modifications&on&the&tutorial& 9!
3.3.! Geometry&and&mesh& 21!
3.4.! Results&and&Comparison& 22!
3.5.! Conclusions& 25!
4.! BIBLIOGRAPHY* 26!
*
LIST*OF*FIGURES*
Figure!1.!Own-written!script!for!automation!process!..................................................................!4!
Figure!2.!Pressure!distribution!at!3º!............................................................................................!5!
Figure!3.!Velocity!distribution!at!3º!.............................................................................................!5!
Figure!4.!Graph!provided!by!J.!Robertson!....................................................................................!6!
Figure!5.!Cl!vs.!AoA!graph!obtained!with!CFD!analysis!.................................................................!6!
Figure!6.!Cm!vs.!AoA!graph!obtained!with!CFD!analysis!..............................................................!6!
Figure!7.!Cl!vs.!Cd!graph!obtained!with!CFD!analysis!...................................................................!7!
Figure!8.!Cl!vs.!Cd!graph!provided!by!J.!Robertson!......................................................................!7!
Figure!9.!k!definition!..................................................................................................................!10!
Figure!10.!nut!definition!.............................................................................................................!11!
Figure!11.!ω!definition!...............................................................................................................!12!
! 2!
Figure!12.!p!definition!................................................................................................................!13!
Figure!13.!U!definition!................................................................................................................!14!
Figure!14.!ControlDict!dictionary!...............................................................................................!15!
Figure!15.!SnappyHexMeshDict!dictionary!(Part!1)!....................................................................!16!
Figure!16.!SnappyHexMeshDict!dictionary!(Part!2)!....................................................................!17!
Figure!17.!SnappyHexMeshDict!dictionary!(Part!3)!....................................................................!18!
Figure!18.!ForceCoeffs!file!..........................................................................................................!19!
Figure!19.!Boundary!file!.............................................................................................................!20!
Figure!20.!STL!file!format!motoglider!.........................................................................................!21!
Figure!21.!SnappyHexMesh!with!the!STL!file!inside.!..................................................................!21!
Figure!22.!Pressure!distribution!which!is!seen!from!a!3D!view!..................................................!22!
Figure!23.!Pressure!distribution!which!is!seen!from!the!top!view!.............................................!22!
Figure!24.!Pressure!distribution!which!is!seen!from!bottom!view!.............................................!23!
Figure!25.!Velocity!distribution!which!is!seen!from!a!lateral!view!.............................................!23!
Figure!26.!Pressure!distribution!which!is!seen!from!a!lateral!view!............................................!23!
Figure!27-!Streamlines!over!fuselage!.........................................................................................!24!
Figure!28-!Streamlines!over!the!wing!........................................................................................!24!
! !
! 3!
1.!Introduction*
This!Project!will!be!part!of!the!design!of!a!motoglider!which!is!an!assignment!of!another!
subject.!In!order!to!optimize!the!aerodynamics!of!the!airplane,!we!will!study!the!airfoil!to!use!
and!the!performance!of!the!whole!airplane.!We!chose!the!airfoil!ClarkY!based!on!the!results!
obtained!with!XFLR5!because!it’s!a!good!tool!for!our!conditions!(low!Reynolds!and!low!Mach).!!
! !
! 4!
2.!Airfoil*analysis*
2.1.! Aim*of*the*analysis*
The!process!of!the!simulation!was!based!on!the!Airfoil+study!of!Casacuberta’s!tutorial.!The!
following!modifications!have!been!done:!
The!study!of!the!airfoil!includes!the!process’!automation!to!simulate!a!range!of!angles!of!attack!
to!save!user!time.!Acting!in!this!way,!the!user!only!has!to!introduce!the!range!that!is!expected!
to!analyse.!With!an!own-written!script,!all!the!needed!folders!will!be!created.!
In!addition,!the!results!obtained!will!be!also!studied!and!compared!with!the!available!
experimental!data.!Because!of!the!bad!accuracy!of!the!mesh!due!to!the!low!computing!power!
available,!big!differences!between!CFD!and!experimental!results!are!expected.!
2.2.! Script*
Our!script,!that!can!be!seen!in!Figure!1,!was!based!on!the!one!provided!in!Casacuberta’s!
tutorial.!The!script!is!defined!in!order!to!compute!all!the!processes!that!has!to!be!done!
manually.!Not!only!for!one!angle!of!attack,!but!creating!also!all!the!folders!needed!to!simulate!
a!range!of!angles!of!attack.!First!of!all,!the!conditions!of!the!simulation!were!changed!for!the!
ones!of!the!available!experimental!data.!Moreover,!the!airfoil!is!introduced!as!a!“.dat”!file,!so!
it’s!easy!to!use!this!script!for!different!airfoils.!
The!range!of!AoA!is!created!using!a!while!loop!including!all!the!process,!from!the!creation!of!
the!geometry!to!the!running!of!the!simulation.!With!this!process,!the!user!hasn’t!to!enter!to!
each!folder!to!run!each!AoA.!
Continuing!analysing!the!script,!the!existent!foilgmsh+script!is!used!to!create!the!geometry!
with!different!AoA,!but!without!modifying!it,!because!it!served!perfectly!to!our!needs.!The!only!
consideration!that!must!be!taken!is!that!this!script!names!the!geometry!always!clarky.dat.geo,!
so!it’s!needed!to!change!this!name!every!time!to!differentiate!each!AoA.+Gmsh!Mesh!
Generator!is!used,!so!after!creating!each!simulation!the!command!gmshToFoam!is!also!
needed.!Continuing!analysing!the!script,!the!following!lines!have!the!function!of!proportionate!
the!conditions!of!the!simulation!required.!Finally,!using!foamJob!a!log!of!the!results!of!the!
simulation!is!created,!providing!the!ability!to!assess!the!state!of!it!in!every!moment.!
Figure+1.+Own@written+script+for+automation+process+
! 5!
2.3.! Results*and*verification*
The!results!of!the!simulation!are!presented!below.!CFD!analysis!considered!a!“result”!when!the!
simulation!converges.!
Some!examples!of!the!graphical!results!are!the!following,!one!of!pressure!distribution!(see!
figure!2)!and!another!one!of!velocity!distribution!(figure!3).!Both!are!with!an!AoA!of!3º:!
Besides!of!the!case,!two!animated!gifs!will!be!joint!to!the!report,!where!the!evolution!of!
pressure!and!velocity!distribution!with!the!angle!of!attack!can!be!seen.!
After!every!CFD!simulation!a!verification!process!has!to!be!done.!In!this!case,!the!results!are!
compared!with!the!experimental!data!of!(Christopher!A.!Lyon),!see!figure!4.!
!
!
!
Figure+2.+Pressure+distribution+at+3º+
Figure+3.+Velocity+distribution+at+3º+
! 6!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
Figure+4.+Graph+provided+by+J.+Robertson+
Figure+5.+Cl+vs.+AoA+graph+obtained+with+CFD+analysis+
Figure+6.+Cm+vs.+AoA+graph+obtained+with+CFD+analysis+
! 7!
As!can!be!seen!in!figures!5!and!6,!the!results!for!Cl!are!practically!identical!in!the!linear!region.!
Up!to!7!degrees,!a!slight!error!is!present,!increasing!with!AoA.!Results!in!term!of!Cm!have!an!
increased!error,!where!the!results!of!the!simulation!are!more!linear!than!the!experimental!
ones.!Of!course,!the!comparison!has!been!done!with!the!same!Re!number,!as!early!stated.!!
Finally,!regarding!the!results!of!Cl!vs.!Cd!(see!figure!7!and!compare!it!with!figure!8),!a!greater!
error!is!obtained.!The!reasons!behind!it!are!explained!in!the!conclusions.!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
Figure+7.+Cl+vs.+Cd+graph+obtained+with+CFD+analysis+
Figure+8.+Cl+vs.+Cd+graph+provided+by+J.+Robertson+
! 8!
!
The!simulation!has!been!done!with!Re=300.000,!so!a!greater!error!is!obtained,!although!the!
tendency!is!very!similar.!
!
2.4.! Conclusions*
!
As!conclusions!of!this!airfoil!study!is!noted!that!a!great!accuracy!with!Cl!results!is!obtained!
when!you!look!in!the!linear!region.!After!that!region,!turbulence!is!greater!and!a!LES!model!
and!greater!computing!power!is!required.!This!would!be!a!good!point!to!improve!in!following!
optimizations.!Besides,!the!error!in!Cd!is!also!due!to!this!small!precision!of!the!turbulence!
model!Spallart-Almaras.!!
As!it!is!announced!in!the!previous!paragraph,!the!model!used!can’t!reflect!the!turbulence!
around!the!airfoil.!It!can!be!explained!as!this!model!is!blind!to!turbulence!movements!and,!
consequently!to!lift!in!high!AoA!and,!specially,!drag!coefficients.!This!happens!because!of!the!
turbulence!origin!of!the!drag,!which!can!be!understand!as!the!resulting!force!appeared!with!
the!pressure!difference!between!the!leading!edge!and!the!trailing!edge,!if!it!is!spoken!in!
airfoil’s!terms,!but!the!concept!can!be!exported!to!any!geometry.!This!difference!in!pressure!
due!to!the!separation!of!the!flow!with!the!body!surface,!and!with!separation!the!turbulence!
flow!is!started.!So!that,!drag!depends!directly!from!turbulence!and!the!re-energised!flow!
behind!the!separation!of!flow.!
In!summary,!these!results!can!be!improved!using!a!LES!turbulence!model!or!even!a!DNS,!but!
the!later!model!would!need!a!huge!computing!power.!
! !
! 9!
3.!Motoglider*study*
3.1.! Aim*of*the*study*
The!objectives!of!this!study!are:!
•! To!compare!the!results!obtained!with!XFLR5!and!CFD!
•! To!know!more!precisely!the!aerodynamics!coefficients!of!the!airplane!
•! To!understand!the!behaviour!of!the!fluid!around!the!motoglider!
Great!difference!between!XFLR5!and!CFD’s!results!are!expected!because,!first!of!all,!the!
geometry!can’t!be!perfectly!represented!in!XFLR,!and,!furthermore!it!is!a!potential!solver.!
Besides,!CFD!analysis!are!expected!to!represent!quite!rigorously!the!performance!of!the!air!
around!a!shape!as!an!airplane!and!the!CL!coefficient,!but!error!in!CD!will!be!assumed.!!
This!study!was!based!on!the!Very+light+aircraft+case+of!Casacuberta’s!tutorial.!Some!changes!
had!to!be!done.!
3.2.! Modifications*on*the*tutorial*
First!of!all,!some!dictionaries!had!to!be!modified!to!ASCII!code,!because!they!originally!were!in!
binary!and!it!did!not!work!as!expected.!Of!course,!the!initial!conditions!were!substituted!for!
the!motoglider’s!scope,!which!are!k,!ω!and!Cµ.+Their!values!are!defined!in!equation!3.2.1,!3.2.2!
and!3.2.3.!
! =
3
2
( & · ()*
= 0.5814111111111111(3.2.1)!
2 =
34
56.*7
· !6.7
8
= 24.3324111111(3.2.2)!
34 = 0.09! = 0.052111111111111111111111(3.2.3)!
Where!
|U|!is!the!mean!flow!velocity!
I!is!the!turbulence!intensity:!( ≈ 0.02!
L!is!the!turbulent!length!scale:!8 ≈ 0.07<=3 ≈ 0.07 · 0.936 ≈ 0.0655?.!!
MGC!is!the!mean!geometric!chord!
All!the!previous!values!are!necessary!to!create!our!case!from!the!tutorial!case.!In!the!figures!9,!
10,!11,!12,!13,!14,!15,!16!and!17!all!the!changes!that!had!been!made!in!the!tutorial’s!
dictionaries!are!shown.!As!said!before,!they!manly!represent!the!change!to!ASCII!and!the!
characteristic!values!(MGC,!Aref,!…).!
Firstly,!the!definition!of!k,!nut,!ω,!p!(pressure)!and!U!(mean!flow!velocity)!are!presented.!
In!blue!can!be!find!the!changes!that!had!been!made!in!these!definitions.!!!
! 10!
!
Figure+9.+k+definition+
!
! 11!
!
Figure+10.+nut+definition+
! 12!
!
Figure+11.+ω+definition+
! 13!
!
Figure+12.+p+definition+
! 14!
!
Figure+13.+U+definition+
Furthermore,!changes!in!dictionaries!are!also!presented.!The!most!important!change!that!has!
to!be!noticed!is!the!one!shown!in!figure!17,!where!a!point!within!the!mesh,!but!outside!the!
aircraft!has!to!be!define!in!order!to!create!the!desired!mesh.!The!latter!must!include!the!flow!
around!the!plane.!
! 15!
!
Figure+14.+ControlDict+dictionary+
! 16!
!
Figure+15.+SnappyHexMeshDict+dictionary+(Part+1)+
! 17!
!
Figure+16.+SnappyHexMeshDict!dictionary+(Part+2)+
! 18!
!
Figure+17.+SnappyHexMeshDict!dictionary+(Part+3)+
Finally,!two!more!files!are!introduced.!One!is!the+forceCoeffs+file!(figure!18)!and!the!other,!
boundary!file!(figure!19).!The!first!one!is!important!because!the!geometry!characteristics!are!
defined!(MGC,!velocity,!Aref,!…).!The!second!one!is!shown!because!a!file!must!be!removed!due!
to!the!definition!inGroups!was!doubled.!
! 19!
!
Figure+18.+ForceCoeffs!file+
! 20!
!
Figure+19.+Boundary+file+
!
! *
! 21!
3.3.! Geometry*and*mesh*
From!the!original!STEP!format!of!CAD!file,!a!STL!format!has!been!created.!This!format!is!usually!
used!for!CFD!simulations!to!analyse!any!kind!of!objects.!In!figure!20!is!possible!to!appreciate!
the!motoglider.!
!
Figure+20.+STL+file+format+motoglider+
!After!that,!the!snappyHexMesh!was!created,!obtaining!the!shape!shown!in!figure!21.!
!
Figure+21.+SnappyHexMesh+with+the+STL+file+inside.+
! *
! 22!
3.4.! Results*and*Comparison*
The!results!of!the!simulation!are!presented!in!figures!22,!23,!24,!25!and!26.!First!of!all,!there!
are!different!views!of!pressure!field!over!the!aircraft.!From!them,!it!can!be!noted!the!good!
operation!of!the!wing!and!some!discontinuities!on!the!fuselage,!mainly!due!to!the!mesh!size.!
!
Figure+22.+Pressure+distribution+which+is+seen+from+a+3D+view+
!
Figure+23.+Pressure+distribution+which+is+seen+from+the+top+view+
! 23!
!
Figure+24.+Pressure+distribution+which+is+seen+from+bottom+view+
Next!the!velocity!and!pressure!fields!on!a!longitudinal!slide!are!presented:!
!
Figure+25.+Velocity+distribution+which+is+seen+from+a+lateral+view+
!
Figure+26.+Pressure+distribution+which+is+seen+from+a+lateral+view+
Streamlines!around!fuselage!are!viewed!in!figure!27!and!over!the!wings!in!figure!28.!
! 24!
!
Figure+27@+Streamlines+over+fuselage+
Combining!figure!25!and!27!can!be!viewed!that!some!boundary!layer!separation!is!present!on!
the!fuselage’s!leading!edge!and!after!the!cockpit.!It!could!be!reduced!smoothing!these!points!
on!the!geometry.!
!
Figure+28@+Streamlines+over+the+wing+
In!figure!28!is!noted!the!downwash!produced!by!the!wing!and!the!tip!vortexes.!
Finally,!the!numerical!results!and!its!comparison!with!XFLR5!data!are!presented!in!table!1.!
Table+1.+Results'+comparison+
& CFD& XFLR5& Error&
CL& 0.49! 0.537! 8.75%!
CD& 0.02! 0.014! 42.86%!
!!
!
! 25!
3.5.! Conclusions*
Finally,!it!is!clearly!seen!that!the!general!results!of!this!study!are!a!good!approximation!to!
general!flow!and!it!permits!to!know!where!would!be!possible!to!optimise.!The!results’!accuracy!
in!terms!of!drag!are!very!low!but!lift!results!are!acceptable.!So!that,!the!study!can!be!useful!to!
have!a!first!approximation!to!the!order!of!magnitude!and!corroborate!potential!data.!!
In!an!optimal!case,!the!inaccuracy!of!XFLR5!solver!compared!with!proper!CFD’s!one!would!be!
enough!to!believe!the!CFD’s!results.!But!in!our!case,!the!CFD!model!used!is!less!reliable!due!to!
the!limitation!of!computer!power.!Furthermore,!as!this!study!is!a!first!study,!XFLR5!results!are!
preferred!because!more!accurate!CD!values!are!achieved,!although!both!results!would!be!
assumed!as!wrong!if!a!final!study!was!performed.!
What’s!more,!the!mesh!size!is!not!small!enough!because!of!the!computing!power!available.!
More!precise!study!would!need!bigger!computer!power!and!a!more!in-depth!study!of!the!
mesh!generation.!
To!sum-up,!the!CFD!analysis!is!used!to!understand!how!the!geometry!would!affect!the!fluid!
around!the!aircraft.!As!it!can!be!seen,!fuselage!shape!should!be!optimised!in!order!to!reduce!
the!release!of!the!fluid!and,!consequently,!reducing!the!total!drag!of!the!motoglider.!Regarding!
the!CFD!results,!a!correct!CL!value!is!obtained!with!the!solver!used,!so!that,!the!result!is!
assumed!to!be!better!than!XFLR5’s!one.!Despite!the!CL!results!and!as!it!has!been!told!in!this!
study,!CD!results!are!rejected!because!the!solver!used!doesn’t!offer!the!needed!accuracy!for!
the!proper!turbulence!simulation,!which,!as!it!has!been!said,!is!the!origin!of!drag.!!
! !
! 26!
4.!Bibliography*
*
Christopher!A.!Lyon,!A.!P.!(s.f.).!Summary+of+Low@Speed+Airfoil+Data.!!
!
!

Motoglider Cfd study