-
Notifications
You must be signed in to change notification settings - Fork 0
6: Time Integration with RK4 #16
Copy link
Copy link
Open
Labels
coreEssential functionalityEssential functionality
Description
Description
Implement explicit time integration using the classical 4th-order Runge-Kutta method. Create the full time-stepping loop that advances the free surface variables.
Background
The state vector y = [η, φ̃] evolves according to:
dy/dt = RHS(y)
where RHS involves:
- Building K matrix from current η
- Solving σ-Laplace for Φ
- Recovering w̃
- Evaluating free surface RHS
Each RK4 step requires 4 RHS evaluations (4 Laplace solves per time step).
Tasks
- Implement generic RK4 stepper
- Implement full RHS function
- Input: current [η, φ̃]
- Build K matrix
- Assemble and solve Laplace
- Recover w̃
- Evaluate R_η, R_φ
- Output: [R_η, R_φ]
- Implement time loop with output storage
- Implement CFL-based time step selection
- Test RK4 on simple ODE
- Implement standing wave test case
Acceptance Criteria
- RK4 achieves 4th-order convergence on test ODE (dy/dt = -y)
- Standing wave simulation runs for 10+ periods without crashing
- Oscillation period matches analytical T = 2π/ω within 1%
- Amplitude preserved within 5% after 10 periods
- Phase error < 10% after 10 periods
Test Configuration: Standing Wave
Domain: x ∈ [0, λ/2] where λ = 2π/k
BCs: Neumann (walls) at x = 0 and x = λ/2
Initial: η(x,0) = H·cos(kx), φ̃(x,0) = 0
Expected: η(x,t) = H·cos(kx)·cos(ωt)
Parameters: kh = 1, H/h = 0.01 (small amplitude)
Duration: 10 wave periods
Deliverables
- Time series plot of η at x = 0
- Comparison with analytical standing wave
- Energy vs time plot
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreEssential functionalityEssential functionality