reynolds_number / README.md
aedupuga's picture
Upload folder using huggingface_hub
e9d7de4 verified

A newer version of the Gradio SDK is available: 6.14.0

Upgrade
metadata
title: Reynolds Number Calculator
emoji: 🌊
colorFrom: blue
colorTo: blue
sdk: gradio
sdk_version: 4.37.2
app_file: app.py
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

Reynolds Number Calculator

This is a simple web application built with Gradio that calculates the Reynolds number for fluid flow in a circular pipe and determines the flow regime (laminar, transitional, or turbulent). It also provides a plain-English explanation of the results generated by a small language model.

Purpose

The application serves as a demonstration of wrapping a deterministic engineering calculation with a user-friendly interface using Gradio and augmenting the numerical output with an LLM-generated explanation for broader understanding.

How to Use

  1. Enter the required fluid and pipe properties in the input fields:
    • Fluid density [kg/m³]: The mass density of the fluid.
    • Fluid velocity [m/s]: The average velocity of the fluid flow.
    • Pipe diameter [m]: The inner diameter of the circular pipe.
    • Dynamic viscosity [Pa*s]: The dynamic viscosity of the fluid.
  2. Click the "Compute Reynolds Number" button.
  3. The "Calculation Results" panel will display the calculated Reynolds number and the determined flow regime.
  4. The "Explanation" panel will show a simple, LLM-generated explanation of the results.

Inputs

  • rho: Fluid density in kilograms per cubic meter (kg/m³).
  • v: Fluid velocity in meters per second (m/s).
  • D: Pipe diameter in meters (m).
  • mu: Dynamic viscosity in Pascal-seconds (Pa*s).

Outputs

  • Reynolds Number [-]: The dimensionless Reynolds number.
  • Flow Regime: The classification of the flow as "Laminar" (Re < 2100), "Transitional" (2100 <= Re <= 4000), or "Turbulent" (Re > 4000).
  • Explanation: A natural language explanation of the results provided by an instruction-tuned language model.

Libraries Used

  • Gradio: For building the web interface.
  • Transformers: For accessing and using the language model.
  • Torch: A dependency for the Transformers library.
  • Hugging Face Hub: For loading the pre-trained language model.
  • Pandas: For formatting the numerical results into a table.

The LLM is used to make the engineering results more accessible and understandable to a non-expert audience by providing a concise, analogy-based explanation.