# Convergence Study

Spatial and temporal convergence analysis with Richardson extrapolation and Grid...

- Repository: https://github.com/beita6969/ScienceClaw (1024 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-10-31
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add beita6969/ScienceClaw --skill convergence-study -g -a claude-code -y`
Codex: `npx skills add beita6969/ScienceClaw --skill convergence-study -g -a codex -y`
Cursor: `npx skills add beita6969/ScienceClaw --skill convergence-study -g -a cursor -y`
Gemini CLI: `npx skills add beita6969/ScienceClaw --skill convergence-study -g -a gemini-cli -y`

## Description

Spatial and temporal convergence analysis with Richardson extrapolation and Grid Convergence Index (GCI) for solution verification

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Convergence Study

## Goal

Provide script-driven convergence analysis for verifying that numerical solutions converge at the expected rate as the mesh or timestep is refined.

## Requirements

- Python 3.8+
- NumPy (not required; scripts use only math stdlib)

## Inputs to Gather

| Input | Description | Example |
|-------|-------------|---------|
| Grid spacings | Sequence of mesh sizes (coarse to fine) | `0.4,0.2,0.1,0.05` |
| Timestep sizes | Sequence of dt values | `0.04,0.02,0.01` |
| Solution values | QoI at each refinement level | `1.16,1.04,1.01,1.0025` |
| Expected order | Formal order of the numerical scheme | `2.0` |
| Safety factor | GCI safety factor (1.25 default) | `1.25` |

## Script Outputs (JSON Fields)

| Script | Key Outputs |
|--------|-------------|
| `scripts/h_refinement.py` | `results.observed_orders`, `results.mean_order`, `results.richardson_extrapolated_value`, `results.convergence_assessment` |
| `scripts/dt_refinement.py` | Same as h_refinement but for temporal convergence |
| `scripts/richardson_extrapolation.py` | `results.extrapolated_value`, `results.error_estimate`, `results.observed_order` |
| `scripts/gci_calculator.py` | `results.observed_order`, `results.gci_fine`, `results.gci_coarse`, `results.asymptotic_ratio`, `results.in_asymptotic_range` |

## Workflow

1. **Run grid/timestep refinement study** with at least 3 levels
2. **Compute observed convergence order** with `h_refinement.py` or `dt_refinement.py`
3. **Compare** observed order to expected order of the scheme
4. **Estimate discretization error** via Richardson extrapolation
5. **Report GCI** for formal solution verification using `gci_calculator.py`
6. **Document** convergence results and any anomalies

## Decision Guidance

The rest: https://github.com/beita6969/ScienceClaw/blob/HEAD/skills/convergence-study/SKILL.md
