pub struct SourceContribution {
pub explicit: f64,
pub implicit: f64,
}Expand description
The explicit and implicit halves of a source term, per cell.
Upstream splits a source into Su (explicit, independent of the solution)
and Sp (implicit, the coefficient of φ). Keeping them apart is not
bookkeeping: putting a stabilising negative coefficient on the diagonal
rather than in the right-hand side is what keeps the matrix diagonally
dominant and the solve stable, and it is why a Darcy drag is written
implicitly.
§Units
explicit is in the units of the equation’s residual per unit volume;
implicit in those units divided by the solved variable. Both are
per unit volume — multiplication by the cell volume happens when the
contribution is placed into the matrix, matching upstream, which writes
Sp[celli] += Vc*S.
Fields§
§explicit: f64The part independent of the solved variable, per unit volume.
implicit: f64The coefficient of the solved variable, per unit volume.
Negative values stabilise. A sink proportional to the solution has a negative coefficient here, and it lands on the matrix diagonal with the sign flipped, increasing diagonal dominance.