Introduction
In our last lesson, we took a crucial step towards a numerical solution of the transport equation by deriving the step and diamond difference schemes. This gave us a fully discretized algebraic equation that relates the angular flux at the boundaries of a spatial cell to the average flux and source within it. For example, using diamond difference for , we found we could calculate the outgoing flux from the incoming flux and the cell source .
This leaves us with a significant challenge: the source term itself, particularly the scattering source, depends on the angular flux in all directions, which is precisely what we are trying to find. This creates a circular dependency. This lesson tackles that problem head-on. Your objective is to outline the source iteration algorithm and describe the spatial sweep procedure. These two components form the core computational engine of any discrete ordinates code, allowing us to untangle the coupled system of equations and arrive at a converged solution.
The Problem of the Scattering Source
Let's revisit the discretized S equation for a single direction and spatial cell , using the diamond difference scheme as our example:
The total source on the right, , is the sum of any external source and the in-scattering source. For simplicity, let's consider isotropic scattering. The scattering source is then given by:
Notice that the source for direction depends on the scalar flux , which in turn is an integral (or sum, in our discrete case) of the angular fluxes over all directions . To find the flux in one direction, we need to know the flux in all other directions. This coupling makes it impossible to solve for all directly in one step.
The Source Iteration Algorithm
The standard method for solving this coupled system is an iterative technique called source iteration. The core idea is simple and powerful, akin to a fixed-point iteration you may have encountered in mathematics. We break the circular dependency by making a guess, calculating a result based on that guess, and then using that result as our next, better guess, repeating until our guess stops changing.
Here is the general algorithm, using an iteration index :
- Initialization (): Make an initial guess for the scalar flux distribution, , across all spatial cells. A common and simple choice is to assume zero flux everywhere: .
- Calculate the Source: Using the scalar flux from the previous iteration, , calculate the scattering source for the current iteration, . The total source is then .
- Transport Sweep: For this known, fixed source , solve the S equations for each direction to find an updated angular flux, . This step is the "workhorse" of the algorithm, and we will detail how it's done in the next section.
- Update Scalar Flux: Recompute the scalar flux using the new angular fluxes:
- Check for Convergence: Compare the newly computed scalar flux with the previous iteration's flux . If the difference between them is smaller than some predefined tolerance for all spatial cells, the solution has converged, and we can stop.
- Iterate: If the solution has not converged, set and return to Step 2.
This iterative process effectively turns a complex, fully coupled problem into a sequence of simpler problems. In each iteration, we solve for the angular flux assuming the source is a known quantity.
The Spatial Sweep Procedure
Step 3 of the source iteration algorithm is where the spatial sweep occurs. With the source term fixed for the current iteration, the S equations for different directions are now decoupled from each other. For a single direction , we have an equation that we can march across the spatial grid. The direction of this march, or "sweep," is determined by the sign of .

Let's see how this works with our diamond-difference update equation from the previous lesson.
1. Sweep for (Forward Sweep)
For particles traveling left-to-right, the flux at the left edge of a cell, , is the "incoming" flux, and the flux at the right edge, , is the "outgoing" flux. We can rearrange the diamond-difference equation to solve for the outgoing flux:
The procedure is as follows:
- Start at the leftmost boundary of the slab (cell ). The incoming flux is known from a boundary condition (e.g., for a vacuum boundary).
- Use the equation to compute .
- Now, is the known incoming flux for the next cell. Use it to compute .
- Continue this process, sweeping from left to right across the entire spatial mesh, until the flux at all cell edges is known for this direction .
2. Sweep for (Backward Sweep)
For particles traveling right-to-left, the roles are reversed. The flux at the right edge, , is "incoming." We solve the diamond-difference equation for the outgoing flux, :
Note that since , the term is positive. The procedure is a mirror image of the forward sweep:
- Start at the rightmost boundary of the slab (cell ). The incoming flux is known from a boundary condition.
- Use the equation to compute .
- Continue this process, sweeping from right to left, until the flux at all cell edges is known.
By performing these sweeps for all discrete directions, we complete one "transport sweep" and have a full set of new angular fluxes ready for the next step in the source iteration algorithm.
The following dissertation provides a very clear, step-by-step description of this combined algorithm.
This resource, while focused on an advanced method, contains an excellent and explicit description of the standard source iteration and sweep procedures that are fundamental to all S_N codes.
First, read the brief list under the heading "Source Iteration Procedure" to see the high-level steps. This paper deals with a more complex "spectral" method, so you can ignore the references to moments m=0, 1. For our purposes, just consider the m=0 case, which is our standard angular flux \psi. Next, read the section "Diamond-Difference Sweep Formulation". This section gives the precise update equations for the forward (\mu_l > 0) and backward (\mu_l < 0) sweeps. Finally, read "Step 3: Source Iteration" in the section "Numerical Implementation of the Spectral-LTS N Solver". This prose description beautifully integrates the concepts, showing how the scalar flux is used to compute the source (steps 1-2) and how the spatial sweeps are performed for each angle (step 3).
Visualizing the Full Algorithm
The interplay between the outer source iteration and the inner transport sweeps can be visualized with a flowchart. The following diagram illustrates a complete solution algorithm for a nuclear reactor problem, which is more complex than our simple fixed-source problem but shares the exact same iterative structure.

Let's walk through this flowchart in the context of our lesson:
- Our starting point: We begin with an external source and an initial guess for the scattering source (usually zero). This corresponds to the path after "Calculate guess flux...".
- Compute Total Source: The box "Compute Scattering Source" followed by "Compute Total Source" is our Step 2, where we calculate .
- Transport Sweep: The box "Solve system of equations, and compute flux for all meshes and directions" is our Step 3. This single box contains all the forward and backward spatial sweeps for all angles.
- Convergence Check: The algorithm then checks if the flux has converged ("Convergence Check all..."). This is our Step 5.
- Iteration: If the solution has not converged (the "No" path), the algorithm loops back to re-compute the scattering source with the updated flux. This entire blue loop is the source iteration algorithm.
The red "Outer Iteration" loop is used for problems where a quantity called (related to the criticality of a nuclear reactor) is also being solved for. This is analogous to the multigroup energy iterations we will encounter in a later lesson. For now, you can focus entirely on the structure of the blue "Inner Iteration" loop.
Conclusion
In this lesson, we have assembled the complete computational algorithm for solving the one-dimensional, one-group S equations. We saw that the coupling introduced by the scattering source can be resolved through an elegant iterative process.
Key Takeaways:
- The scattering source term depends on the scalar flux , which itself is an integral of the angular flux we are trying to find. This creates a circular dependency.
- Source Iteration is an algorithm that resolves this by iteratively guessing the source, solving for the flux, and using that flux to update the source for the next guess.
- The Spatial Sweep is the procedure used within each source iteration to solve for the angular flux for a single direction, given a fixed source.
- Sweeps proceed from left-to-right (forward) for and from right-to-left (backward) for , following the natural direction of particle flow.
- The full algorithm consists of an outer source iteration loop and an inner transport sweep (which loops over all angles and spatial cells).
Preview of the Next Lesson:
We now have all the theoretical and algorithmic pieces in place. The next logical step is to translate this algorithm into practice. In the next lesson, you will be guided through the process of implementing the source iteration algorithm in Python to solve the S equations for a slab problem. This will solidify your understanding by turning these abstract steps into a working computer program.