HOME

PDF (letter size)

Analytical solution to specific Stokes’ first problem PDE

Nasser M. Abbasi

June 12, 2017   Compiled on January 28, 2024 at 7:40pm

Solve

(1)ut=k2ux20<x<Lt>0

Initial conditions

u(0,x)=0

Boundary conditions

u(0,t)=sin(t)u(t,L)=0

Let (2)u=v+uE where uE(x,t) is steady state solution that only needs to satisfy boundary conditions and v(x,t) satisfies the PDE itself but with homogenous B.C.  At steady state, the PDE becomes

0=kd2uEdx2uE(0)=sin(t)uE(L)=0

The solution is uE(t)=(LxL)sin(t).  Hence (2) becomes

u(x,t)=v(x,t)+(LxL)sin(t)

Substituting the above in (1) gives

vt+(LxL)cos(t)=k2vx2vt=k2vx2+(xLL)cos(t)(3)vt=k2vx2+Q(x,t)

With boundary conditions u0(0,t)=0,u(L,t)=0. This is now in standard form and separation of variables can be used to solve it. Q(x,t)=(xLL)cos(t) Now acts as a source term. The eigenfunctions are known to be Φn(x)=sin(λnx) where λn=(nπL)2. Hence by eigenfunction expansion, the solution to (3) is

(3A)v(x,t)=n=1Bn(t)Φn(x)

Substituting this into (3) gives

(4)n=1dBn(t)dtΦn(x)=kn=1Bn(t)Φn(x)+Q(x,t)

Expanding Q(x,t) using same basis (eigenfunctions) gives

Q(x,t)=n=1qn(t)Φn(x)

Applying orthogonality

0LQ(x,t)Φm(x)dx=0Ln=1qn(t)Φn(x)Φm(x)dx=n=1qn(t)0LΦn(x)Φm(x)dx

But n=10LΦn(x)Φm(x)dx=0LΦm2(x)dx=L2 since Φn(x)=sin(nπLx) and the above simplifies to

0LQ(x,t)Φn(x)dx=L2qn(t)qn(t)=2L0LQ(x,t)sin(nπLx)dx

But Q(x,t)=(xLL)cos(t), hence

qn(t)=2L0L(xLL)cos(t)sin(nπLx)dx=2nπcos(t)

Therefore Q(x,t)=n=1qn(t)Φn(x)=n=12nπcos(t)sin(nπLx) and (4) becomes

n=1dBn(t)dtΦn(x)=kn=1Bn(t)Φn(x)n=12nπcos(t)sin(nπLx)dBn(t)dtsin(nπLx)=kBn(t)(n2π2L2sin(nπLx))2nπcos(t)sin(nπLx)dBn(t)dt+Bn(t)kn2π2L2=2nπcos(t)

This is an ODE in Bn(t) whose solution is

Bn(t)=Cnek(n2π2L2)t2L2(kn2π2cost+L2sint)nπ(L4+k2n4π4)

From (3A) v(x,t) now becomes

(5)v(x,t)=n=1Cnek(n2π2L2)tsin(nπLx)2L2(kn2π2cost+L2sint)nπ(L4+k2n4π4)sin(nπLx)

To find Cn, from initial conditions, at t=0 the above becomes

0=n=1Cnsin(nπLx)2L2(kn2π2)nπ(L4+k2n4π4)sin(nπLx)

Hence

Cn=2L2(kn2π2)nπ(L4+k2n4π4)

Therefore (5) becomes

v(x,t)=n=1(2L2(kn2π2)nπ(L4+k2n4π4)ek(n2π2L2)t2L2(kn2π2cost+L2sint)nπ(L4+k2n4π4))sin(nπLx)

And since u=v+uE then the solution is

u(x,t)=(n=1(2L2(kn2π2)nπ(L4+k2n4π4)ek(n2π2L2)t2L2(kn2π2cost+L2sint)nπ(L4+k2n4π4))sin(nπLx))+(LxL)sin(t)

To simulate

ClearAll[t, x, n] 
k = 1; L0 = 5; max = 400; 
u[x_, t_] = 
Sum[(((2*L0^2*(k*n^2*Pi^2))/(n*Pi*(L0^4 + k^2*n^4*Pi^4)))* 
      Exp[(-k)*((n^2*Pi^2)/L0^2)*t] - 
      (2*L0^2*(k*n^2*Pi^2*Cos[t] + L0^2*Sin[t]))/(n* 
      Pi*(L0^4 + k^2*Pi^4*n^4)))*Sin[((n*Pi)/L0)*x], 
      {n, 1, max}] + ((L0 - x)/L0)*Sin[t]; 
 
Manipulate[Grid[{{"Analytical solution"}, 
     {Plot[Evaluate[u[x,t]],{x,0,5},PlotRange->{{0,5},{-1.1,1.1}}, 
     ImageSize->400]}}], 
     {{t,0,"t"},0,100,.01} 
]
 

Here is the animation from the above

  

Here is the numerical solution to compare with

ClearAll["Global`*"]; 
pdeset = {Derivative[1, 0][U][t, x] == Derivative[0, 2][U][t, x]} 
ics = {U[0, x] == 0}; 
bcs = {U[t, 0] == Sin[t], U[t, 5] == 0}; 
ibcAll = {ics, bcs}; 
 
numericalSol = NDSolve[{pdeset, ibcAll}, U, {t, 0, 100}, {x, 0, 5}]; 
 
Manipulate[Grid[{{"Numerical solution"}, 
       {Plot[Evaluate[U[t, x] /. numericalSol], {x, 0, 5}, 
       PlotRange -> {{0, 5}, {-1, 1}}, ImageSize -> 400]}}], 
       {{t, 0, "t"}, 0, 100, .01} 
]
 

Here is the animation from the above

  

Reference: stokes second problem question and answer