# CFD Courant Number Calculator AI Agent Connect

> CFD Courant Number Calculator is a specialized MCP for Computational Fluid Dynamics stability analysis. It lets your AI client calculate local Courant-Friedrichs-Lewy numbers, validate mesh integrity, and determine the maximum permissible timesteps for both compressible and incompressible flow modes.

## Overview
- **Category:** science
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_sxKp9gZyZTdJkEGjMd1XGW5RSDJiNS70xsXRUktD/ai-agent-connect
- **Tags:** cfd, fluid-dynamics, stability, mesh, physics

## Description

Running a CFD simulation only to have it diverge due to instability is a massive waste of compute time. This MCP gives your AI agent the mathematical tools to prevent those failures before you hit run. You can hand off mesh data to your agent to check for problematic cells that cause division-by-zero errors or non-physical results. It handles the heavy lifting of calculating Courant numbers across individual mesh cells or providing a high-level stability summary for the entire domain. Whether you are working with explicit or implicit time-integration rules, your agent can use these tools to find the exact timestep limit required to maintain stability. It works across different flow modes, making it a reliable way to verify your setup for both compressible and incompressible flows.

## Tools

### analyze_global_stability
This tool provides a high-level summary of the stability status for your entire mesh.

### calculate_local_courant_numbers
Use this to find the specific Courant number for every individual cell in your mesh.

### calculate_timestep_limit
This tool determines the maximum permissible time step you can use to stay within stability limits.

### validate_mesh_integrity
This tool identifies and flags problematic cells that would cause division-by-zero or non-physical results.

## Prompt Examples

**Prompt:** 
```
Calculate the local Courant numbers for these cells: volumes [0.1, 0.2], face areas [[0.05, 0.05], [0.1, 0.1]], velocities [10, 20], and mode 'incompressible'.
```

**Response:** 
```
The calculated Courant numbers for the cells are 5.0 and 10.0.
```

**Prompt:** 
```
Is a timestep of 0.01 stable for a max Courant number of 1.5 using an explicit integration rule?
```

**Response:** 
```
No, the current timestep is not stable for an explicit integration rule with a Courant number of 1.5.
```

**Prompt:** 
```
Check if my mesh is valid with volumes [0.1, 0.0], face areas [[0.05, 0.05], [0.0, 0.0]], and velocities [10, 10].
```

**Response:** 
```
The mesh is invalid. Cell index 1 has zero volume and zero face area.
```

## Capabilities

### Local CFL Calculation
Your agent calculates Courant numbers for every single cell in a mesh.

### Global Stability Assessment
The AI provides a summary of the stability status for the whole mesh.

### Timestep Optimization
Your agent finds the maximum time step allowed to maintain numerical stability.

### Mesh Quality Validation
The AI flags cells that would cause mathematical errors or non-physical results.

### Flow Mode Support
The tools handle both compressible and incompressible flow calculations.

## Use Cases

### Pre-run Stability Checks
Verify your mesh and timestep settings before committing to a long simulation run.

### Mesh Debugging
Find specific cells with zero volume or area that are breaking your solver.

### Timestep Adjustment
Calculate the exact limit for your time step based on current velocities and mesh size.

### Flow Mode Verification
Ensure stability parameters are correct for either compressible or incompressible flows.

## Benefits

- Prevents simulation divergence by catching instability early.
- Automates the math for local and global Courant number calculations.
- Identifies mesh errors that lead to non-physical results.
- Works with both explicit and implicit time-integration rules.

## How It Works

Connect the MCP to your preferred AI client and start sending mesh data for analysis.

1. Connect your AI client to the Vinkius-hosted MCP.
2. Provide mesh data like volumes, face areas, and velocities to your agent.
3. Ask the agent to run specific stability or integrity tools.
4. Receive immediate calculations or error flags to adjust your simulation setup.

## Frequently Asked Questions

**What is this MCP used for?**
It is used for Computational Fluid Dynamics (CFD) stability analysis, specifically for calculating Courant numbers and validating mesh integrity.

**Can I use this with Claude or Cursor?**
Yes, you can connect this MCP to any MCP-compatible client like Claude, Cursor, or Windsurf.

**Does it support incompressible flow?**
Yes, the tools support both compressible and incompressible flow modes.

**How does it help with mesh errors?**
The validate_mesh_integrity tool flags cells that would cause division-by-zero or non-physical results.

**Can it calculate the maximum timestep?**
Yes, the calculate_timestep_limit tool determines the maximum permissible time step to maintain stability.

**How do I check if my simulation is stable?**
You can use `analyze_global_stability` after calculating local numbers to get a summary, or use `calculate_timestep_limit` to see if your current timestep is within the stable range for your integration rule.

**What is the difference between explicit and implicit rules?**
Explicit rules are highly sensitive to the Courant number and typically require it to be $\le 1.0$. Implicit rules are generally more stable and can handle larger Courant numbers.

**Can I use this for compressible flows?**
Yes, by setting the `compressibilityMode` to 'compressible' in `calculate_local_courant_numbers`, the tool accounts for the local speed of sound.
