Assignment 2 BLT AE19B102
Assignment 2 BLT AE19B102
Madras
AS5320
Boundary Layer Theory
Assignment 2:
Similarity and Approximate Solutions
for Laminar Boundary Layer
Author:
ANUJ NIGAM
AE19B102
ANUJ NIGAM
AS5320 Boundary Layer Theory
Assignment 2
Question 1. Decay of Laminar Shear Layer: Consider the shear layer developing downstream of a splitter
plate ending at x=0 as shown in the figure. The fluid has a kinematic viscosity of ν. At x=0, the velocity
has a ‘jump profile such that for y>0 is U1 and for y<0 is U2. Find the profile of velocity as the vortex
sheet at x=0 evolves into a shear layer obtaining the similarity solution. Plot the similarity solution, as
well as the velocity profiles at three different x-locations, say x=9, 25 and 100 mm, indicating the ‘99%
velocity’ definition-based shear layer thickness.
Answer:
Assumptions:
• Laminar Flow
• Incompressible Flow
• 2D Steady Flow
• No Body Forces
Sufficiently far downstream, similarity form of solution can be found. For similarity solution consider:
s
U1
(4) η=y u = U1 f ′ (η)
νx
∂ψ ∂ψ
(5) =u − =v
∂y ∂x
From above mentioned equation we can integrate with respect to y to get ψ from u :
Z Z
dy
ψ = U1 f ′ (η)dy =⇒ U1 f ′ (η) dη
dη
Z s
νx
=⇒ U1 f ′ (η) dη
U1
q
(6) ψ= U1 νxf (η)
From relation between v and ψ, we can use the value of ψ to get the value of v in terms of similarity
variable:
s
∂ψ 1 νU1 q ∂η
v=− =− f (η) − U1 νxf ′ (η)
∂x 2 x ∂x
Using (33):
s s
1 νU1 1q U1 − 3
v=− f (η) + U1 νxf ′ (η)y x 2
2 x 2 ν
q
1 νU1
collect 2 x
as common term for both terms and rewrite the equation for v to simplify using (33):
s
1 νU1
(7) v= (ηf ′ (η) − f (η))
2 x
Now, we can evaluate derivatives of u with respect to x and y in terms of similarity variable to get boundary
layer equation in similarity variables: (using (33)
∂u ∂u ∂η
=
∂x ∂η ∂x
s
1 U1 − 3
= U1 f ′′ (η) − y x 2
2 ν
ηU1 ′′
(8) =− f (η)
2x
∂u ∂u ∂η
=
∂y ∂η ∂y
s
′′ U1
(9) = U1 f (η)
νx
!
∂ 2u ∂ ∂u ∂η
2
=
∂y ∂η ∂y ∂y
s s
U1 U1
= U1 f ′′′ (η)
νx νx
U12 ′′′
(10) = f (η)
νx
3
Substituting the (8),(9),(10), (33) and (7) in (31) (Boundary layer equation):
s s
ηU1 ′′ 1 νU1 U1 U12 ′′′
(11) U1 f ′ (η) − f (η) + (ηf ′ (η) − f (η)) U1 f ′′ (η) = f (η)
2x 2 x νx x
The above equation can be simplified to the following equation (which represents Flat plate boundary layer
equation for zero Angle of attack!):
(12) f f ′′ + 2f ′′′ = 0
The transformed boundary conditions in terms of similarity variable can be given as follows: (using
(32))
(13) y → ∞, u → U1 =⇒ η → ∞, f ′ → 1
U2
(14) y → −∞, u → U2 =⇒ η → −∞, f ′ →
U1
A third Boundary condition is required to have unique solution. This condition must be on v. In theory
there are many boundary conditions used as the third condition to get solution, given as follows:
• f (η = 0) = 0: (v = 0 on y)
• f ′ (η = 0) = 1+U2 /U1
2
: (Average velocity on the interface)
• ηf ′ − f → 0 for η → ∞ : (v = 0 for η → ∞)
For this assignment lets focus on first boundary condition given above which states that streamline passes
through origin forms the interface between the fluids, which gives f (η = 0) = 0.
Note that η = 0 is an arbitrary choice which is chosen as such to make computations simpler. This can be
proven mathematically that the choice of η in the boundary condition is arbitrary from the fact that there
is no external force and no boundary, hence total resisting force = 0. Using the third boundary condition
as f (0) = 0, the obtained shear layer thicknesses according to ”99% velocity” definition is as follows:
• at x = 9 mm =⇒ δ99 = 0.3282 mm. (refer code in appendix 1)
• at x = 25 mm =⇒ δ99 = 0.5471 mm. (refer code in appendix 1)
• at x = 100 mm =⇒ δ99 = 1.0941 mm. (refer code in appendix 1)
4
Question 2. Two-Dimensional Laminar Wall Jet: Consider a fluid of kinematic viscosity of ν issuing out
of an orifice as shown in the figure. There is a wall at the bottom of the jet, while the top surface is free
(having room atmosphere above). At distances considerably downstream of the orifice, find the similarity
solution for the velocity and plot that.
Answer:
Assumptions:
• Laminar Flow
• Incompressible Flow
• 2D Steady Flow
• No body forces
Now focus on the second term of the above equation, using continuity equation we can rewrite it as:
Z ∞ Z ∞ Z ∞ Z ∞
∂u ∂v
(u2 )dy dy = − (u2 )dy dy
0 ∂x y 0 ∂y y
Z ∞ Z ∞ Z ∞ !
∂ ∂ Z∞ 2
=− v 2
(u )dy dy + v (u )dy dy
0 ∂y y 0 ∂y y
Z ∞ ∞ Z ∞
=− v 2
(u )dy + v(−u2 )dy
y 0 0
Now, as there is no normal flow at y = 0 and outer region y → ∞, hence:
Z ∞ Z ∞ Z ∞
∂u
(20) (u )dy dy = −
2
v(u2 )dy
0 ∂x y 0
Substituting this in (19) along with no slip condition, u = 0 at y = 0 and velocity in outer flow region
u → 0 as y → ∞ :
Z ∞ Z ∞
∂ 2
(21) u (u )dy dy = 0
∂x 0 y
Z ∞ Z ∞
2
(22) u (u )dy dy = constant = C1
0 y
Now, in order to define similarity variable, consider U0 being the max velocity in stream-wise direction at
any given x, then:
U0
(23) η=y
νx
Assuming self-similar solution:
u
(24) = f ′ (η)
U0
Consider Stream function ψ, then u = ∂ψ/∂y, hence:
∂ψ
= U0 f ′ (η)
∂y
Z
dy
ψ = U0 f ′ (η) dη
dη
q
(25) ψ= U0 νxf (η)
6
Now, we can re-write the variables in (62) and (24) using (26):
v s
u
u C x− 21 C2 − 3
− 21 ′ t 2
(27) u = C2 x f (η) η=y =y x 4
νx ν
q 1
(28) ψ= C2 νx f (η)
4
Now, v and derivatives of velocities can be found in terms of similarity variable to transform boundary
layer equation:
q !
∂ψ 1 −3 dη
x 4 f (η) + x 4 f ′ (η)
1
v=− = − C2 ν
∂x 4 dx
s
q
1 3 3 C2 − 7
= − C2 ν x− 4 f (η) + x 4 f ′ (η) − y
1
x 4
4 4 ν
1q
C2 νx− 4 (f (η) − 3ηf ′ (η))
3
=−
4
!
∂u 1 3 dη
= C2 − x− 2 f ′ (η) + x− 2 f ′′ (η)
1
∂x 2 dx
s
1 3 3 C2 − 7
= C2 − x− 2 f ′ (η) + x− 2 f ′′ (η) − y
1
x 4
2 4 ν
1 ′ 3 ′′
= −C2 x− 2
3
f + ηf
2 4
s s
∂u C2 − 3 C23 ′′
= C2 x− 2 f ′′ (η) f (η)x− 4
1 5
x 4 =
∂y ν ν
2 2
∂ u C
2
= 2 x−2 f ′′′ (η)
∂y ν
Now substituting these transformed derivatives and variables into boundary layer equation:
s
− 21 ′ − 32 1 ′ 3 ′′ 1q − 34 ′
C23 ′′ − 54
C22 −2 ′′′
C2 x f −C2 x f + ηf + − C2 νx (f (η) − 3ηf (η)) f (η)x = ν x f (η)
2 4 4 ν ν
f ′2 3 ′ ′′ 1 3
− − ηf f + − f f ′′ + ηf ′ f ′′ = f ′′′
2 4 4 4
7
(a) f & f ′ vs η
Question 3. Read the section on axi-symmetric jets in Schlichting’s book. Present the case and similarity
solution by working out the details (no need of plots).
Answer:
Assumptions:
• Incompressible Flow
• Steady flow =⇒ ∂
∂t
=0
• laminar flow
• No External force
• No swirl (Uθ = 0)
• Axis-symmetric flow =⇒ ∂
∂θ
=0
• No pressure gradient along axis (Not pressure driven flow) =⇒ ∂P
∂z
=0
To consider general axis-symmetric flow, take Navier stokes equation in cylindrical coordinates, which are
given as follows:
1 ∂ 1 ∂ ∂Uz
(30) (rUr ) + (Uθ ) + =0
r ∂r r ∂θ
" ∂z # " #
DUr Uθ2 ∂P 2 Ur 2 ∂Uθ
(31) ρ − =− + µ ∇ Ur − 2 − 2
⃗
Dt r ∂r r r ∂θ
" #
DUθ Uθ Ur 1 ∂P ⃗ 2 Uθ − Uθ + 2 ∂Ur
(32) ρ − =− +µ ∇
Dt r r ∂θ r2 r2 ∂θ
DUz ∂P ⃗ 2 Uz
(33) ρ =− + µ∇
Dt ∂z
Here:
D ∂ ∂ Uθ ∂ ∂
(Material Derivative) = + Ur + + Uz
Dt ∂t ∂r r ∂θ ∂z
2 2
2 ∂ 1 ∂ 1 ∂ ∂2
(Laplacian) ∇ = 2 +
⃗ + +
∂r r ∂r r2 ∂θ2 ∂z 2
Using the assumptions stated above the equation 32 becomes trivially zero, while the other equations
simplify to the following:
1 ∂ ∂Uz
(34) (rUr ) + =0
" r ∂r ∂z# " #
∂Ur ∂Ur ∂P ∂ 2 Ur 1 ∂Ur ∂ 2 Ur Ur
(35) ρ Ur + Uz =− +µ + + − 2
∂r ∂z ∂r ∂r2 r ∂r ∂z 2 r
" # " #
∂Uz ∂Uz ∂ 2 Uz 1 ∂Uz ∂ 2 Uz
(36) ρ Ur + Uz =µ + +
∂r ∂z ∂r2 r ∂r ∂z 2
We can now perform order of magnitude analysis to get the Boundary layer equations for axis-symmetric
flow.
9
r z
r̄ = z̄ =
L L
U z Ur
U¯z = Ūr =
U0 U0
P
P̄ =
ρU02
Substituting the non-dimensional variables in (34):
1 ∂ ∂Uz
(rUr ) + =0
r ∂r ∂z
1 1 ∂ 1 ∂U0 U¯z
=⇒ LU0 r̄Ūr + =0
Lr̄ L ∂r̄ L ∂ z̄
1 ∂ ∂ U¯z
(37) =⇒ r̄Ūr + =0
r̄ ∂r̄ ∂ z̄
∂ U¯z
(38) U¯z ∼ O(1), z̄ ∼ O(1) =⇒ ∼ O(1)
! ! !
∂ z̄ !
1 ∂r̄Ūr Ūr Ūr δ
(39) O =O =O =⇒ O(Ūr ) = O
r̄ ∂r̄ r̄ δ/L L
! !
∂ U¯z U¯z
(41) O Ūr = O Ūr = O(1)
∂r̄ r̄
!
∂ U¯z
(42) O U¯z = O(1)
∂ z̄
!
1 ∂ 2 U¯z 1 1
(43) O = O 2
Rez ∂r̄2 Rez δ
L
!
1 ∂ U¯z 1 1
(44) O = O 2
Rez r̄ ∂r̄ Rez δ
L
!
∂ U¯z
2
(45) O = O(1)
∂ z̄ 2
10
As the gradients are large, the RHS (viscous terms) cannot be neglected, except the last term which can
be neglected in comparison to other RHS terms.
2 !
L
(46) O (Rez ) = O
δ
Substituting the non-dimensional variables in (35):
" # " #
∂Ur ∂Ur ∂P ∂ 2 Ur 1 ∂Ur ∂ 2 Ur Ur
ρ Ur + Uz =− +µ + + − 2
∂r ∂z ∂r ∂r2 r ∂r ∂z 2 r
" # " #
U 2 ∂ Ūr U02 ¯ ∂ Ūr ρU 2 ∂ P̄ U0 ∂ 2 Ūr 1 ∂ Ūr ∂ 2 Ūr Ūr
=⇒ ρ 0 Ūr + Uz =− 0 +µ 2 + + − 2
L ∂r̄ L ∂ z̄ L ∂r̄ L ∂r̄2 r̄ ∂r̄ ∂ z̄ 2 r̄
" # " #
∂ Ūr ∂ Ūr ∂ P̄ 1 ∂ 2 Ūr 1 ∂ Ūr ∂ 2 Ūr Ūr
(47) =⇒ Ūr + U¯z =− + + + − 2
∂r̄ ∂ z̄ ∂r̄ Rez ∂r̄2 r̄ ∂r̄ ∂ z̄ 2 r̄
! ! ! !
∂ Ūr δ ∂ Ūr δ
(48) O Ūr =O , O U¯z =O
∂r̄ L ∂ z̄ L
!
∂ P̄ L
(49) O =O
∂r̄ δ
! !2 ! ! !
2
1 ∂ Ūr δ δ/L δ 1 1 ∂ Ūr δ
(50) O = O 2 = O ,O =O
Rez ∂r̄2 L δ L Rez r̄ ∂r̄ L
L
! !
1 Ūr δ
(51) O =O
Rez r̄2 L
! !3
1 ∂ 2 Ūr δ
(52) O = O
Rez ∂ z̄ 2 L
As it can be observed from (49), the radial pressure gradient term is much larger in comparison to other
terms and thus it must be zero for the equation to be true.
Hence,
∂ P̄
(53) = 0 =⇒ P = constant
∂r̄
Using the order of magnitude analysis, we can rewrite the equations to transform to boundary layer
equation in cylindrical coordinates:
1 ∂ ∂Uz
(54) (rUr ) + =0
" r ∂r ∂z# " #
∂Ur ∂Ur ∂ 2 Ur 1 ∂Ur Ur
(55) ρ Ur + Uz =µ + − 2
∂r ∂z ∂r2 r ∂r r
" # " #
∂Uz ∂Uz ∂ 2 Uz 1 ∂Uz
(56) ρ Ur + Uz =µ +
∂r ∂z ∂r2 r ∂r
With the boundary conditions:
• r → ∞, Uz → 0 (Outer flow)
• r → 0, ∂Uz
∂r
→ 0 (From symmetry)
• r → 0, Ur → 0 (From symmetry)
11
Consider LHS, with the first term transformed using chain rule:
Z ∞ Z ∞ Z ∞ !
∂ ∂ ∂Uz
LHS = (rUr Uz ) dr − (rUr ) Uz dr + rUz dr
0 ∂r 0 ∂r 0 ∂z
The above result suggests that the radial momentum flux is constant! Consider Self-similar profiles down-
stream as there is no externally imposed scale:
s
′ r U0
(60) Uz = U0 f (η) η= =r
δ(z) νz
Z ∞
rU02 (f ′ (η))2 dr = J
0
s s
U0 νz
η=r dr = dη
νz U0
Z ∞
(65) =⇒ U0 νz (f ′ (η))2 ηdη = J
0
C12 J
(66) U0 = where C12 = R ∞ ′
z ν 0 (f (η))2 ηdη
From (61) and (62), the radial velocity in terms of similarity variable:
1 ∂ψ
Ur = −
r ∂z
Z η
1 ∂ ′
=− νz η0 f (η0 )dη0
r ∂z
" Z
0
#
η
1 ′ ′ ∂η
=− ν η0 f (η0 )dη0 + νzηf (η)
r 0 ∂z
" Z !#
1 η −rC1
=− ν η0 f ′ (η0 )dη0 + νzηf ′ (η) 2 √
r 0 z ν
√ " Z η #
νC1 1
(67) Ur = ηf ′ (η) − η0 f ′ (η0 )dη0
z η 0
√ " #
νC1 F (η)
(68) Ur = F ′ (η) −
z η
!
∂Uz C2 ∂ F ′ (η)
= 1
∂r z ∂r η
!
C12 ∂ F ′ (η) ∂η
=
z ∂η η ∂r
!
C2 ηF ′′ (η) − F ′ (η) C1
= 1 √
z η2 z ν
13
!
∂Uz C3 ηF ′′ (η) − F ′ (η)
(69) = 2 √1
∂r z ν η2
!
∂Uz C12 F ′ (η) C1 ηF ′′ − F ′ ∂η
=− 2 +
∂z z η z η2 ∂z
2
C
(70) = − 21 F ′′
! z !!
∂ ∂Uz ∂ C13 r ηF ′′ (η) − F ′ (η)
r = √
∂r ∂r ∂r z 2 ν η2
! !
C3 ηF ′′ (η) − F ′ (η) C13 ∂ ηF ′′ (η) − F ′ (η) ∂η
= 2 √1 + √
z ν η2 z 2 ν ∂η η2 ∂r
! !
C3 ηF ′′ (η) − F ′ (η) C14 η 3 F ′′′ − 2η 2 F ′′ + 2ηF ′ )
(71) = 2 √1 +
z ν η2 z3ν η4
Now, substituting the transformed variable into (56) to get transformed boundary layer equation:
!
∂Uz ∂Uz ν ∂ ∂Uz
Ur + Uz = r
∂r ∂z r ∂r ∂r
Now consider LHS:
" ! ! !#
C4 F ηF ′′ − F ′ F′ F′ F′
LHS = 31 F′ − + − − F ′′
+
z η η2 η η η
4
C
(72) = 3 1 3 F F ′ − ηF ′′ F − ηF ′2
η z
Now consider RHS:
! !
C3 ηF ′′ (η) − F ′ (η) C14 η 3 F ′′′ − 2η 2 F ′′ + 2ηF ′ )
RHS = 2 √1 +
z ν η2 z3ν η4
" #
C 4 ηF ′′ − F ′ η 3 F ′′′ − 2η 2 F ′′ + 2ηF ′
= 31 +
z η3 η4
C4 h i
= 3 1 3 ηF ′′ − F ′ + η 2 F ′′′ − 2ηF ′′ + 2F ′
z η
C14 h 2 ′′′ i
(73) RHS = 3 3 η F − ηF ′′ + F ′
z η
Equating LHS and RHS to get:
C14 ′ ′′ ′2
C14 h 2 ′′′ ′′ ′
i
F F − ηF F − ηF = η F − ηF + F
η3z3 z3η3
F F ′ F ′′ F F ′2 ′′′ F ′′ F ′
(74) − − = F − + 2
η2 η η η η
! !
d FF′ d ′′ F′
(75) =− F −
dη η dη η
Integrating both sides:
(76) F F ′ = F ′ − ηF ′′
14
Thus, the Similarity solution for the axis-symmetrix jets can be found from the following equation:
(77) F F ′ = F ′ − ηF ′′
Boundary conditions can be given by:
• Ur (r = 0) = 0 =⇒ limη→0 F ′ (η) − F (η)
η
= 0 =⇒ F (0) = 0
F ′ (η
• Uz (r → ∞) = 0 =⇒ limη→∞ ∂
∂η η
=0
F ′ (η)
• ∂Uz
∂r
(r = 0) = 0 =⇒ limη→0 η
= 0 =⇒ F ′ (0) = 0 (Limit shown beside only exist for F ′ (0) = 0)
F′
This can also be understood from the fact that Axial Velocity Uz is even function of η, hence η
must be
even function which implies that F ′ should be odd function.
15
Question 4. As per the discussions we had in the class concerning the Continuation problem, you are
asked to refer to Gortler’s 1941 paper translated and published in Journal of Royal Aeronautical Soci-
ety, “Further development of a boundary layer profile for a given pressure distribution.” Implement the
method to an example problem: You are free to choose between the example case worked in the paper, or
Falkner-Skan solution for some specific angle you like (except flat plate and stagnation point case, you can
choose any favourable pressure gradient). If the former is chosen, reproduce the results in the paper (only
the results of numerical calculation, not the Blasius-Hiemenz solution), plotting key results (Fig 8 a, b is
sufficient). If you choose the latter, choose some point you wish, proceed along x and do the calculation
using the method, and verify if the profiles you compute are similar. Attach your code.
Answer: In this problem, consider straight circular cylinder immersed in uniform flow.
16
Question 5. Use approximate method (the momentum integral method) and estimate drag coefficient
over the symmetric airfoil NACA0024 placed at zero degree angle of attack to the freestream flow. The
airfoil contour is given as Fig. A to serve as reference for axis (normalized by chord length c). The cartesian
x-y coordinates of the contour are given in the table (at x/c=1, y should be zero, but the table shows a
small number, which you can make it zero; fit curve and generate more ‘continuous’ data if you like). Fig.
B shows the potential flow pressure coefficient distribution from a panel method (data from a research
paper on panel method) which shall be used to calculate U(x). Plot also the Pohlhausen profile at the
location of maximum U, one location of your choice upstream of the maximum U point, and two other
locations of your choice in the adverse pressure gradient region (all on the same graph).
Answer: Using the Cp distribution given in the question over the symmetric NACA0024 airfoil, the
velocity distribution can be found as follows:
P − P∞
Cp = 1 2
2
ρU∞
1 1 2
P + ρU 2 = P∞ + ρU∞ (From Bernoulli’s Equation)
2 2
1
ρU 2 − 12 ρU 2
=⇒ Cp = 2 ∞ 1 2
2
ρU∞
U2
=⇒ Cp = 1 − 2
U∞
U (x) q
(78) = 1 − Cp
U∞
Using Approximate Solution of Boundary Layer Equations using Pohlhausen velocity profile given by:
u y
(79) = f (η) = a + bη + cη 2 + dη 3 + eη 4 (for 0 ≤ η = ≤ 1)
U (x) δ
The Coefficients a, b, c, d, e are chosen in such a way that the velocity profile satisfies the boundary condi-
tions which are given as follows:
(80) u = 0 =⇒ f (0) = 0 for y = 0 (No slip condition)
(81) u = U (x) =⇒ f (1) = 1 for y = δ (Far-stream condition)
2
∂u ∂ u
(82) = 2 = 0 =⇒ f ′ (1) = f ′′ (1) = 0 for y = δ (Far-stream condition)
∂y ∂y
Substituting Boundary Layer Equation, with above condition at y = 0, to get another boundary condition
on f (η):
∂u ∂u dU ∂ 2u
u +v −U =ν 2
∂x ∂y dx ∂y
Using No slip (u(x, y = 0) = 0) and No penetration (v(x, y = 0) = 0) condition, we get:
∂ 2u dU
(83) ν 2
= −U
∂y y=0 dx
The above condition can be re-written as follows:
δ 2 dU
(84) f ′′ (0) = − = −λ(x)
ν dx
Here, λ is a parameter called Pohlhausen Parameter. Now, using all the boundary conditions imposed on
f (η), we can derive the coefficients which turn out to be given as follows:
λ λ λ λ
a=0 b=2+ c=− d = −2 + e=1−
6 2 2 6
17
∂u U
τw = µ = µ f ′ (0)
∂y y=0 δ
!
U λ
(88) τw = µ 2+
δ 6
dZ θ dθ
=2
dx ν dx
18
Now, using all the defined parameters as given above, the (90) can transformed into following:
L Λ 1 dZ
= (2 + H) +
U U 2 dx
dZ 2 F (Λ)
= (L − (2 + H)Λ) =
dx U U
Here,
F (Λ) = 2L(Λ) − 4Λ − 2ΛH(Λ)
Thus, from definition of Λ, Z, H, L and (87), (86), it can be determined that:
!2
37 λ λ2
(91) Λ= − − λ
315 945 9072
3
10
− λ
120
(92) H = 37
315
− λ
945
− λ2
9072
! !
37 λ λ2 λ
(93) L= − − 2+
315 945 9072 6
Now, at Stagnation point, U = 0 and dZ
dx
is finite which gives that F (Λ0 ) = 0 at stagnation point. Using
Linear Approximated function of F (Λ) given by Walz (Schlichting 1987) which is fairly good approxima-
tion:
(94) F (Λ) = 0.47 − 6Λ
0.47
Thus, for F (Λ0 ) = 0 =⇒ Λ0 = 6
= 0.0783. Now, at stagnation point,
Λ0 0.07833
(95) Z0 = =
dU U0′
dx
0
′
dZ F (Λ0 ) F (Λ0 )
(96) = = (Using L’Hospital Rule as we have 0/0 form)
dx 0 U0 U0′
Now using chain rule of differentiation and (94) and definition of Λ:
dF (Λ) dΛ
Z0′ = dΛ dx
U0′
dF (Λ)
(From linearised Approximation) = −6
dΛ 0
dΛ dZ dU d2 U
= + Z 2 = Z0′ U0′ + Z0 U0′′
dx 0 dx dx dx
−6
=⇒ Z0′ = ′ (Z0′ U0′ + Z0 U0′′ )
U0
−6Z0 U0′′
=⇒ 7Z0′ =
U0′
From (95), the value of Z0 can be substituted in the above equation to get:
−0.06714 × U0′′
(97) Z0′ =
U0′2
Similarly we can find value of Λs at separation point as we know at separation λs = −12 and from
(91):
(98) Λs = −0.1567
19
Now, we can numerically solve for the Pohlhausen Profile using the equations we have established above,
which can be summarised in the steps given below:
• Step1: Get the Cp data using from the given image using tools like plotdigitizer which can convert
points on image into coordinates according to scale.
• Step2: use (78) to get Outer Velocity Distribution.
• Step3: Get the Airfoil Coordinates and increase discretisation of points in such a way to get more
number of point closer to leading edge as Cp has high variation there.
• Step4: Get coordinate xn ew along the airfoil by simply using pythagoras theorem,
q
xn ew = (xi+1 − xi )2 + (yi+1 − yi )2
Results:
• The Separation point turns out to be at x/c = 0.5185 or xnew /c = 0.5674 (which along airfoil).
• Cd = 0.1332.
• Other parameters like Boundary Layer thickness, displacement thickness and momentum thickness
are also obtained which can be used for analysis refer code in appendix 4.
20
Figure 5. Results
21
Appendix
Question 1:
1 %% *****************************************************************************
2 % File: shooting_Q1_Assignment2 .m
3 % Script for generating numerical solution to Decay of Laminar Shear Layer
4 % problem for downstream of splitter plate to obtain similarity solution using
5 % Shooting Method . It also uses Fsolve to perform non - linear optimisation
6 % to get f '( eta =0) and f''( eta =0).
7 %
8 % Input :
9 % U1 : Reynolds Number of the Flow in consideration @ xeval
10 % U2 : Molecular Viscosity of the flow in consideration @xeval
11 % nu : Density of the Flow in consideration @xeval
12 % xeval : array to points downstream to get velocity profile and boundary
layer thickness at
13 % etaMax : Total Nodes point (max value of eta) to solve numerically using
shooting Method
14 %
15 % Output :
16 % f : Similarity Solution for Streamfunction psi = sqrt(U1.nu.x) f(eta)
17 % g : Similarity Solution for Velocity
18 % h : Similarity Solution for Change in Velocity
19 % u : Similarity solution of Velocity profile of flow obtained u = U1 g(eta
)
20 % delta99x : Shear Layer Thickness according to "99% velocity " definition for all
points in xeval
21 %
22 % Plots of : i) Similarity solution of f & g vs eta ,
23 % ii) Velocity profile @ x = 9, 25, 100 mm
24 % downstream , y vs u
25 %
26 % Author : Anuj Nigam
27 % Date : 15 -07 -2023
28 % Version : 4
29 % *******************************************************************************
30
31 %% Clear
32 clear ; close all;clc;
33
34 %% Input
35 % Flow field details
36 U1 = 10; % in m/s
37 U2 = 1; % in m/s
38 nu = 10^ -5; % in m^2/s
39 xeval = [9 ,25 ,100]*10^ -3; % in m - locations of x for evaluation of Velocity Profile \
40
41 % Limits of the problem
42 n = 1001; % number of nodes
43 etaMax = 10; % upper limit on eta
44 delEta = etaMax /(n -1); % step size in terms of eta
45
46 %% Initialise
47 f_upper = zeros (n ,1);
48 g_upper = zeros (n ,1);
49 h_upper = zeros (n ,1);
50 f_lower = zeros (n ,1);
51 g_lower = zeros (n ,1);
52 h_lower = zeros (n ,1);
22
53 f_upper (1) = 0; % f
54 f_lower (1) = 0; % f
55 % g_upper (1) = 0.5*(1+ U2/U1); % f'
56 eta = linspace (-(n -1) ,n -1 ,2*n -1);
57 eta= delEta *eta;
58
59 %% Solving
60 fun = @shooting ;
61 x0 = [0.5 ,0.1];
62 x = fsolve (fun ,x0);
63
64 for j = x(2)
65 h_upper (1) = j;
66 h_lower (1) = j;
67 for k = x(1)
68 g_upper (1) = k;
69 g_lower (1) = k;
70 for i = linspace (1,n-1,n -1)
71 f_upper (i+1) = f_upper (i) + delEta * g_upper (i);
72 g_upper (i+1) = g_upper (i) + delEta * h_upper (i);
73 h_upper (i+1) = h_upper (i) - ( delEta /2)* f_upper (i)* h_upper (i);
74 f_lower (i+1) = f_lower (i) - delEta * g_lower (i);
75 g_lower (i+1) = g_lower (i) - delEta * h_lower (i);
76 h_lower (i+1) = h_lower (i) + ( delEta /2)* f_lower (i)* h_lower (i);
77 end
78 if abs( g_upper (n) -1) < 10^( -5) && abs( g_lower (n) - U2/U1) < 10^( -5) % check if
the solution has converged to the boundary condition on f'
79 disp (" Converged !")
80 flag = 1;
81 break
82 else
83 continue
84 end
85 end
86 if flag == 1
87 break
88 end
89 end
90
91 %% Combine Problem ( Upper + lower )
92 f= cat (1, flip( f_lower ),f_upper (2: end));
93 g = cat (1, flip( g_lower ),g_upper (2: end));
94 h = cat (1, flip( h_lower ),h_upper (2: end));
95
96
97 %% Results
98 % Figure #1: f & f' vs eta ( similarity solution plot)
99
100 figure (1)
101 plot(eta ,g," LineWidth " ,2.5 ," Color " ,[0 0 1])
102 hold on
103 plot(eta ,f," LineWidth " ,2.5 ," Color " ,[1 0 0])
104
105 % Formating Plot
106 ax = gca;
107 grid(ax ,"on ")
108 grid minor
109 box(ax ,"on")
110 ax. LineWidth =1.5;
111 ax. FontSize = 15;
23
112 xlabel ("\ eta "," FontSize " ,15 ," FontWeight "," bold ")
113 legend ("f'", "f")
114 hold off
115
116 % Figure 2: Velocity Profile at different locations downstream
117
118 delta_99 = find(abs(g -0.99) <10^ -4); % check where velocity becomes 99% of U ( Freestream
)
119 fig = zeros (3 ,1); % figure array to keep track of plot while labeling legends
120 deltax = sqrt (( nu/U1).* xeval '); % delta_x , scale of Boundary Layer
121 u = U1.*g; % Velocity Profile
122 del_99 = find(abs(u -0.99* U1) <10^( -3)); % Checking where velocity becomes 99% of U (
Freestream )
123 delta99x = zeros (size( xeval )); % Shear Layer Thickness according to "99% velocity "
definition
124 figure (3)
125 hold on
126 for i = 1:3
127 y = deltax (i)*eta '*1000;
128 fig(i) = plot(u,y, LineWidth =2.5) ;
129 plot(u( del_99 ),y( del_99 ),Marker ="o", LineWidth =2)
130 yline (y( del_99 ),LineStyle ="--", LineWidth =1.25 , Color =[0 0 0])
131 delta99x (i) = y( delta_99 );
132 % text(i,y( delta_99 ) -0.2, strcat ("\ uparrow \ delta_ {0.99} = ", num2str (y( delta_99 )) ,"
\mum ") ," FontSize " ,15 ," FontWeight "," bold ")
133 end
134
135 % Formating Plot
136 ax = gca;
137 ax. FontSize = 15;
138 ylabel ("y (\ mum)"," FontSize " ,15 ," FontWeight "," bold ")
139 xlabel ("u (m/s)"," FontWeight "," bold "," FontSize " ,15)
140 legend ([ fig (1) ,fig (2) ,fig (3) ],"x = 9 mm", "x = 25 mm","x = 100 mm ")
141 grid(ax ,"on ")
142 grid minor
143 box(ax ,"on")
144 ax. LineWidth =1.5;
145 hold off
146
147 % Function definitions
148 function res = shooting (x)
149 U1 = 10; % in m/s
150 U2 = 1; % in m/s
151 n = 1001;
152 etaMax = 10; % upper limit on eta
153 delEta = etaMax /(n -1); % step size in terms of eta
154 f_upper = zeros (n ,1);
155 g_upper = zeros (n ,1);
156 h_upper = zeros (n ,1);
157 f_lower = zeros (n ,1);
158 g_lower = zeros (n ,1);
159 h_lower = zeros (n ,1);
160 f_upper (1) = 0; % f
161 f_lower (1) = 0; % f
162 g_lower (1) = x(1);
163 g_upper (1) = x(1);
164 h_lower (1) = x(2);
165 h_upper (1) = x(2);
166 for i = linspace (1,n-1,n -1)
167 f_upper (i+1) = f_upper (i) + delEta * g_upper (i);
24
Question 2:
1 %% *****************************************************************************
2 % File: shooting_Q2_Assignment2 .m
3 % Script for generating numerical solution to 2-D Laminar Jet problem for
4 % sufficiently downstream of oriface to obtain similarity solution using
5 % Shooting Method
6 %
7 % Input :
8 % Re : Reynolds Number of the Flow in consideration @ xeval
9 % mu : Molecular Viscosity of the flow in consideration @xeval
10 % rho : Density of the Flow in consideration @xeval
11 % xeval : Point Sufficiently downstream of oriface to get velocity profile
12 % etaMax : Total Nodes point (max value of eta) to solve numerically using
shooting Method
13 %
14 % Output :
15 % U0 : Max Velocity of flow obtained @ xeval
16 % f : Similarity Solution for Streamfunction psi = sqrt(U0.nu.x) f(eta)
17 % g : Similarity Solution for Velocity u = U0 g(eta)
18 % h : Similarity Solution for Change in Velocity
19 % Ueval : Velocity Profile @xeval for particular y, Ueval ( yeval )
20 %
21 % Plots of : i) Similarity solution of f & g vs eta ,
22 % ii) Similarity Solution of velocity sufficiently
23 % downstream of oriface , eta vs g
24 % iii) Velocity profile @xeval point , Ueval vs yeval
25 %
26 % Author : Anuj Nigam
27 % Date : 10 -07 -2023
28 % Version : 3
29 % *******************************************************************************
30
31 %% Clear
32 clear ; close all;clc;
33
34 %% Input
35 % Flow field details
36 Re = 700000;
37 mu = 0.0000181206;
38 rho = 1.225;
39 xeval = 7*10^5; % target location where velocity profile is checked
40
41 % Limits of the numerical problem
42 etaMax = 10; % max( eta_eval ); % upper limit on eta
43 n = 100* etaMax +1; % number of nodes
25
44
45
46 %% Initialise
47 % Real Problem variables
48 yeval = linspace (0 ,10 ,10^5);
49 nu = mu/rho; % Kinematic Viscosity in m^2/s
50 U0 = Re*mu/rho; % Velocity of jet stream in m/s
51 eta_eval = yeval .* U0 /( nu*xeval ); % similarity variable @xeval for yeval points
52
53 % Similarity variables
54 f= zeros (n ,1);
55 g = zeros (n ,1);
56 h = zeros (n ,1);
57 f(1) = 0; % f
58 g(1) = 0; % f'
59 eta = linspace (0,n-1,n);
60 delEta = etaMax /(n -1); % step size in terms of eta
61 eta = delEta *eta;
62
63 %% Solving
64
65 for j = linspace (0.1 ,2 ,10000)
66 h(1) = j; % initial guess value
67 for i = linspace (1,n-1,n -1)
68 f(i+1) = f(i) + delEta *g(i);
69 g(i+1) = g(i) + delEta *h(i);
70 h(i+1) = h(i) - ( delEta /4) *(f(i)*h(i)+2*g(i)^2);
71 end
72 if abs(g(n)- 0 ) < 10^( -5) % check if the solution has converged to the boundary
condition on f'
73 disp (" Converged !")
74 break
75 else
76 continue
77 end
78 end
79
80 %% Results
81 % Figure #1: f & f' vs eta ( similarity solution plot)
82
83 figure (1)
84 plot(eta ,g," LineWidth " ,2.5 ," Color " ,[0 0 1])
85 hold on
86 plot(eta ,f," LineWidth " ,2.5 ," Color " ,[1 0 0])
87
88 % Formating Plot
89 ax = gca;
90 grid(ax ,"on ")
91 grid minor
92 box(ax ,"on")
93 ax. LineWidth =1.5;
94 ax. FontSize = 12;
95 xlabel ("\ eta "," FontSize " ,15 ," FontWeight "," bold ")
96 legend ("f'", "f")
97 hold off
98
99 % Figure 2: Similarity Velocity Profile ( suficiently dowstream of oriface )
100 figure (2)
101 hold on
102 plot(g,eta , LineWidth =2.5)
26
103 ax = gca;
104 grid(ax ,"on ")
105 grid minor
106 box(ax ,"on")
107 ax. LineWidth =1.5;
108 % set(gca ,'xtick ' ,[])
109 set(gca ,'xticklabel ' ,[])
110 % set(gca ,'ytick ' ,[])
111 set(gca ,'yticklabel ' ,[])
112 ax. FontSize = 12;
113 ylabel ("y"," FontSize " ,15 ," FontWeight "," bold ")
114 xlabel ("U"," FontWeight "," bold "," FontSize " ,15)
115 hold off
116
117 % Figure 3: Velocity Profile ( dowstream of oriface ) @ xeval location
118 figure (3)
119 Ueval = U0 .* interp1 (eta ,g,eta_eval ," spline ");
120 plot(Ueval ,yeval , LineWidth =2.5)
121 ax = gca;
122 ax. FontSize = 12;
123 grid(ax ,"on ")
124 grid minor
125 box(ax ,"on")
126 ax. LineWidth =1.5;
127 ylabel ("y"," FontSize " ,15 ," FontWeight "," bold ")
128 xlabel ("U"," FontWeight "," bold "," FontSize " ,15)
Listing 2. Matlab code to implement shooting Method solution for 2D Laminar Jet flow
Question 4:
Question 5:
1 %% *****************************************************************************
2 % File: Pohlhausen Profile_Q5 .m
3 % Script for Fourth Order Pohlhausen Profile Approximation Boundary Layer
4 % Analysis pf NACA0024 Airfoil
5 %
6 % Author : Anuj Nigam
7 % Date : 25 -08 -2023
8 % Version : 2
9 % *******************************************************************************
10 %% Clear
11 clear ; close all;clc;
12
13 %% Input Flow Parameters
14 Re = 700000;
15 mu = 0.0000181206;
16 rho = 1.225;
17 nu = mu/rho;
27
18 U_inf = Re*mu/rho;
19
20
21 %% import data from plot digitizer on Cp vs Xc distribution over NACA 0024 airfoil
22 raw_xc = [0.005449591280653951 , 0.005449591280653951 , 0.005449591280653951 ,
0.005449591280653951 , 0.005449591280653951 , 0.008174386920980926 ,
0.008174386920980926 , 0.008174386920980926 , 0.010899182561307902 ,
0.010899182561307902 , 0.013623978201634877 , 0.013623978201634877 ,
0.013623978201634877 , 0.013623978201634877 , 0.01634877384196185 ,
0.01634877384196185 , 0.01907356948228883 , 0.01907356948228883 ,
0.021798365122615803 , 0.024523160762942777 , 0.027247956403269755 ,
0.02997275204359673 , 0.02997275204359673 , 0.0326975476839237 , 0.03542234332425068 ,
0.03814713896457766 , 0.04087193460490463 , 0.043596730245231606 ,
0.04632152588555858 , 0.051771117166212535 , 0.05449591280653951 ,
0.05994550408719346 , 0.0653950953678474 , 0.07084468664850135 , 0.08174386920980926 ,
0.08991825613079019 , 0.10081743869209808 , 0.11171662125340599 , 0.1335149863760218 ,
0.15258855585831063 , 0.17438692098092642 , 0.19618528610354222 , 0.21525885558583105 ,
0.23705722070844687 , 0.25885558583106266 , 0.2779291553133515 , 0.2970027247956403 ,
0.31607629427792916 , 0.335149863760218 , 0.3542234332425068 , 0.3760217983651226 ,
0.39509536784741145 , 0.41144414168937327 , 0.4305177111716621 , 0.44959128065395093 ,
0.4659400544959128 , 0.4822888283378746 , 0.4986376021798365 , 0.5177111716621253 ,
0.5367847411444141 , 0.5613079019073569 , 0.5858310626702997 , 0.6076294277929155 ,
0.6294277929155313 , 0.6512261580381471 , 0.670299727520436 , 0.6948228882833787 ,
0.7193460490463215 , 0.7411444141689373 , 0.7656675749318801 , 0.7847411444141689 ,
0.8065395095367847 , 0.8283378746594006 , 0.8446866485013623 , 0.8637602179836512 ,
0.885558583106267 , 0.9073569482288828 , 0.9237057220708447 , 0.9373297002724795 ,
0.9509536784741144 , 0.9645776566757492 , 0.9727520435967302 , 0.9809264305177111 ,
0.986376021798365 , 0.9918256130790191 , 0.994550408719346 , 0.997275204359673 ,
0.997275204359673 , 1, 1, 1, 1, 1, 1, 1, 1];
23 raw_cp = [1, 0.9560439560439561 , 0.9120879120879122 , 0.8736263736263736 ,
0.8296703296703298 , 0.7747252747252747 , 0.7307692307692308 , 0.6813186813186813 ,
0.6318681318681321 , 0.5824175824175826 , 0.5329670329670331 , 0.4835164835164837 ,
0.42307692307692324 , 0.37362637362637374 , 0.32417582417582425 , 0.2582417582417582 ,
0.19780219780219777 , 0.1428571428571429 , 0.08241758241758246 , 0.010989010989011061 ,
-0.0494505494505495 , -0.1153846153846152 , -0.159340659340659 ,
-0.20329670329670324 , -0.24725274725274704 , -0.29120879120879106 ,
-0.3351648351648353 , -0.39010989010989006 , -0.43406593406593386 ,
-0.4780219780219781 , -0.5274725274725274 , -0.5659340659340657 , -0.6098901098901099 ,
-0.653846153846154 , -0.6978021978021978 , -0.741758241758242 , -0.7747252747252746 ,
-0.8076923076923077 , -0.8296703296703294 , -0.8516483516483515 , -0.8461538461538463 ,
-0.8351648351648351 , -0.8186813186813189 , -0.7967032967032963 ,
-0.7802197802197801 , -0.7527472527472525 , -0.7307692307692308 , -0.7087912087912087 ,
-0.6813186813186813 , -0.653846153846154 , -0.6263736263736264 , -0.5989010989010988 ,
-0.5769230769230771 , -0.5494505494505495 , -0.5219780219780219 ,
-0.4999999999999998 , -0.4780219780219781 , -0.45604395604395553 ,
-0.43406593406593386 , -0.40659340659340626 , -0.37362637362637363 ,
-0.34065934065934056 , -0.3131868131868132 , -0.29120879120879106 ,
-0.25824175824175843 , -0.2417582417582418 , -0.20879120879120872 ,
-0.18131868131868112 , -0.15384615384615397 , -0.12087912087912067 ,
-0.0934065934065933 , -0.06043956043956045 , -0.027472527472527375 ,
-0.005494505494505253 , 0.027472527472527708 , 0.06043956043956045 ,
0.10989010989010994 , 0.14835164835164838 , 0.1923076923076924 , 0.23076923076923084 ,
0.27472527472527486 , 0.31868131868131877 , 0.36813186813186816 , 0.4120879120879122 ,
0.4560439560439562 , 0.49450549450549464 , 0.5439560439560439 , 0.587912087912088 ,
0.653846153846154 , 0.6978021978021978 , 0.7472527472527473 , 0.7912087912087912 ,
0.8516483516483517 , 0.9010989010989012 , 0.9560439560439561 , 0.9945054945054945];
24
25 XC = zeros (10 ,1);
26 Cp = zeros (10 ,1);
27 Cp (1) = 1;
28
28 idx = 2;
29 % find & delete duplicates
30 for i = 2: length ( raw_xc )
31 if ismember ( raw_xc (i),XC)
32 continue
33 else
34 XC(idx) = raw_xc (i);
35 Cp(idx) = raw_cp (i);
36 idx = idx + 1;
37 end
38 end
39 Cp(end) = 1;
40 plot(XC ,Cp)
41
42 %% import data for airfoil coordinates
43 Airfoildata = readtable ('Airfoil_data .xlsx ');
44 xairfoil = Airfoildata {: ,1};
45 yairfoil = Airfoildata {: ,2};
46 yairfoil (1) = 0;
47 yairfoil (end) = 0;
48
49 % Plot airfoil to verify data import
50 % figure ()
51 % plot(Xc ,Yc)
52
53 % get the upper part of airfoil
54 xc_upper = xairfoil (1: ceil( length ( xairfoil )/2) ,:);
55 yc_upper = yairfoil (1: ceil( length ( yairfoil )/2) ,:);
56 % figure ()
57 % plot(Xc_upper , Yc_upper )
58
59 % get lower part of airfoil
60 xc_lower = xairfoil (ceil( length ( xairfoil )/2):end ,:);
61 yc_lower = yairfoil (ceil( length ( yairfoil )/2):end ,:);
62 % figure ()
63 % plot(xc_lower , xc_lower )
64
65 % Define the number of points you want to generate
66 num_points = 100000;
67
68 % Generate higher spaced points with the desired distribution
69 low = 0.1;
70 high = 2-low;
71 xc_new = zeros ( num_points ,1);
72 xc_new (1) = 0;
73 prev = 0;
74 for i = 2: num_points
75 xc_new (i) = prev + distribution (low ,high , num_points ,i);
76 prev = xc_new (i);
77 end
78 xc_new (end) = 1;
79
80
81 % % Plot the histogram
82 % figure ;
83 % histogram (xc_new , 'Normalization ', 'probability ', 'BinWidth ', 0.05) ;
84 % xlabel ('xc ');
85 % ylabel (' Probability ');
86 % title (' Points with Custom Distribution ');
87
29
88
89 % Interpolate points
90 YC_interp_u = interp1 (xc_upper ,yc_upper ,xc_new ," spline ");
91 Cpu = interp1 (XC ,Cp ,xc_new ," pchip ");
92 YC_interp_l = interp1 (xc_lower ,yc_lower ,xc_new ," spline ");
93 Cpl = interp1 (XC ,Cp ,xc_new ," pchip ");
94
95 % figure ()
96 % plot(xc_new ,Cpu)
97
98 % generate refined new airfoil profile
99 Xc_air = zeros (2* num_points -1 ,1);
100 Yc_air = zeros (2* num_points -1 ,1);
101 for i = num_points : -1:1
102 Xc_air (num_points -i+1) = xc_new (i);
103 Xc_air (2* num_points -i) = xc_new ( num_points -i+1);
104 Yc_air (num_points -i+1) = YC_interp_u (i);
105 Yc_air (2* num_points -i) = YC_interp_l ( num_points -i+1);
106 end
107 figure ()
108 plot(xairfoil , yairfoil )
109 hold on
110 plot(Xc_air , Yc_air )
111 axis ([0 1 -1 1])
112
113 s_u = zeros ( num_points ,1);
114 Panels_u = zeros ( num_points ,5);
115 % Generate Panels
116 for i = 1: num_points
117 if i==1
118 s_u(i) = xc_new (i);
119 theta = 0;
120 L = 0;
121 else
122 delX = xc_new (i)-xc_new (i -1);
123 delY = YC_interp_u (i)-YC_interp_u (i -1);
124 L = sqrt(delX ^2 + delY ^2);
125 s_u(i) = s_u(i -1)+sqrt(delX ^2 + delY ^2);
126 theta = atan(delY/delX);
127 end
128
129 Pcurr = [ xc_new (i),YC_interp_u (i)];
130 Panels_u (i ,:) = [s_u(i),L,theta , Pcurr ];
131 end
132
133 % Velocity profile from Cp values
134 U_upper = U_inf *sqrt (1- Cpu);
135 figure ()
136 plot(xc_new , U_upper )
137
138 %% numerical schemes for velocity derivative
139 dudx_upper = zeros (num_points ,1);
140 dudx_lower = zeros (num_points ,1);
141
142
143 dudx_upper (1) = ( U_upper (2) -U_upper (1))/( s_u (2) -s_u (1)); % forward difference scheme
144
145 for i = 2: num_points -1
146 dudx_upper (i) = ( U_upper (i+1) -U_upper (i -1))/( s_u(i+1) -s_u(i -1));
147 end
30
208 Lambda_u (count +1) = Z_u( count +1)* dudx_upper ( count +1);
209 fun = @(x) residue (f, Lambda_u ( count +1) ,x);
210 param_u ( count +1) = fsolve (fun ,x0);
211 H_u(count +1) = H( param_u ( count +1));
212 L_u(count +1) = L( param_u ( count +1));
213 delta_star_u ( count +1) = delta_star ( param_u ( count +1));
214 theta_u ( count +1) = theta ( param_u ( count +1));
215 dZdx_u (count +1) = F( Lambda_u ( count +1))/ U_upper ( count +1);
216 delta_u ( count +1) = sqrt(nu* Lambda_u ( count +1)/ dudx_upper ( count +1));
217 count = count + 1;
218 end
219
220 %% Calculate Pressure
221 Pinf = 101325;
222 P_u = zeros ( num_points ,1);
223 P_u (1: count) = (Pinf + 0.5* rho* U_inf ^2) - 0.5* rho .* U_upper (1: count ).^2;
224 P_u(count +1: end) = P_u( count )*ones( num_points -count ,1);
225 %% Drag Calculation
226
227 Df = 0;% Skin Friction drag
228 Dp = 0;
229 for i = 1: num_points -1
230 delxi = s_u(i+1) -s_u(i);
231 if i<= count
232 Df = Df + 2* mu *( U_upper (i)/ delta_u (i)) *(2+( param_u (i)/6))* delxi ;
233 end
234 thetai = atan (( YC_interp_u (i+1) -YC_interp_u (i))/( xc_new (i+1) -xc_new (i)));
235 Dp = Dp + 2* sin( thetai )* delxi *(( P_u(i)+P_u(i+1))/2);
236 end
237
238 DTotal = Dp+Df;
239 c = 1;
240 Cd = DTotal /(0.5* rho* U_inf ^2*c);
241
242 %% Finding Boundary Layer :
243 BL_upper = zeros (count ,1);
244 BL_lower = zeros (count ,1);
245 for i = 1: count
246 BL_upper (i) = YC_interp_u (i) + delta_u (i);
247 BL_lower (i) = YC_interp_l (i) - delta_u (i);
248 end
249
250 %% Velocities at different locations
251
252 % Max velocity location
253 id_max = find( U_upper == max( U_upper ));
254 n = 1000;
255 targetvel = zeros (n ,4);
256 targety = zeros (n ,4);
257 targetx = zeros (1 ,4);
258 for i = 1:4
259 id = round ( id_max *0.5* i);
260 if id > count
261 id = count -1;
262 end
263 targetx (1,i) = xc_new (id);
264 counter = 1;
265 for j = linspace (0, delta_u (id),n)
266 targety (counter ,i) = j;
267 delta = delta_u (id);
32
323 end