Skip to main content
Glama
IBM

Physics MCP Server

by IBM

calculate_reynolds_number

Calculates Reynolds number using velocity, characteristic length, fluid density, and dynamic viscosity to classify flow as laminar, transitional, or turbulent.

Instructions

Calculate Reynolds number: Re = ρvL/μ.

Determines flow regime (laminar, transitional, turbulent).

Args:
    velocity: Flow velocity in m/s
    characteristic_length: Characteristic length in meters (pipe diameter, etc.)
    fluid_density: Fluid density in kg/m³
    dynamic_viscosity: Dynamic viscosity in Pa·s (water=0.001, air=1.8e-5)

Returns:
    Dict containing:
        - reynolds_number: Re (dimensionless)
        - flow_regime: "laminar" (Re<2300), "transitional" (2300-4000), "turbulent" (Re>4000)

Example - Water in pipe:
    result = await calculate_reynolds_number(
        velocity=2.0,  # m/s
        characteristic_length=0.05,  # 5cm diameter
        fluid_density=1000,  # water
        dynamic_viscosity=0.001
    )
    # Re = 100,000 → turbulent

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
velocityYes
characteristic_lengthYes
fluid_densityYes
dynamic_viscosityYes

Implementation Reference

  • MCP tool handler (async) that defines the calculate_reynolds_number tool. Accepts velocity, characteristic_length, fluid_density, and dynamic_viscosity as parameters, creates a ReynoldsNumberRequest, delegates to the core calculation, and returns a dict.
    @tool  # type: ignore[arg-type]
    async def calculate_reynolds_number(
        velocity: float,
        characteristic_length: float,
        fluid_density: float,
        dynamic_viscosity: float,
    ) -> dict:
        """Calculate Reynolds number: Re = ρvL/μ.
    
        Determines flow regime (laminar, transitional, turbulent).
    
        Args:
            velocity: Flow velocity in m/s
            characteristic_length: Characteristic length in meters (pipe diameter, etc.)
            fluid_density: Fluid density in kg/m³
            dynamic_viscosity: Dynamic viscosity in Pa·s (water=0.001, air=1.8e-5)
    
        Returns:
            Dict containing:
                - reynolds_number: Re (dimensionless)
                - flow_regime: "laminar" (Re<2300), "transitional" (2300-4000), "turbulent" (Re>4000)
    
        Example - Water in pipe:
            result = await calculate_reynolds_number(
                velocity=2.0,  # m/s
                characteristic_length=0.05,  # 5cm diameter
                fluid_density=1000,  # water
                dynamic_viscosity=0.001
            )
            # Re = 100,000 → turbulent
        """
        from ..fluid_advanced import ReynoldsNumberRequest, calculate_reynolds_number as calc_reynolds
    
        request = ReynoldsNumberRequest(
            velocity=velocity,
            characteristic_length=characteristic_length,
            fluid_density=fluid_density,
            dynamic_viscosity=dynamic_viscosity,
        )
        response = calc_reynolds(request)
        return response.model_dump()
  • Core implementation of Reynolds number calculation using Re = (rho * v * L) / mu. Determines flow regime: laminar (<2300), transitional (2300-4000), or turbulent (>4000).
    def calculate_reynolds_number(request: ReynoldsNumberRequest) -> ReynoldsNumberResponse:
        """Calculate Reynolds number: Re = ρvL/μ.
    
        The Reynolds number characterizes the flow regime:
        - Re < 2300: Laminar flow
        - 2300 < Re < 4000: Transitional flow
        - Re > 4000: Turbulent flow
    
        Args:
            request: Reynolds number request
    
        Returns:
            Reynolds number and flow regime
        """
        rho = request.fluid_density
        v = request.velocity
        L = request.characteristic_length
        mu = request.dynamic_viscosity
    
        Re = (rho * v * L) / mu
    
        # Determine flow regime
        if Re < 2300:
            regime = "laminar"
        elif Re < 4000:
            regime = "transitional"
        else:
            regime = "turbulent"
    
        return ReynoldsNumberResponse(
            reynolds_number=Re,
            flow_regime=regime,
        )
  • Pydantic request model for Reynolds number calculation with velocity, characteristic_length, fluid_density, and dynamic_viscosity fields.
    class ReynoldsNumberRequest(BaseModel):
        """Request for Reynolds number calculation."""
    
        velocity: float = Field(..., description="Flow velocity in m/s", gt=0.0)
        characteristic_length: float = Field(
            ..., description="Characteristic length (diameter, chord) in meters", gt=0.0
        )
        fluid_density: float = Field(..., description="Fluid density in kg/m³", gt=0.0)
        dynamic_viscosity: float = Field(..., description="Dynamic viscosity in Pa⋅s", gt=0.0)
  • Pydantic response model for Reynolds number containing reynolds_number (float) and flow_regime (string).
    class ReynoldsNumberResponse(BaseModel):
        """Response for Reynolds number."""
    
        reynolds_number: float = Field(..., description="Reynolds number (dimensionless)")
        flow_regime: str = Field(..., description="Flow regime: laminar, transitional, or turbulent")
  • Tool registered via @tool decorator on the async calculate_reynolds_number function, making it available as an MCP tool.
    @tool  # type: ignore[arg-type]
    async def calculate_reynolds_number(
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavior: it computes Re, determines flow regime, provides typical viscosity values, and explains the return structure. No hidden behaviors.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-organized with formula, parameter doc, returns, and example. It is concise yet complete, with no unnecessary text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description fully documents the return dict including reynolds_number and flow_regime with thresholds. The example further clarifies usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has zero parameter descriptions (0% coverage). The description compensates by detailing each parameter with units, typical values, and the formula's role. Example shows concrete usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool calculates Reynolds number and provides the formula. It distinguishes itself from sibling physics calculation tools by its specific purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description includes an example but does not explicitly state when to use this tool versus alternatives. Usage is implied by the tool name and context among many physics calculators.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/IBM/chuk-mcp-physics'

If you have feedback or need assistance with the MCP directory API, please join our Discord server