Similarity solution vs. Chebyshev collocation — short-contact-time limit (BSL, Transport Phenomena, §18.9).

Description

Liquid B flows in laminar motion down a vertical wall of film thickness δ. For 0 < z < L the wall is coated with a slightly soluble species A. Because the contact time is short, A penetrates only a thin boundary layer next to the wall, where the parabolic film velocity is well approximated by the linear profile
v
z
=ay
, with
a=ρgδ/μ
. The concentration of A then obeys (Eq. 18.9-2):
ay
∂
c
A
∂z
=

AB
2
∂
c
A
∂
2
y
with
c
A
= 0 at z = 0,
c
A
=
c
A0
(solubility) at y = 0, and
c
A
 0 as y  ∞.
​
This notebook solves the problem in two independent ways and compares them.

Method 1: similarity (combination-of-variables) solution

With η defined below and f =
c
A
/
c
A0
, the PDE collapses to an ODE (Eq. 18.9-6) with f(0) = 1 and f(∞) = 0:
η=y
1
3
a
9

AB
z
=
Y
1
3
(9Z)
′′
f
+3
2
η
′
f
=0
The ODE is solved numerically with NDSolve, truncating ∞ at ηmax (variable etaMax), and compared with the analytical result (Eq. 18.9-10), written with the incomplete gamma function: ​f(η) =
Γ
1
3
,
3
η

Γ
1
3

A semi-log error plot shows the NDSolve vs. analytical discrepancy.

Method 2: Chebyshev collocation vs. NDSolve (method of lines)

Scaling y with the diffusion-layer thickness at the end of the wall, Y = y/
1/3
(_ABL/a)
, Z = z/L and c =
c
A
/
c
A0
, removes all parameters from the PDE:
Y
∂c
∂Z
=
2
∂
c
∂
2
Y
with c = 1 at Y = 0, c = 0 at Y = Ly, and c = 0 at Z = 0. Here η = Y/(9Z)^(1/3), so the exact local flux at the wall is:
-
∂c
∂Y

Y=0
=
-
1
3
(9Z)
Γ
4
3

◼
  • Nodes y_i = Cos[i π/Np], i = 0 ... Np (Np = 20), with the Chebyshev–Gauss–Lobatto differentiation matrix Add and its square Bdd (second derivative).
  • ◼
  • Nodes are mapped to Y = Ly (1 + y)/2, so node 1 is the far edge (Y = Ly) and node Np+1 is the wall (Y = 0). Second derivatives scale by (2/Ly)^2.
  • ◼
  • Interior nodes give ODEs in Z (Y
    c
    i
    ’ =
    2
    (2/Ly)
    Σj Bdd(i,j)
    c
    j
    ); the two end nodes are algebraic boundary conditions. NDSolve integrates this DAE system from Z = 0 to 1.
  • ◼
  • The profile at Z = zEval (0.1) is plotted as points (p1) against the similarity solution fExact[Y/(9 zEval)^(1/3)] as a red curve (p2), and the maximum nodal error is quite small and equal to
    5.02162×
    -6
    10
    .
  • Limitations

    ◼
  • The far-field condition c(Ly) = 0 is only accurate while Ly/(9Z)^(1/3) is large. Ly = 4 and Z = 0.1 give a ratio of about 4.14, which is adequate; for results up to Z = 1 use Ly ≥ 6 and a larger Np.
  • Similarity Solution

    Similarity solution with NDSolve
    etaMax=2.7;​​solODE=NDSolve[{f''[eta]+3eta^2f'[eta]==0,f[0]==1,f[etaMax]==0},f,{eta,0,etaMax}];
    Analytical similarity solution (Eq. 18.9-10)
    fExact[eta_]:=Gamma[1/3,eta^3]/Gamma[1/3];
    Compare profiles
    Plot{Evaluate[f[eta]/.solODE],fExact[eta]},{eta,0,3},
    
    Out[]=
    NDSolve
    Analytical
    Error plot
    LogPlotEvaluate[(f[eta]/.solODE)-fExact[eta]],{eta,0,etaMax},
    
    Out[]=

    Solution based on Chebyshev orthogonal collocation

    Np = number of collocation intervals, giving Np+1 = 21 collocation points. Accuracy of the spectral method grows rapidly with Np.
    In[]:=
    Np=20;
    Corner entry D[0,0] of the differentiation matrix. The four corners, the diagonal, the edges and the interior each obey a different closed-form expression, so they are defined case by case below.
    In[]:=
    d[0,0]=(2Np^2+1)/6//N;
    Opposite corner entry D[Np,Np] = -D[0,0] (the matrix is centro-antisymmetric).
    In[]:=
    d[Np,Np]=-(2Np^2+1)/6//N;
    Chebyshev-Gauss-Lobatto collocation points y_i = cos(i Pi/Np). These run from y = 1 (i = 0) down to y = -1 (i = Np) and cluster near the two ends, which is what suppresses the oscillations a uniform grid would produce.
    In[]:=
    y[i_]:=Cos[iPi/Np]//N;
    Diagonal entries for the interior nodes (0 < i < Np).
    In[]:=
    d[i_,i_]:=-y[i]/(2(1-y[i]^2))//N;
    Off-diagonal entries D[j,k] for interior rows and columns, j != k. The alternating sign (-1)^(j+k) and the node spacing y[j]-y[k] come from differentiating the Lagrange cardinal polynomials at the grid points.
    In[]:=
    d[j_,k_]:=If[j≠k&&k≠0&&k≠Np&&j≠0&&j≠Np,(-1)^(j+k)/(y[j]-y[k])]//N;
    Remaining corner entry D[Np,0].
    In[]:=
    d[Np,0]=-1/2(-1)^Np;
    Remaining corner entry D[0,Np].
    In[]:=
    d[0,Np]=1/2(-1)^Np;
    First column: interior rows j, column 0.
    In[]:=
    d[j_,0]:=If[j≠Np&&j≠0,-1/2(-1)^j/(1-y[j])];
    Last column: interior rows j, column Np.
    In[]:=
    d[j_,Np]:=If[j≠Np&&j≠0,1/2(-1)^(j+Np)/(1+y[j])];
    First row: row 0, interior columns j. Note the factor 2 -- the boundary rows carry the Chebyshev weight c_0 = c_Np = 2 while interior nodes have c = 1.
    In[]:=
    d[0,j_]:=If[j≠Np&&j≠0,2(-1)^j/(1-y[j])];
    Last row: row Np, interior columns j.
    In[]:=
    d[Np,j_]:=If[j≠Np&&j≠0,-2(-1)^(j+Np)/(1+y[j])];
    Assemble all of the above into Add, the (Np+1)x(Np+1) first-derivative operator. Multiplying a vector of nodal values by Add returns the vector of first derivatives at those nodes.
    In[]:=
    Add=Table[d[i,j]//N,{i,0,Np},{j,0,Np}];
    The second-derivative operator is simply the first-derivative matrix applied twice: Bdd = Add . Add.
    In[]:=
    Bdd=Add.Add;
    Chebyshev collocation solution of the same two-component problem (method of lines). The first-derivative matrix Add and the second-derivative matrix Bdd defined above are mapped from y in [-1,1] to z in [0,L] and used to discretise dc/dz and d2c/dz2. Use Np >= 60 (set to 100 in the Np cell above): the injected band is only ~1 cm wide, so Np = 10 is too coarse.
    Dimensionless problem: Y dc/dZ = d2c/dY2, c(Y=0)=1, c(Y=Ly)=0, c(Z=0)=0
    Ly=4.0;(*wall-normaldomainlengthinY*)
    Y-coordinate of each Chebyshev node (node 1 -> Y=Ly, node Np+1 -> Y=0)
    LHS needs Y = Ly*yp (you had only yp)
    Initial condition must agree with the wall BC (c = 1 at Y = 0)
    Max error at the nodes
    Note: c(Ly)=0 is only accurate while Ly/(9 Z)^(1/3) is large here equal to 4.1429
    For Z up to 1 use Ly >= 6 and a larger Np

    References

    R. B. Bird, W. E. Stewart and E. N. Lightfoot, Transport Phenomena, 2nd ed., John Wiley & Sons, New York, 2002 (ISBN 0-471-41077-2), §18.9 “Diffusion into a Falling Liquid Film (Solid Dissolution)”, pp. 545–547, Eqs. 18.9-1 to 18.9-12 and Fig. 18.9-1.

    CITE THIS NOTEBOOK

    Diffusion into a falling liquid film (solid dissolution)​
    by Housam Binous​
    Wolfram Community, STAFF PICKS, October 17, 2026
    https://community.wolfram.com/t/28355