calculate_pressure_at_depth
Calculate total and gauge pressure at a given depth in a fluid, accounting for fluid density and atmospheric pressure. Useful for scuba diving, underwater engineering, and fluid statics problems.
Instructions
Calculate pressure at depth: P = P_atm + ρgh.
Hydrostatic pressure increases with depth.
Args:
depth: Depth below surface in meters
fluid_density: Fluid density in kg/m³ (water=1000, seawater=1025)
atmospheric_pressure: Pressure at surface in Pascals (default 101325)
gravity: Gravitational acceleration in m/s² (default 9.81)
Returns:
Dict containing:
- total_pressure: Total pressure in Pascals
- gauge_pressure: Pressure above atmospheric in Pascals
- pressure_atmospheres: Pressure in atmospheres (1 atm = 101325 Pa)
Example - Scuba diving at 30m:
result = await calculate_pressure_at_depth(
depth=30, # meters
fluid_density=1025, # seawater
atmospheric_pressure=101325
)
# Result: ~4 atmospheres
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | Yes | ||
| fluid_density | Yes | ||
| atmospheric_pressure | No | ||
| gravity | No |
Implementation Reference
- MCP tool handler: 'calculate_pressure_at_depth' - async function decorated with @tool that receives parameters (depth, fluid_density, atmospheric_pressure, gravity) and delegates to the core calculation function.
@tool # type: ignore[arg-type] async def calculate_pressure_at_depth( depth: float, fluid_density: float, atmospheric_pressure: float = 101325.0, gravity: float = 9.81, ) -> dict: """Calculate pressure at depth: P = P_atm + ρgh. Hydrostatic pressure increases with depth. Args: depth: Depth below surface in meters fluid_density: Fluid density in kg/m³ (water=1000, seawater=1025) atmospheric_pressure: Pressure at surface in Pascals (default 101325) gravity: Gravitational acceleration in m/s² (default 9.81) Returns: Dict containing: - total_pressure: Total pressure in Pascals - gauge_pressure: Pressure above atmospheric in Pascals - pressure_atmospheres: Pressure in atmospheres (1 atm = 101325 Pa) Example - Scuba diving at 30m: result = await calculate_pressure_at_depth( depth=30, # meters fluid_density=1025, # seawater atmospheric_pressure=101325 ) # Result: ~4 atmospheres """ from ..fluid_advanced import ( PressureAtDepthRequest, calculate_pressure_at_depth as calc_pressure, ) request = PressureAtDepthRequest( depth=depth, fluid_density=fluid_density, atmospheric_pressure=atmospheric_pressure, gravity=gravity, ) response = calc_pressure(request) return response.model_dump() - src/chuk_mcp_physics/tools/fluid.py:408-451 (registration)Registration via @tool decorator on the async function in tools/fluid.py (line 408)
@tool # type: ignore[arg-type] async def calculate_pressure_at_depth( depth: float, fluid_density: float, atmospheric_pressure: float = 101325.0, gravity: float = 9.81, ) -> dict: """Calculate pressure at depth: P = P_atm + ρgh. Hydrostatic pressure increases with depth. Args: depth: Depth below surface in meters fluid_density: Fluid density in kg/m³ (water=1000, seawater=1025) atmospheric_pressure: Pressure at surface in Pascals (default 101325) gravity: Gravitational acceleration in m/s² (default 9.81) Returns: Dict containing: - total_pressure: Total pressure in Pascals - gauge_pressure: Pressure above atmospheric in Pascals - pressure_atmospheres: Pressure in atmospheres (1 atm = 101325 Pa) Example - Scuba diving at 30m: result = await calculate_pressure_at_depth( depth=30, # meters fluid_density=1025, # seawater atmospheric_pressure=101325 ) # Result: ~4 atmospheres """ from ..fluid_advanced import ( PressureAtDepthRequest, calculate_pressure_at_depth as calc_pressure, ) request = PressureAtDepthRequest( depth=depth, fluid_density=fluid_density, atmospheric_pressure=atmospheric_pressure, gravity=gravity, ) response = calc_pressure(request) return response.model_dump() - Imports '@tool' decorator from chuk_mcp_server for registering MCP tools
from chuk_mcp_server import tool