Update requirements.txt
Browse files- requirements.txt +30 -0
requirements.txt
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
def calculate_reynolds(density, velocity, length, viscosity):
|
| 5 |
+
reynolds_number = (density * velocity * length) / viscosity
|
| 6 |
+
if reynolds_number < 2000:
|
| 7 |
+
flow_type = "Laminar"
|
| 8 |
+
elif reynolds_number < 4000:
|
| 9 |
+
flow_type = "Transitional"
|
| 10 |
+
else:
|
| 11 |
+
flow_type = "Turbulent"
|
| 12 |
+
return reynolds_number, flow_type
|
| 13 |
+
|
| 14 |
+
reynolds_demo = gr.Interface(
|
| 15 |
+
fn=calculate_reynolds,
|
| 16 |
+
inputs=[
|
| 17 |
+
gr.Number(label="Density (kg/m鲁)"),
|
| 18 |
+
gr.Number(label="Velocity (m/s)"),
|
| 19 |
+
gr.Number(label="Characteristic Length (m)"),
|
| 20 |
+
gr.Number(label="Viscosity (Pa路s)")
|
| 21 |
+
],
|
| 22 |
+
outputs=[
|
| 23 |
+
gr.Number(label="Reynolds Number"),
|
| 24 |
+
gr.Text(label="Flow Type")
|
| 25 |
+
],
|
| 26 |
+
title="Reynolds Number Calculator",
|
| 27 |
+
description="Input fluid properties to calculate the Reynolds number and determine the flow type."
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
+
reynolds_demo.launch()
|