Numerical Solution of the Falkner – Skan Equation

Falkner – Skan equation is a third order non-linear ordinary differential equation which arises in the laminar boundary layer flow past wedge-like objects. (More details here). The equation reads,

f'''+\frac{m+1}{2}ff''+m\left[1-(f')^2\right]= 0

where m is a constant representing the pressure gradient parameter. Our objective is to solve this differential equation for f(\eta) , for a given value of m using the boundary conditions,

f(0)=0 \quad \rightarrow \text{no wall transpiration}

f'(0)=0 \quad \rightarrow \text{ no-slip condition at the wall}

f'(1)=1 \, \rightarrow \text{free-stream velocity is reached at the edge of the boundary layer}

Generally, initial value problems (IVP) are preferred for ODEs. In the case of IVP, We will be given where to start and which direction to proceed. Then we use the differential equation to progress in that direction in a step by step manner. But here we have a boundary value problem. Shooting method is used in situations where a boundary value problem has to be solved using initial value methods. The method is described as follows.

Shooting method:

  1. Guess two values for f''(0).
  2. Solve the FS equation using RK4 method with initial conditions f(0)=0, f'(0)=0, f''(0) = Guess1.
  3. Solve the FS equation using RK4 method with initial conditions  f(0)=0, f'(0)=0, f''(0) = Guess2.
  4. Find out the resulting boundary value f'(1) from both these solutions.
  5. If the boundary value f'(1) is different from the required value f'(1)=1, find a better initial guess using Secant method.
  6. Solve the FS equation by RK4 method using the new initial value guess (obtained from secant method).
  7. Repeat the process until the required boundary value f'(1) is obtained.

A Fortran program for solving the Falkner-Skan equation implementing the above algorithm is provided below. (Click on any part of the code and use right arrow key to scroll to right).


PROGRAM FALKNER_SKAN
! This program solves the Falkner-Skan equation using Shooting method and fourth order Runge-Kutta method.
! The FS equation is given by,
! f'''+((m+1)/2)ff''+ m*(1-f'^2) = 0
! m,the pressure gradient parameter, as in U_inf=U0*x^m.
! Boundary conditions: f(0)=0, f'(0)=0, f'(1)=1
! The third order ODE is converted into a system of three first order ODEs where the
! dependent variables are f, u (=f'), v (=u'=f'').
! We solve the initial value problem f(0)=0,f'(0)=0, f''(0)=guess and shoot for solutions such that f'(1)=1.

IMPLICIT NONE
INTEGER :: I,J,NP,NITER
REAL,ALLOCATABLE,DIMENSION(:) :: F,U,V,ETA
REAL :: M,MH,Re,UE,F0,U0,V0,DETA,X,EPS,CNU,SLOPE,UNP,UNP1,VNP,VNP1
REAL,ALLOCATABLE,DIMENSION(:) :: VVEL,Y,VVEL1
REAL :: delta_star_temp,theta_temp,DELTAS,THETA

NITER=1000 ! No. of iterations for the shooting method
DETA=0.001 ! Non-dimensional spacing in the wall-normal direction
NP=8001 ! No. of points in the wall-normal direction
EPS=1.0E-16 ! Error margin used in shooting method iteration
M=0.0 ! Falkner-Skan pressure gradient parameter
MH=0.5*(M+1.0)

ALLOCATE(F(NP),U(NP),V(NP),ETA(NP),VVEL(NP),VVEL1(NP),Y(NP))

! Form the grid in the wall-normal direction
ETA(1)=0.0
DO J=2,NP
ETA(J)=ETA(J-1)+DETA
ENDDO

! INITIAL VALUES SET 1
F0=0.0
U0=0.0
V0=0.335

CALL RK4_FS(F,U,V,DETA,MH,M,NP,F0,U0,V0)

VNP=V(1)
UNP=U(NP)

! INITIAL VALUES SET 2
F0=0.0
U0=0.0
V0=0.33

CALL RK4_FS(F,U,V,DETA,MH,M,NP,F0,U0,V0)

VNP1=V(1)
UNP1=U(NP)

! Loop for the shooting method ********************************************************************
DO I=1,NITER
IF (ABS(UNP1-1.0) .GE. EPS) THEN
SLOPE=(VNP1-VNP)/(UNP1-UNP)
V0=VNP1+SLOPE*(1.0-UNP1)
UNP=UNP1
VNP=VNP1
CALL RK4_FS(F,U,V,DETA,MH,M,NP,F0,U0,V0)
VNP1=V(1)
UNP1=U(NP)
ELSE
WRITE(*,*) 'Iteration converged'
WRITE(*,*) 'V(1)=',V(1)
EXIT
ENDIF

IF(I .EQ. NITER) THEN
WRITE(*,*) 'Maximum number of iterations reached'
ENDIF

ENDDO

! End of shooting method **************************************************************************

DO J=1,NP
WRITE(38,*) ETA(J),F(J),U(J),V(J) ! THESE ARE TRANSFORMED VARIABLES - INPUT FOR BOX METHOD
ENDDO

! Calculation of normal velocity component profile
X=0.1
U0=1.0
UE=U0*(X**M)
CNU=15.0E-06
Re=UE*X/CNU
DO J=1,NP
Y(J)=ETA(J)*SQRT(CNU*X/UE) ! Distance from the wall in meters
VVEL(J)=-((M-1.0)*ETA(J)*U(J)+(M+1.0)*F(J))*(0.5/SQRT(Re)) ! VVEL=V/U_inf
WRITE(48,*) ETA(J),U(J),VVEL(J),Y(J),U(J)*UE,VVEL(J)*SQRT(Re)
ENDDO

! Calculation of boundary layer parameters
theta_temp = 0.0
delta_star_temp = 0.0
DO I = 1,(NP-1)
theta_temp = theta_temp + 0.5*(ETA(I+1)-ETA(I))*(U(I+1)*(1.0-U(I+1)) + U(I)*(1.0-U(I)) )
delta_star_temp = delta_star_temp + 0.5*(ETA(I+1)-ETA(I))*((1.0-U(I+1))+(1.0-U(I)))
ENDDO

DELTAS=delta_star_temp*X/SQRT(Re)
THETA=theta_temp*X/SQRT(Re)

WRITE(*,*) '************************************************************************'
WRITE(*,*) 'Solution of the Falkner-Skan Equation'
WRITE(*,*) '************************************************************************'
WRITE(*,'(A,F8.5)') 'Pressure gradient parameter, m=',M
WRITE(*,'(A,F8.5,A)') 'Distance from the leading edge, X=',X,' m'
WRITE(*,'(A,F8.2)') 'Re = U_inf*x/cnu = ',Re
WRITE(*,'(A,F8.5,A)') 'Displacement thickness, delta*=',DELTAS,' m'
WRITE(*,'(A,F8.5,A)') 'Momentum thickness, theta=',THETA,' m'
WRITE(*,*) '************************************************************************'

CALL SYSTEM('gnuplot -p FS.plt')

RETURN
END PROGRAM FALKNER_SKAN

SUBROUTINE RK4_FS(F,U,V,DETA,MH,M,NP,F0,U0,V0)
! Subroutine for solving a system of three first order ODEs with fourth order Runge-Kutta method
! F0,U0,V0 are the initial values
! F,U,V arrays give the solution
! Initial values are propagated to NP steps using step spacing DETA.
INTEGER :: J
REAL :: KF(4),KU(4),KV(4)
REAL,INTENT(IN) :: M,MH,DETA,F0,U0,V0
INTEGER,INTENT(IN) :: NP
REAL :: F(NP),U(NP),V(NP)

F(1)=F0
U(1)=U0
V(1)=V0

DO J=2,NP
KU(1)=V(J-1)
KF(1)=U(J-1)
KV(1)=-MH*F(J-1)*V(J-1)-M*(1.0-U(J-1)*U(J-1))

KU(2)=V(J-1)+0.5*KV(1)*DETA
KF(2)=U(J-1)+0.5*KU(1)*DETA
KV(2)=-MH*(F(J-1)+0.5*KF(1)*DETA)*(V(J-1)+0.5*KV(1)*DETA)-M*(1.0-(U(J-1)+0.5*KU(1)*DETA)**2)

KU(3)=V(J-1)+0.5*KV(2)*DETA
KF(3)=U(J-1)+0.5*KU(2)*DETA
KV(3)=-MH*(F(J-1)+0.5*KF(2)*DETA)*(V(J-1)+0.5*KV(2)*DETA)-M*(1.0-(U(J-1)+0.5*KU(2)*DETA)**2)

KU(4)=V(J-1)+KV(3)*DETA
KF(4)=U(J-1)+KU(3)*DETA
KV(4)=-MH*(F(J-1)+KF(3)*DETA)*(V(J-1)+KV(3)*DETA)-M*(1.0-(U(J-1)+KU(3)*DETA)**2)

F(J)=F(J-1)+(1.0/6.0)*DETA*(KF(1)+2.0*KF(2)+2.0*KF(3)+KF(4))
U(J)=U(J-1)+(1.0/6.0)*DETA*(KU(1)+2.0*KU(2)+2.0*KU(3)+KU(4))
V(J)=V(J-1)+(1.0/6.0)*DETA*(KV(1)+2.0*KV(2)+2.0*KV(3)+KV(4))
ENDDO

END SUBROUTINE RK4_FS

Line 114 in the above code calls the gnuplot program FS.plt to plot the solution. The most relevant plots for fluid dynamics in this problem are the streamwise velocity profile f'(\eta) and the wall-normal velocity profile given by,

\frac{v}{U}=-\frac{1}{2\sqrt{Re_x}}\left[ (m+1)f+(m-1)\eta f' \right]

Sample results for the case m=0 (Blasius boundary layer) are shown below.
u

v

6 thoughts on “Numerical Solution of the Falkner – Skan Equation”

  1. Hello,

    I notice that, once I change NP (everything else remains unchanged, m = 1 in my case), I receive ‘NAN’ error. I tried to increase NP to 72001 instead of original 8001 it did not work. I also tried 9001, it ‘partially’ worked, but ‘V(1)’ changed significantly. Would you know I shall I fix it?

    I also have a quick question, if you do not mind. If I need to change m to some other value, how could I quickly set two reasonable initial values for V0?

    Thanks for the help!

    Reply
    • Hi,
      I have noticed such behavior as well. From what I understand, it is related to the approximate boundary layer thickness used for solving the problem. For example, by simply increasing NP, we are increasing the domain of solution. But if this domain length (NP*DETA) far exceeds 8*delta (where delta is the usual scale of boundary layer thickness that can be estimated from laminar boundary layer theory), the numerical approach seem to fail and blows up or falls short of the freestream value. It is theoretically true that this domain length should not affect the final solution since the freestream boundary condition is applied at infinity. But the numerical approach seems to have a problem with that.

      The value of the initial guess for the second derivative is by trial and error. We normally expect the shooting method to work with two good positive values (since this corresponds to the wall shear stress). And you can estimate a good guess from the known value for the m=0 case problem. Note that changing ‘m’ corresponds to changing the acceleration in the flow which helps to determine whether the wall shear stress increases or decreases. But, this equation is non-linear and its behavior drastically changes under different parametric spaces. It is not guaranteed that a particular guess will work correctly and the freestream velocity will be smoothly approached by the solution. There are other, better, numerical approaches to deal with tricky situations. But, since the shooting method is simple to understand and apply, it is presented here. You can check out the book ‘Fundamentals of engineering numerical analysis’ by Parviz Moin which discusses some of these methods.

      Reply

Leave a Comment