Many mathematical models involve \(m+1\) unknown functions governed by a system of \(m+1\) differential equations. In abstract form we may denote the unknowns by \(u^{(0)},\ldots, u^{(m)}\) and write the governing equations as
where \(\mathcal{L}_i\) is some differential operator defining differential equation number \(i\).
Variational forms¶
There are basically two ways of formulating a variational form for a system of differential equations. The first method treats each equation independently as a scalar equation, while the other method views the total system as a vector equation with a vector function as unknown.
Sequence of scalar PDEs formulation¶
Let us start with the approach that treats one equation at a time. We multiply equation number \(i\) by some test function \(v^{(i)}\in V^{(i)}\) and integrate over the domain:
Terms with second-order derivatives may be integrated by parts, with Neumann conditions inserted in boundary integrals. Let
such that
where \(B^{(i)}\) is a boundary function to handle nonzero Dirichlet conditions. Observe that different unknowns live in different spaces with different basis functions and numbers of degrees of freedom.
From the \(m\) equations in the variational forms we can derive \(m\) coupled systems of algebraic equations for the \(\Pi_{i=0}^{m} N_i\) unknown coefficients \(c_j^{(i)}\), \(j=0,\ldots,N_i\), \(i=0,\ldots,m\).
Vector PDE formulation¶
The alternative method for deriving a variational form for a system of differential equations introduces a vector of unknown functions
a vector of test functions
with
With nonzero Dirichlet conditions, we have a vector \(\boldsymbol{B} = (B^{(0)},\ldots,B^{(m)})\) with boundary functions and then it is \(\boldsymbol{u} - \boldsymbol{B}\) that lies in \(\boldsymbol{V}\), not \(\boldsymbol{u}\) itself.
The governing system of differential equations is written
where
The variational form is derived by taking the inner product of the vector of equations and the test function vector:
Observe that (4) is one scalar equation. To derive systems of algebraic equations for the unknown coefficients in the expansions of the unknown functions, one chooses \(m\) linearly independent \(\boldsymbol{v}\) vectors to generate \(m\) independent variational forms from (4). The particular choice \(\boldsymbol{v} = (v^{(0)},0,\ldots,0)\) recovers (1), \(\boldsymbol{v} = (0,\ldots,0,v^{(m)}\) recovers (3), and \(\boldsymbol{v} = (0,\ldots,0,v^{(i)},0,\ldots,0)\) recovers the variational form number \(i\), \(\int_\Omega \mathcal{L}^{(i)} v^{(i)}{\, \mathrm{d}x} =0\), in (1)-(3).
A worked example¶
We now consider a specific system of two partial differential equations in two space dimensions:
The unknown functions \(w(x,y)\) and \(T(x,y)\) are defined in a domain \(\Omega\), while \(\mu\), \(\beta\), and \(\kappa\) are given constants. The norm in (6) is the standard Euclidean norm:
The boundary conditions associated with (5)-(6) are \(w=0\) on \(\partial\Omega\) and \(T=T_0\) on \(\partial\Omega\). Each of the equations (5) and (6) needs one condition at each point on the boundary.
The system (5)-(6) arises from fluid flow in a straight pipe, with the \(z\) axis in the direction of the pipe. The domain \(\Omega\) is a cross section of the pipe, \(w\) is the velocity in the \(z\) direction, \(\mu\) is the viscosity of the fluid, \(\beta\) is the pressure gradient along the pipe, \(T\) is the temperature, and \(\kappa\) is the heat conduction coefficient of the fluid. The equation (5) comes from the Navier-Stokes equations, and (6) follows from the energy equation. The term \(- \mu ||\nabla w||^2\) models heating of the fluid due to internal friction.
Observe that the system (5)-(6) has only a one-way coupling: \(T\) depends on \(w\), but \(w\) does not depend on \(T\), because we can solve (5) with respect to \(w\) and then (6) with respect to \(T\). Some may argue that this is not a real system of PDEs, but just two scalar PDEs. Nevertheless, the one-way coupling is convenient when comparing different variational forms and different implementations.
Identical function spaces for the unknowns¶
Let us first apply the same function space \(V\) for \(w\) and \(T\) (or more precisely, \(w\in V\) and \(T-T_0 \in V\)). With
we write
Note that \(w\) and \(T\) in (5)-(6) denote the exact solution of the PDEs, while \(w\) and \(T\) (7) are the discrete functions that approximate the exact solution. It should be clear from the context whether a symbol means the exact or approximate solution, but when we need both at the same time, we use a subscript e to denote the exact solution.
Variational form of each individual PDE¶
Inserting the expansions (7) in the governing PDEs, results in a residual in each equation,
A Galerkin method demands \(R_w\) and \(R_T\) do be orthogonal to \(V\):
Because of the Dirichlet conditions, \(v=0\) on \(\partial\Omega\). We integrate the Laplace terms by parts and note that the boundary terms vanish since \(v=0\) on \(\partial\Omega\):
Compound scalar variational form¶
The alternative way of deriving the variational from is to introduce a test vector function \(\boldsymbol{v}\in\boldsymbol{V} = V\times V\) and take the inner product of \(\boldsymbol{v}\) and the residuals, integrated over the domain:
With \(\boldsymbol{v} = (v_0,v_1)\) we get
Integrating the Laplace terms by parts results in
Choosing \(v_0=v\) and \(v_1=0\) gives the variational form (10), while \(v_0=0\) and \(v_1=v\) gives (11).
With the inner product notation, \((p,q) = \int_\Omega pq{\, \mathrm{d}x}\), we can alternatively write (10) and (11) as
or since \(\mu\) and \(\kappa\) are considered constant,
Decoupled linear systems¶
The linear systems governing the coefficients \(c_j^{(w)}\) and \(c_j^{(T)}\), \(j=0,\ldots,N\), are derived by inserting the expansions (7) in (10) and (11), and choosing \(v={\psi}_i\) for \(i=0,\ldots,N\). The result becomes
It can also be instructive to write the linear systems using matrices and vectors. Define \(K\) as the matrix corresponding to the Laplace operator \(\nabla^2\). That is, \(K_{i,j} = (\nabla {\psi}_j,\nabla {\psi}_i)\). Let us introduce the vectors
The system (15)-(16) can now be expressed in matrix-vector form as
We can solve the first system for \(c^{(w)}\), and then the right-hand side \(b^{(T)}\) is known such that we can solve the second system for \(c^{(T)}\).
Coupled linear systems¶
Despite the fact that \(w\) can be computed first, without knowing \(T\), we shall now pretend that \(w\) and \(T\) enter a two-way coupling such that we need to derive the algebraic equations as one system for all the unknowns \(c_j^{(w)}\) and \(c_j^{(T)}\), \(j=0,\ldots,N\). This system is nonlinear in \(c_j^{(w)}\) because of the \(\nabla w\cdot\nabla w\) product. To remove this nonlinearity, imagine that we introduce an iteration method where we replace \(\nabla w\cdot\nabla w\) by \(\nabla w_{-}\cdot\nabla w\), \(w_{-}\) being the \(w\) computed in the previous iteration. Then the term \(\nabla w_{-}\cdot\nabla w\) is linear in \(w\) since \(w_{-}\) is known. The total linear system becomes
This system can alternatively be written in matrix-vector form as
with \(L\) as the matrix from the \(\nabla w_{-}\cdot\nabla\) operator: \(L_{i,j} = A^{(w,T)}_{i,j}\).
The matrix-vector equations are often conveniently written in block form:
Note that in the general case where all unknowns enter all equations, we have to solve the compound system (23)-(24) since then we cannot utilize the special property that (15) does not involve \(T\) and can be solved first.
When the viscosity depends on the temperature, the \(\mu\nabla^2w\) term must be replaced by \(\nabla\cdot (\mu(T)\nabla w)\), and then \(T\) enters the equation for \(w\). Now we have a two-way coupling since both equations contain \(w\) and \(T\) and therefore must be solved simultaneously Th equation \(\nabla\cdot (\mu(T)\nabla w)=-\beta\) is nonlinear, and if some iteration procedure is invoked, where we use a previously computed \(T_{-}\) in the viscosity (\(\mu(T_{-})\)), the coefficient is known, and the equation involves only one unknown, \(w\). In that case we are back to the one-way coupled set of PDEs.
We may also formulate our PDE system as a vector equation. To this end, we introduce the vector of unknowns \(\boldsymbol{u} = (u^{(0)},u^{(1)})\), where \(u^{(0)}=w\) and \(u^{(1)}=T\). We then have
Different function spaces for the unknowns¶
It is easy to generalize the previous formulation to the case where \(w\in V^{(w)}\) and \(T\in V^{(T)}\), where \(V^{(w)}\) and \(V^{(T)}\) can be different spaces with different numbers of degrees of freedom. For example, we may use quadratic basis functions for \(w\) and linear for \(T\). Approximation of the unknowns by different finite element spaces is known as mixed finite element methods.
We write
The next step is to multiply (5) by a test function \(v^{(w)}\in V^{(w)}\) and (6) by a \(v^{(T)}\in V^{(T)}\), integrate by parts and arrive at
The compound scalar variational formulation applies a test vector function \(\boldsymbol{v} = (v^{(w)}, v^{(T)})\) and reads
valid \(\forall \boldsymbol{v}\in\boldsymbol{V} = V^{(w)}\times V^{(T)}\).
The associated linear system is similar to (15)-(16) or (23)-(24), except that we need to distinguish between \({\psi}_i^{(w)}\) and \({\psi}_i^{(T)}\), and the range in the sums over \(j\) must match the number of degrees of freedom in the spaces \(V^{(w)}\) and \(V^{(T)}\). The formulas become
In the case we formulate one compound linear system involving both \(c^{(w)}_j\), \(j=0,\ldots,N_w\), and \(c^{(T)}_j\), \(j=0,\ldots,N_T\), (23)-(24) becomes
The corresponding block form
has square and rectangular block matrices: \(K^{(w)}\) is \(N_w\times N_w\), \(K^{(T)}\) is \(N_T\times N_T\), while \(L\) is \(N_T\times N_w\),
Computations in 1D¶
We can reduce the system (5)-(6) to one space dimension, which corresponds to flow in a channel between two flat plates. Alternatively, one may consider flow in a circular pipe, introduce cylindrical coordinates, and utilize the radial symmetry to reduce the equations to a one-dimensional problem in the radial coordinate. The former model becomes
while the model in the radial coordinate \(r\) reads
The domain for (50)-(51) is \(\Omega = [0,H]\), with boundary conditions \(w(0)=w(H)=0\) and \(T(0)=T(H)=T_0\). For (52)-(53) the domain is \([0,R]\) (\(R\) being the radius of the pipe) and the boundary conditions are \(du/dr = dT/dr =0\) for \(r=0\), \(u(R)=0\), and \(T(R)=T_0\).
Calculations to be continued...