File size: 2,202 Bytes
855e841
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# app.py
import streamlit as st

def main():
    st.title("Fluid Mechanics Concepts and Formulas")
    st.sidebar.title("Navigation")

    menu = ["Home", "Concepts", "Formulas"]
    choice = st.sidebar.radio("Select a section:", menu)

    if choice == "Home":
        st.subheader("Welcome to the Fluid Mechanics App")
        st.write("""
            This app provides key concepts and formulas for fluid mechanics. 
            Use the sidebar to navigate between different sections.
        """)

    elif choice == "Concepts":
        st.subheader("Key Concepts in Fluid Mechanics")
        st.write("### 1. Fluid Properties")
        st.write("""- **Density (\(\rho\))**: Mass per unit volume.
                 \[\rho = \frac{m}{V}\]
               - **Viscosity (\(\mu\))**: A measure of a fluid's resistance to deformation.
               - **Pressure**: Force exerted per unit area.
        """)
        st.write("### 2. Flow Types")
        st.write("""- **Laminar Flow**: Smooth, orderly flow.
               - **Turbulent Flow**: Irregular, chaotic flow.
        """)
        st.write("### 3. Bernoulli's Principle")
        st.write("""In a streamline flow, the total energy per unit volume remains constant:
               \[P + \frac{1}{2}\rho v^2 + \rho gh = \text{constant}\]
        """)

    elif choice == "Formulas":
        st.subheader("Fluid Mechanics Formulas")

        st.write("### 1. Continuity Equation")
        st.latex(r"A_1 v_1 = A_2 v_2")
        st.write("""The product of cross-sectional area and velocity is constant for an incompressible fluid.
        """)

        st.write("### 2. Bernoulli's Equation")
        st.latex(r"P + \frac{1}{2}\rho v^2 + \rho gh = \text{constant}")
        st.write("""Relates pressure, velocity, and height in a flowing fluid.
        """)

        st.write("### 3. Reynolds Number")
        st.latex(r"Re = \frac{\rho v D}{\mu}")
        st.write("""Determines whether flow is laminar or turbulent.
        """)

        st.write("### 4. Hydrostatic Pressure")
        st.latex(r"P = \rho g h")
        st.write("""Pressure at a depth \(h\) in a fluid of density \(\rho\).
        """)

if __name__ == '__main__':
    main()