Professional Documents
Culture Documents
,
which when combined with initial conditions, formed the ODE-IVP problem, that
we then proceeded to solve.
The finite difference method is a common approach for solving ODE-BVPs. The
first step to apply the finite difference method, is to discretize the spatial
domain. This begins by defining (often equidistant) nodes . The
discretization step is then given by
When a Dirichlet boundary condition is present, the value of the boundary node is
a specified, e.g. if we have , then we set .
Assume that we only consider the kinematics in the z-direction, and the flow is
fully developed and at steady state. Then we can have the equation:
At the inner surface of the pipe, a no-slip boundary condition holds, which is a
Dirichlet condition:
At the center of the pipe, a no-flux boundary condition holds due to symmetry,
which is a Neumann condition:
We first discretize the spatial domain into nodes, , with step size
.
Then, we use centered finite difference approximations for the derivative terms
at each interior node:
Solving for the fictious node, we get . The equation for the first node has
to be modified because the radius is equal to zero at that node. We apply
L’Hôpital’s rule:
We apply centered finite differencing and plug the fictious node into the first
equation to obtain
Now, we have a system of linear equations and we can solve for the
velocity profile.
% first node
A(1,1) = -4/delta_r^2;
A(1,2) = 4/delta_r^2;
b(1) = -1000/8.9e-4;
% interior nodes
for i = 2:n-1
A(i,i-1) = -1/(r(i)*2*delta_r) + 1/delta_r^2;
A(i,i) = -2/delta_r^2;
A(i,i+1) = 1/(r(i)*2*delta_r) + 1/delta_r^2;
b(i) = dPdz/mu;
end
% last node
A(n,n) = 1;
b(n) = 0;