Suggested solutions Couette

Solutions written assignments Couette

Problem 3-1 in White

Solve for a non-Newtonian Couette flow, where the stress tensor is computed as

\[ \tau = K\left(\frac{\mathrm{d}u}{\mathrm{d}y}\right)^n, \]

where \(n\) is an integer different from 1. The momentum equation for any stress tensor in a Couette flow is

\[ 0 = \nabla \cdot \tau. \]

For one-dimensional Couette flow aligned with the \(x\)-direction and homogeneous in the \(z\)-direction, the equation reads

\[ 0 = \frac{\mathrm{d} \tau}{\mathrm{d}y}, \]

which means that \(\tau\) is a constant with respect to \(y\) and thus

\[ K\left(\frac{\mathrm{d}u}{\mathrm{d}y}\right)^n = K_2, \]

where \(K_2\) is a new constant. In other words

\[ \frac{\mathrm{d}u}{\mathrm{d}y} = K_3 \left(= (K_2/K)^{1/n}\right), \]

and thus

\[ u = K_3 y + K_4. \]

The solution is the same as for Newtonian flows regardless of \(n\).

Problem 3-2 in White

The analytical solution has already been computed in Eq. (10) in Couette flows.

Problem 3-3 in White

The temperature equation reduces to

\[ 0 = \frac{\kappa}{r}\frac{\mathrm{d}}{\mathrm{d} r}\left(r \frac{\mathrm{d} T}{\mathrm{d} r} \right) + \mu \left(\frac{\mathrm{d} u_z}{\mathrm{d}r} \right)^2. \]

Inserting for Eq. (10) we have

\[ \frac{\mathrm{d}}{\mathrm{d} r}\left(r \frac{\mathrm{d} T}{\mathrm{d} r} \right) = -\frac{\mu U_0^2}{\kappa r \ln^2(r_1/r_0)}. \]

Integrate twice to obtain

\[ T = -\frac{\mu U_0^2}{2 \kappa \ln^2(r_1/r_0)} \ln^2(r) + C_1\ln(r) + C_2, \]

and determine constants using the two boundary conditions.

Problem 3-4 in White

The problem reads: solve the Laplace equation in cylindrical coordinates (8) with boundary conditions \(u(0)=U\) and \(u(\infty)=0\). The solution for the velocity is given in Eq. (9) and inserted for the boundary conditions we need to find \(C_1\) and \(C_2\) such that

\[\begin{split} \begin{aligned} u(0) = U &= C_1 \ln(0) + C_2, \\ u(\infty) = 0 &= C_1 \ln(\infty) + C_2. \end{aligned} \end{split}\]

The first condition requires \(C_1=0\) and thus \(C_2=U\). The second condition requires \(C_2=0\), which is a contradiction. It is not possible to satisfy both boundary conditions. Physically, the boundary layer that is being dragged by the rod will continue to grow indefinitely and there is no steady state solution possible for this problem.

Problem 3-5 in White

Solve the momentum equation for the angular velocity

\[ \frac{\mathrm{d}^2 u_{\theta}}{\mathrm{d} r^2} + \frac{\mathrm{d} u_{\theta}/r}{\mathrm{d}r} = 0 \label{eq:AngularVel} \]

with boundary conditions \(u(R)=\omega R\) and \(u(\infty)=0\). The solution to this equation is given by [Whi06]

\[ u_{\theta}(r) = C_1 r + \frac{C_2}{r} \]

The boundary conditions are then

\[\begin{split} \begin{aligned} u_{\theta}(R) = \omega R &= C_1 R + \frac{C_2}{R}, \\ u_{\theta}(\infty) = 0 &= C_1 \infty + \frac{C_2}{\infty} \end{aligned} \end{split}\]

which leads to \(C_1=0\) and \(C_2=\omega R^2\) and thus the angular velocity

\[ u_{\theta} = \frac{\omega R^2}{r}, \]

which agrees with the solution of a potential vortex. The pressure is found from the r-momentum equation

\[\begin{split} \begin{aligned} \frac{\mathrm{d} p}{\mathrm{d} r} &= \frac{\rho u_{\theta}^2}{r}, \\ \frac{\mathrm{d} p}{\mathrm{d} r} &= \frac{\rho \omega^2 R^4}{r^3} \end{aligned} \end{split}\]

which can be integrated to

\[ p(r) = -\frac{\rho \omega^2 R^4}{2 r^2} + C_1 \]

and where the constant can be found by assuming \(p(R)=p_0\) such that

\[ p(r) = p_0 + \frac{\rho \omega^2 R^2}{2}\left(1 - \frac{R^2}{r^2} \right), \]

which is what we would find using Bernoulli’s equation for a potential vortex (\(p_0+0.5\rho (\omega R)^2 = p + 0.5 \rho u^2\)).

Homogeneous heat equation with inhomogeneous boundary conditions

We consider the additional problem Homogeneous heat equation with inhomogeneous boundary conditions.

Introducing the function \(\boldsymbol{U}(y, t) = 1/L[(L-y)g(t) + y h(t)]\) and \(v(y, t) = u(y, t) - \boldsymbol{U}(y, t)\) we obtain an inhomogeneous heat equation with homogeneous boundary conditions as given in Hint 2. The right hand side function, boundary conditions and initial conditions can be found straight forward as

\[\begin{split} \begin{aligned} f(y, t) &= -\frac{\partial \boldsymbol{U}}{\partial t} = -(1-\frac{y}{L})g'(t) + \frac{y}{L} h'(t)\\ v(y, 0) &= \overline{\phi}(y) = \phi(y) - \boldsymbol{U}(y, 0), \\ v(0, t) &= v(L, t) = 0. \end{aligned} \end{split}\]

The solution to the homogeneous part of the problem can be found using separation of variables \(v^h(y, t) = T(t) V(y)\)

\[ \frac{\dot{T}}{\nu T} = \frac{V''}{V} = -\lambda^2 \]

and thus \(T(t) = e^{-\lambda^2 \nu t}\). The boundary conditions give \(V(y) = A \sin(\lambda y)\) and to satisfy initial conditions we need to use superposition and a range of solutions. The homogeneous solution thus reads

\[ v^h(y, t) = \sum_{n=1}^{\infty} A_n \sin(\lambda_n y) e^{-\lambda_n^2 \nu t}, \]

where we can find \(A_n\) using the initial condition and orthogonality, i.e., multiply \(v^h(y,0)(=\overline{\phi}(y))\) by \(\sin(\lambda_m y)\) and integrate to obtain

\[\begin{split} \begin{aligned} A_n &= \frac{1}{L} \int_{-L}^{L} \overline{\phi}(y) \sin(\lambda_n y) \mathrm{d}y, \\ &= \frac{2}{L} \int_{0}^{L} \overline{\phi}(y) \sin(\lambda_n y) \mathrm{d}y, \label{eq:AnHomo} \end{aligned} \end{split}\]

where the last step follows if \(\overline{\phi}(y)\) is an odd function. The solution to the inhomogeneous part of the problem reuses the homogeneous solution, but replaces \(\overline{\phi}(y)\) with \(f(y,s)\) when computing the coefficients. We thus replace \(A_n\) with \(B_n(t)\) and compute it as

\[ B_n(t) = \frac{2}{L} \int_0^{L} \sin(\lambda_n y) f(y, t) \mathrm{d}y \]

Using superposition in time the inhomogeneous solution is thus

\[ v^p(y, t) = \int_0^t \sum_{n=1}^{\infty} e^{-\lambda_n^2 \nu (t-s)} B_n(s) \sin(\lambda_n y) \mathrm{d}s, \]

and the general solution to our original problem is

\[ u(y, t) = v^h(y, t) + v^p(y, t) + \boldsymbol{U}(y, t). \]
  • Specific solution where \(g(t) = U_0 \cos (\omega t)\), \(h(t)=0\) and \(\phi(y)=U_0(1-y/L)\). The problem now reads for \(v(y,t) = u(y, t) - \boldsymbol{U}(y, t)\)

    \[\begin{split} \begin{aligned} \frac{\partial v}{\partial t} - \nu \frac{\partial ^2 v}{\partial y^2} &= f(y, t) = U_0 \omega (1-\frac{y}{L}) \sin(\omega t) , \quad \mathrm{ for }\quad 0 \leq y \leq L \\ \notag v(y, 0) &= U_0(1-\frac{y}{L}) - U_0(1- \frac{y}{L}) = 0, \\ \notag v(0, t) &= v(L, t) = 0, \end{aligned} \end{split}\]

    and naturally the homogeneous solution is identically zero, i.e., \(v^h(y, t) = 0\). The inhomogeneous contribution to the total solution is found by computing \(B_n\) and \(v^p\). Both integrals can be obtained using Wolfram alpha, the first one reads

    \[\begin{split} \begin{aligned} B_n(t) &= \frac{2}{L} \int_0^L \sin(\lambda_n y) U_0 \omega (1-\frac{y}{L}) \sin(\omega t) \mathrm{d}y, \\ &= \frac{2 U_0 \omega \sin(\omega t)}{\lambda_n L}. \end{aligned} \end{split}\]

    Inserted into the equation for \(v^p\) one obtains

    \[ v^p(y, t) = \frac{2 U_0 \omega }{L} \int_0^t \sum_{n=1}^{\infty} \frac{\sin(\lambda_n y)}{\lambda_n} e^{-\lambda_n^2 \nu (t-s)}\sin(\omega s) \mathrm{d}s, \]

    which Wolfram alpha tells me is equal to

    \[ v^p(y, t) = \frac{2 U_0 \omega }{L} \sum\limits_{n=1}^{\infty} \frac{\sin(\lambda_n y)}{\lambda_n} \left(\frac{\nu\lambda_n^2\sin(\omega t)-\omega\cos(\omega t) + \omega e^{-\lambda_n^2\nu t}}{\omega^2 + \lambda_n^4\nu^2}\right). \]

    The total solution is thus \(u(y, t) = v^p(y,t) + U_0\cos(\omega t) (1-y/L)\).

Flow between rotating concentric cylinders

"""
Flow between rotating concentric cylinders
"""
from dolfin import *
import matplotlib.pyplot as plt
%matplotlib inline

r0, r1 = 0.2, 1
mesh = IntervalMesh(100, r0, r1)
V = FunctionSpace(mesh, 'CG', 1)
u = TrialFunction(V)
v = TestFunction(V)
x = Expression("x[0]", degree=1)
w0, w1 = Constant(1.), Constant(0.1)
T0, T1 = Constant(8), Constant(10)
mu = Constant(0.25)
k  = Constant(0.001)
u_ = Function(V)
T_ = Function(V)
F  = inner(grad(v), grad(u))*x*dx + u*v/x*dx
FT = inner(grad(v), grad(u))*x*dx - mu/k*v*x*(u_.dx(0)-u_/x)**2*dx

def inner_bnd(x, on_bnd):
    return on_bnd and x[0] < r0+DOLFIN_EPS

def outer_bnd(x, on_bnd):
    return on_bnd and x[0] > 1-DOLFIN_EPS

bci = DirichletBC(V, r0*w0(0), "std::abs(x[0]-{}) < 1.e-12".format(r0))
bco = DirichletBC(V, r1*w1, outer_bnd)
bcTi = DirichletBC(V, T0, inner_bnd)
bcTo = DirichletBC(V, T1, outer_bnd)

solve(lhs(F) == rhs(F), u_, bcs=[bci, bco])
solve(lhs(FT) == rhs(FT), T_, bcs=[bcTi, bcTo])

# Compute exact solution given in (3.22)
ue = project(r0*w0*(r1/x-x/r1)/(r1/r0-r0/r1) +
             r1*w1*(x/r0-r0/x)/(r1/r0-r0/r1), V)

# Compute exact solution given in (3.23)
Tn = project((T_-T0)/(T1-T0), V)
PrEc = mu*r0**2*w0**2/k/(T1-T0)
Te = PrEc*r1**4/(r1**2-r0**2)**2*((1-r0**2/x**2) - (1-r0**2/r1**2)*ln(x/r0)/ln(r1/r0)) + ln(x/r0)/ln(r1/r0)
Te = project(Te, V)

print("\nError velocity    = ", errornorm(u_, ue, degree_rise=0))
print("Error temperature = ", errornorm(Tn, Te, degree_rise=0))
print("??? Should be close to zero.\n")

plt.figure()
plt.plot(u_.vector().get_local())
plt.plot(ue.vector().get_local())
plt.title("Angular velocity")
plt.legend(('Computed', 'Exact'))
plt.figure()
plt.plot(Tn.vector().get_local())
plt.plot(Te.vector().get_local())
plt.title("Temperature (?wrong?)")
plt.legend(('Computed', 'Exact'))

# Since I cannot reproduce the temperature I have recomputed
# (3.23) analytically. I plot that result here
C1 = w0-r1**2*(w1-w0)/(r0**2-r1**2)
C2 = r1**2*(w1-w0)/(1-r1**2/r0**2)
C3 = (T1-T0+C2**2*mu/k*(1/r1**2-1/r0**2))/ln(r1/r0)
C4 = T0 + C2**2*mu/k/r0**2-C3*ln(r0)
Tee = project((-C2**2*mu/k/x**2+C3*ln(x)+C4-T0)/(T1-T0), V)

print("\nError recomputed temperature = ", errornorm(Tn, Tee))
print("Which is a strong indication that (3.23) is wrong!!")
plt.show()

Error velocity    =  1.1540847636407312e-05
Error temperature =  0.20666794167009878
??? Should be close to zero.


Error recomputed temperature =  0.000492714248321644
Which is a strong indication that (3.23) is wrong!!
../../../_images/couette_8_1.png ../../../_images/couette_8_2.png