calculate_drag_force
Calculate the drag force opposing motion of an object through a fluid using velocity, cross-sectional area, fluid density, and drag coefficient. Also returns Reynolds number.
Instructions
Calculate drag force for an object moving through a fluid.
The drag force opposes motion and is given by:
F_drag = 0.5 * ρ * v² * C_d * A
Common drag coefficients:
- Sphere: 0.47
- Streamlined shape: 0.04
- Flat plate (perpendicular): 1.28
- Human (standing): 1.0-1.3
- Car: 0.25-0.35
Args:
velocity: Velocity vector [x, y, z] in m/s (or JSON string)
cross_sectional_area: Area perpendicular to flow in m²
fluid_density: Fluid density in kg/m³ (water=1000, air=1.225)
drag_coefficient: Drag coefficient (default 0.47 for sphere)
viscosity: Dynamic viscosity in Pa·s (water=1.002e-3, air=1.825e-5, oil=0.1).
If not provided, estimated from fluid_density for Reynolds number calculation.
Returns:
Drag force vector, magnitude, and Reynolds number
Example - Ball falling through water:
result = await calculate_drag_force(
velocity=[0, -5.0, 0],
cross_sectional_area=0.00785, # π * (0.05m)² for 10cm diameter
fluid_density=1000, # water
drag_coefficient=0.47,
viscosity=1.002e-3 # water viscosity for accurate Reynolds number
)
# Returns upward drag force opposing downward motion
Example - Ball falling through motor oil:
result = await calculate_drag_force(
velocity=[0, -2.0, 0],
cross_sectional_area=0.00785,
fluid_density=900, # oil
drag_coefficient=0.47,
viscosity=0.1 # motor oil is much more viscous
)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| velocity | Yes | ||
| cross_sectional_area | Yes | ||
| fluid_density | Yes | ||
| drag_coefficient | No | ||
| viscosity | No |
Implementation Reference
- src/chuk_mcp_physics/tools/fluid.py:23-85 (registration)MCP @tool-decorated async function that exposes calculate_drag_force as a tool. Parses velocity if needed, creates a DragForceRequest, delegates to fluid_module.calculate_drag_force(), and returns the response dict.
@tool # type: ignore[arg-type] async def calculate_drag_force( velocity: Union[list[float], str], cross_sectional_area: float, fluid_density: float, drag_coefficient: float = 0.47, viscosity: Optional[float] = None, ) -> dict: """Calculate drag force for an object moving through a fluid. The drag force opposes motion and is given by: F_drag = 0.5 * ρ * v² * C_d * A Common drag coefficients: - Sphere: 0.47 - Streamlined shape: 0.04 - Flat plate (perpendicular): 1.28 - Human (standing): 1.0-1.3 - Car: 0.25-0.35 Args: velocity: Velocity vector [x, y, z] in m/s (or JSON string) cross_sectional_area: Area perpendicular to flow in m² fluid_density: Fluid density in kg/m³ (water=1000, air=1.225) drag_coefficient: Drag coefficient (default 0.47 for sphere) viscosity: Dynamic viscosity in Pa·s (water=1.002e-3, air=1.825e-5, oil=0.1). If not provided, estimated from fluid_density for Reynolds number calculation. Returns: Drag force vector, magnitude, and Reynolds number Example - Ball falling through water: result = await calculate_drag_force( velocity=[0, -5.0, 0], cross_sectional_area=0.00785, # π * (0.05m)² for 10cm diameter fluid_density=1000, # water drag_coefficient=0.47, viscosity=1.002e-3 # water viscosity for accurate Reynolds number ) # Returns upward drag force opposing downward motion Example - Ball falling through motor oil: result = await calculate_drag_force( velocity=[0, -2.0, 0], cross_sectional_area=0.00785, fluid_density=900, # oil drag_coefficient=0.47, viscosity=0.1 # motor oil is much more viscous ) """ # Parse velocity if string parsed_velocity = json.loads(velocity) if isinstance(velocity, str) else velocity request = DragForceRequest( velocity=parsed_velocity, cross_sectional_area=cross_sectional_area, fluid_density=fluid_density, drag_coefficient=drag_coefficient, viscosity=viscosity, ) response = fluid_module.calculate_drag_force(request) return response.model_dump()