Notre avis
Cette compétence fournit une connaissance physique et des workflows de validation pour le modèle 0-D à paramètres localisés de CO2 utilisé dans la simulation des réservoirs géothermiques, garantissant une implémentation correcte des solveurs d'EDO, du bilan de masse et des calculs d'émissions.
Points forts
- Fournit des workflows structurés pour vérifier la cohérence physique des modifications de code.
- Inclut des références détaillées aux équations, analyses dimensionnelles et vérifications de cohérence.
- Aide à déboguer les problèmes de simulation en retraçant les solutions analytiques.
- Couvre les cas particuliers comme l'inversion de pression et les effets de retard.
Limites
- Spécifique au package co2lpm et peut ne pas être généralisable à d'autres modèles de réservoirs.
- Dépend de fichiers de documentation externes (EQUATIONS.md, etc.) qui doivent être maintenus.
- Ne détecte pas automatiquement les erreurs ; nécessite une application manuelle des étapes de validation.
Utilisez cette compétence lors de la modification ou du débogage du code physique dans le package co2lpm pour garantir que les changements préservent la cohérence physique et le bilan de masse.
N'utilisez pas cette compétence pour la modélisation générale du CO2 en dehors du contexte 0-D à paramètres localisés, ou lorsque les modifications de code sont purement cosmétiques et n'affectent pas la physique.
Analyse de sécurité
PrudenceThe skill lists Bash as an allowed tool, which introduces the capability to run shell commands. While the skill itself does not contain destructive instructions and is intended for scientific computing, the Bash tool could potentially be misused. However, no malicious or obfuscated actions are instructed.
- •Allows Bash tool, which could execute arbitrary shell commands, though the skill's purpose is legitimate physics simulation and code validation.
Exemples
Check the dimensional consistency of the concentration ODE (equation E2-E4) in the co2lpm model. Ensure all terms have correct units and coefficients alpha, beta, gamma, delta have appropriate rate units.I'm seeing unexpected pressure reversal behavior in the reservoir simulation. Using the co2lpm physics knowledge, trace through the analytical solution to explain why pressure increases when effective upflow rate exceeds the initial characteristic rate (q_eff > q_0c).Verify that the emissions partitioning code correctly conserves CO2 mass. Check that the sum of degassed, field, and plant emissions equals the total CO2 mass leaving the reservoir over a time step.name: co2lpm description: Validates code and provides physics reasoning for the 0-D CO2 lumped-parameter model for geothermal reservoirs. Use when modifying ODE solvers, parameter classes, emissions calculations, or concentration dynamics. Also use when debugging simulation behavior, explaining physics concepts, or planning changes to physics-related code. allowed-tools: Read, Grep, Glob, Bash
CO2 Lumped Parameter Model Physics Knowledge
This skill provides physics knowledge for the 0-D CO2 lumped-parameter model implemented in the co2lpm package.
When This Skill Applies
- Modifying code that implements concentration evolution equations
- Changing ODE solver logic or state variable handling
- Implementing or modifying emissions partitioning (field, plant, degassing)
- Debugging unexpected simulation behavior
- Planning changes to physics-related code
- Explaining why the model behaves a certain way
- Working with pressure reversal scenarios
Core Physics Reference
The model tracks reservoir CO2 concentration over time during geothermal extraction. Key state variables:
| Variable | Symbol | Meaning | Units | |----------|--------|---------|-------| | Pressure | P(t) | Reservoir pressure (relative to hydrostatic) | Pa | | Concentration | C(t) | CO2 mass fraction in reservoir fluid | kg/kg | | Upflow rate | q_up | Mass rate into reservoir from depth | kg/s | | Outflow rate | q_out | Mass rate leaving reservoir to surface | kg/s |
For detailed equations, see EQUATIONS.md. For symbol definitions and units, see SYMBOLS.md. For derivation logic, see DERIVATIONS.md. For edge cases and sanity checks, see SANITY_CHECKS.md.
Workflow A: Physics Validation
Use this workflow when reviewing or planning code changes.
Step 1: Identify affected equations
Determine which equations from EQUATIONS.md are affected by the change:
- Pressure evolution: E1 (exponential pressure decline)
- Concentration ODE: E2-E4 (with and without delay)
- Emissions: E5-E8 (degassing, field, plant, total)
- Solubility: E9-E10
Step 2: Check dimensional consistency
Using SYMBOLS.md, verify that:
- All terms in an equation have matching units
- ODE coefficients (alpha, beta, gamma, delta) have correct units
- Source terms have correct rate units (kg/s for mass)
Step 3: Verify mass balance
Changes must preserve:
- CO2 mass conservation in the reservoir
- Correct partitioning between dissolved, degassed, and emitted CO2
Step 4: Check sanity conditions
Verify the change doesn't violate sanity checks S1-S5 in SANITY_CHECKS.md.
Step 5: Report findings
Summarize:
- Which equations are affected
- Any dimensional inconsistencies found
- Any mass balance violations
- Any sanity check concerns
- Recommendations for correction
Workflow B: Physics Reasoning
Use this workflow when explaining behavior, debugging, or proposing solutions.
For explaining physics concepts:
- Identify the relevant equations and parameters
- State the physical interpretation
- Explain cause-and-effect relationships between variables
- Use the derivation steps from DERIVATIONS.md to show how equations connect
For debugging simulation issues:
- Identify which state variables are behaving unexpectedly
- Check if the issue relates to:
- Pressure reversal (q_eff > q_0c)
- Delay effects (tau > 0)
- Solubility limiting (degas=True)
- ODE coefficient calculation
- Trace through the analytical solution (gamma_exact or Cf_dde)
- Check edge cases against SANITY_CHECKS.md
For proposing physics-consistent changes:
- Identify which equations are affected
- Show how new terms integrate into the ODE system
- Demonstrate that mass balance remains satisfied
- Identify any new sanity checks needed
Quick Reference: Module Structure
| Module | Purpose | Key Functions/Classes |
|--------|---------|----------------------|
| model.py | Core LPM class | LumpedParameterModel, StateArrays |
| parameters.py | Dataclasses for inputs | ReservoirParams, OperationParams, ChemistryParams |
| solvers.py | ODE/DDE solvers | pressure_exp, integrate_ode, dde_solve |
| postproc.py | Emissions calculation | emissions() |
| utils.py | CO2 solubility | solubility_linear, solubility_slope_vs_T |
| scenarios.py | Preset configurations | high_gas(), low_gas(), delay_demo() |
Key Physical Constraints
These must always hold:
- Concentration non-negative: C(t) >= 0
- Solubility limit: C(t) <= C_s(P) when degas=True
- Pressure reversal: Occurs when q_eff > q_0c (extraction exceeds critical rate)
- Steady state exists: C_inf = alpha/beta (no delay) or alpha/(beta-gamma) (with delay)
- Delay stability: For tau > 0, the characteristic root lambda_1 must have negative real part
Scenario Classification
| Scenario | Key Parameters | Behavior | |----------|---------------|----------| | High-gas (Ohaaki-like) | degas=True, high C0 | Solubility-limited, significant degassing | | Low-gas (Wairakei-like) | degas=False, low C0 | No degassing, concentration dilutes | | Concentrating | fC < critical | CO2 accumulates in reservoir | | Diluting | fC > critical | CO2 decreases in reservoir | | Reversal | fq*q0 > q0c | Outflow reverses direction | | Delay | tau > 0 | Breakthrough lag, DDE dynamics |
Expert Next.js App Router
Developpement
Un skill qui transforme Claude en expert Next.js App Router.
Générateur de README
Developpement
Crée des README.md professionnels et complets pour vos projets.
Rédacteur de Documentation API
Developpement
Génère de la documentation API complète au format OpenAPI/Swagger.