Boundary Conditions

This page documents the boundary condition options for all field types in GeoDynamo.jl. Proper boundary conditions are essential for physically meaningful simulations of planetary core dynamics.


Overview

GeoDynamo.jl supports boundary conditions at two radial surfaces:

  • Inner boundary (ICB): Inner core boundary or center (for ball geometry)
  • Outer boundary (CMB): Core-mantle boundary or outer surface

Each field type (velocity, magnetic, temperature, composition) has specific BC options appropriate for its physics.


Velocity Boundary Conditions

Velocity fields use toroidal-poloidal decomposition: u = ∇×(Tr) + ∇×∇×(Pr)

Available BC Types

BC TypeSymbolToroidal (T)Poloidal (P)Physical Meaning
No-slip:no_slipT = 0 (Dirichlet)∂P/∂r = 0All velocity components vanish at boundary
Stress-free:stress_free∂T/∂r = T/r (Neumann)∂²P/∂r² = 0Zero tangential stress, v_r = 0
Impermeable:impermeableUnconstrainedP = 0 (Dirichlet)Only radial velocity vanishes

Physical Interpretation

No-Slip (Rigid Boundary)

All velocity components = 0 at boundary
u_r = u_θ = u_φ = 0
  • Appropriate for solid boundaries (e.g., rigid inner core, solid mantle)
  • Most common choice for geodynamo simulations
  • Toroidal: T = 0 directly sets tangential velocity to zero
  • Poloidal: ∂P/∂r = 0 ensures radial velocity gradient vanishes

Stress-Free (Free-Slip)

Zero tangential stress at boundary
σ_rθ = σ_rφ = 0, with v_r = 0
  • Appropriate for fluid-fluid interfaces or idealized boundaries
  • Toroidal condition derived from: σrθ = η·r·∂(vθ/r)/∂r = 0 → ∂T/∂r = T/r
  • Poloidal condition: ∂²P/∂r² = 0 ensures stress-free radial component

Usage

# Set velocity BCs programmatically
enforce_velocity_boundary_constraints!(velocity_field, :no_slip)
enforce_velocity_boundary_constraints!(velocity_field, :stress_free)

# Or via parameters
params = GeoDynamoParameters(i_vel_bc = 1)  # 1 = no-slip, 2 = stress-free

Magnetic Field Boundary Conditions

Magnetic fields also use toroidal-poloidal decomposition: B = ∇×(Tr) + ∇×∇×(Pr)

Available BC Types

BC TypeSymbolToroidalPoloidal InnerPoloidal Outer
Insulating:insulatingT = 0(∂/∂r - l/r)P = 0(∂/∂r + (l+1)/r)P = 0
Conducting IC:conducting_inner_coreContinuous ∂T/∂rContinuous ∂P/∂r(∂/∂r + (l+1)/r)P = 0
Perfect Conductor:perfect_conductorT = 0P = 0P = 0

Physical Interpretation

Insulating Boundary

Exterior region has σ = 0 (no electrical conductivity)
Current cannot flow across boundary: J_n = 0
Field matches potential field solution outside

The l-dependent conditions ensure proper matching to potential field solutions:

  • Inner: (∂/∂r - l/r)P = 0 → Field behaves as r^l (regular at origin)
  • Outer: (∂/∂r + (l+1)/r)P = 0 → Field decays as r^{-(l+1)} (vanishes at infinity)

This is the standard choice for:

  • CMB (core-mantle boundary): Mantle is nearly insulating
  • ICB with no inner core: Insulating condition at inner boundary

Conducting Inner Core

Inner core has finite electrical conductivity
Magnetic field diffuses through inner core
B and ∂B/∂r continuous at ICB

For simulations with a solid, electrically conducting inner core:

  • Field and its derivative must match across the ICB interface
  • Outer boundary remains insulating (CMB)
  • Inner core field satisfies regularity at r = 0

Perfect Conductor

Boundary material has σ → ∞
Tangential magnetic field = 0
B_θ = B_φ = 0 at boundary

Rarely used in geodynamo context but available for special applications.

Usage

# Insulating boundaries (most common)
enforce_magnetic_boundary_constraints!(magnetic_field, :insulating)

# With conducting inner core
enforce_magnetic_boundary_constraints!(magnetic_field, :conducting_inner_core)

Temperature Boundary Conditions

Temperature is a scalar field with simpler BC structure.

Available BC Types

BC TypeSymbolMathematical FormPhysical Meaning
Fixed Temperature:dirichletT = T₀Prescribed temperature at boundary
Fixed Heat Flux:neumann / :flux∂T/∂r = qPrescribed heat flux at boundary

BC Combinations

InnerOuterUse Case
DirichletDirichletFixed temperatures at both boundaries
DirichletNeumannFixed CMB temperature, prescribed ICB heat flux
NeumannDirichletPrescribed ICB heat flux, fixed CMB temperature
NeumannNeumannPrescribed heat flux at both boundaries

Special Case: Neumann-Neumann

Temperature Level Indeterminacy

When both boundaries have Neumann (flux) conditions, the temperature is only determined up to an additive constant. The governing equation only constrains temperature gradients, not the absolute level.

Solution: For Neumann-Neumann BCs, GeoDynamo.jl automatically uses Dirichlet for the l=0 (mean) mode at the inner boundary. This pins the average temperature while allowing flux conditions for all other modes.

l=0 mode (spherically symmetric mean): Dirichlet at inner boundary
l>0 modes (variations): Neumann at both boundaries

Usage

# Fixed temperature boundaries
enforce_temperature_boundary_constraints!(temp_field, Dict(
    :inner => :dirichlet, :inner_value => 1.0,
    :outer => :dirichlet, :outer_value => 0.0
))

# Heat flux boundaries (l=0 Dirichlet applied automatically)
enforce_temperature_boundary_constraints!(temp_field, Dict(
    :inner => :flux, :inner_flux => 0.1,
    :outer => :flux, :outer_flux => 0.0
))

Composition Boundary Conditions

Composition follows the same structure as temperature.

Available BC Types

BC TypeSymbolMathematical FormPhysical Meaning
Fixed Composition:dirichletC = C₀Prescribed composition at boundary
Fixed Flux:neumann / :flux∂C/∂r = qPrescribed compositional flux at boundary

Physical Interpretation

  • Dirichlet: Fixed light element concentration (e.g., at ICB during inner core growth)
  • Neumann: Prescribed mass flux (e.g., compositional release during freezing)
  • Zero flux (∂C/∂r = 0): No compositional exchange across boundary

Special Case: Neumann-Neumann

Same as temperature: when both boundaries have flux conditions, the l=0 mode uses Dirichlet at the inner boundary to pin the mean composition level.

Usage

# Fixed composition at ICB, zero flux at CMB
enforce_composition_boundary_constraints!(comp_field, Dict(
    :inner => :dirichlet, :inner_value => 1.0,
    :outer => :flux, :outer_flux => 0.0
))

Summary Table

FieldBC TypeInner BoundaryOuter Boundary
VelocityNo-slipT=0, ∂P/∂r=0T=0, ∂P/∂r=0
Stress-free∂T/∂r=T/r, ∂²P/∂r²=0∂T/∂r=T/r, ∂²P/∂r²=0
MagneticInsulatingT=0, (∂/∂r-l/r)P=0T=0, (∂/∂r+(l+1)/r)P=0
Conducting IC∂T/∂r continuousT=0, (∂/∂r+(l+1)/r)P=0
TemperatureFixed TT = T₀T = T₀
Fixed flux∂T/∂r = q∂T/∂r = q
Both fluxl=0: Dirichlet, l>0: NeumannNeumann
CompositionFixed CC = C₀C = C₀
Fixed flux∂C/∂r = q∂C/∂r = q
Both fluxl=0: Dirichlet, l>0: NeumannNeumann

Parameter Reference

Via GeoDynamoParameters

params = GeoDynamoParameters(
    i_vel_bc = 1,    # 1 = no-slip, 2 = stress-free
    i_tmp_bc = 1,    # 1 = Dirichlet/Dirichlet, 2 = Dirichlet/Neumann,
                     # 3 = Neumann/Dirichlet, 4 = Neumann/Neumann
    i_cmp_bc = 1,    # Same as i_tmp_bc
)

Programmatic API

# Velocity
enforce_velocity_boundary_constraints!(𝒰, :no_slip)
enforce_velocity_boundary_constraints!(𝒰, :stress_free)

# Magnetic
enforce_magnetic_boundary_constraints!(ℬ, :insulating)
enforce_magnetic_boundary_constraints!(ℬ, :conducting_inner_core)

# Temperature
enforce_temperature_boundary_constraints!(𝒯, Dict(
    :inner => :dirichlet, :inner_value => 1.0,
    :outer => :neumann, :outer_flux => 0.0
))

# Composition
enforce_composition_boundary_constraints!(𝔽, Dict(
    :inner => :flux, :inner_flux => 0.01,
    :outer => :dirichlet, :outer_value => 0.0
))

Next Steps

TopicResource
Non-spherical boundariesBoundary Topography
Time integration with BCsTime Integration
Loading BC data from filesConfiguration