When entering a system of PDEs in Dedalus, the left-hand side (LHS) of the equations is parsed into a sparse linear system. For the solver to succeed, this LHS matrix must be square and nonsingular - it must have a unique solution for any possible values on the right-hand side (RHS).Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DedalusProject/dedalus/llms.txt
Use this file to discover all available pages before exploring further.
The Problem
The linear system must constrain all degrees of freedom of the variables, including gauge freedoms. Failure to do so results in singular matrices that cannot be inverted.Example: Incompressible Flow in a Periodic Domain
Consider incompressible hydrodynamics in a fully periodic domain discretized with Fourier bases:Understanding the Degeneracy
Two related issues exist:- Underdetermined variable: Any constant can be added to the pressure
- Degenerate constraint: For the mean Fourier mode, the divergence equation becomes
"0 = 0"
"div(u) = 1", the mean mode would give "0 = 1" - clearly impossible.
The Solution: Gauge Conditions with Tau Variables
We expand the system by adding a spatially-constant variable (a tau variable) to the divergence equation to absorb the degeneracy, and impose the pressure gauge as a separate equation:We’ve added one degree of freedom (
tau_p) and one constraint (integ(p) = 0), so the system is still square. Now it’s also nonsingular since the mean pressure is fixed.How It Works
The tau variable mechanism works elegantly:- The mean pressure is fixed by the gauge condition
- The degeneracy is lifted - the tau variable absorbs/acquires the mean value of any possible RHS
- The mean divergence of velocity is always zero, as required by the periodic discretization
Gauge Conditions in Bounded Domains
Similar modifications work for other types of gauges and geometries. For incompressible hydrodynamics in a bounded domain, we still need this modification so the integral of the divergence equation is compatible with specified inflow boundary conditions.Interpretation with Inflow
From the modified equation, we can see:- If the prescribed net inflow is nonzero, the tau variable acquires a corresponding nonzero value
- The velocity then has a spatially uniform convergence equal to this tau value
- For properly specified boundary conditions with no net inflow, the tau variable is zero and velocity is divergence-free
General Pattern
The gauge condition pattern applies to various situations:Determine which variables have underdetermined components (e.g., mean pressure, total angular momentum)
Common Gauge Conditions
Pressure gauge in incompressible flow
Pressure gauge in incompressible flow
Temperature/tracer mean in periodic domains
Temperature/tracer mean in periodic domains
Angular momentum in rotating systems
Angular momentum in rotating systems
Key Takeaways
Always Check Matrix Properties
The LHS matrix must be square and nonsingular - gauge freedoms break singularity even if dimensions match.
Use Tau Variables
Constant tau fields elegantly absorb constraint degeneracies while maintaining system structure.
Fix All Gauges
Every gauge freedom requires both a tau variable to lift degeneracy and an equation to fix the gauge.
Check Compatibility
Tau variables ensure integral constraints are compatible with boundary conditions and forcing.
See Also
- Tau Method - Understanding tau variables for boundary conditions
- Example scripts in the Dedalus repository demonstrate gauge conditions in various domains