title computing the reynolds number to find out the type of flow laminar or turbulent reynolds number is a dimensionless quantity that is used to determine the type of flow pattern as laminar or turbulent while flowing through a pipe reynolds number is defined by the ratio of inertial forces to that of viscous forces r inertial forces viscous forces r v d where density of fluid in kgm3 d diameter of pipe through which fluid flows in m v velocity of flow of the fluid in ms viscosity of the fluid in nsm2 if the reynolds number calculated is high greater than 2000 then the flow through the pipe is said to be turbulent if reynolds number is low less than 2000 the flow is said to be laminar numerically these are acceptable values although in general the laminar and turbulent flows are classified according to a range laminar flow falls below reynolds number of 1100 and turbulent falls in a range greater than 2200 laminar flow is the type of flow in which the fluid travels smoothly in regular paths conversely turbulent flow isn t smooth and follows an irregular path with lots of mixing reference https byjus comphysicsreynoldsnumber reynoldsnumber900 2 5 0 05 0 4 281 25 reynoldsnumber450 3 86 0 078 0 23 589 0695652173912 reynoldsnumber234 4 5 0 3 0 44 717 9545454545454 reynoldsnumber90 2 0 045 1 traceback most recent call last valueerror please ensure that density diameter and viscosity are positive reynoldsnumber0 2 0 4 2 traceback most recent call last valueerror please ensure that density diameter and viscosity are positive reynolds_number 900 2 5 0 05 0 4 281 25 reynolds_number 450 3 86 0 078 0 23 589 0695652173912 reynolds_number 234 4 5 0 3 0 44 717 9545454545454 reynolds_number 90 2 0 045 1 traceback most recent call last valueerror please ensure that density diameter and viscosity are positive reynolds_number 0 2 0 4 2 traceback most recent call last valueerror please ensure that density diameter and viscosity are positive
def reynolds_number(
    density: float, velocity: float, diameter: float, viscosity: float
) -> float:
    

    if density <= 0 or diameter <= 0 or viscosity <= 0:
        raise ValueError(
            "please ensure that density, diameter and viscosity are positive"
        )
    return (density * abs(velocity) * diameter) / viscosity


if __name__ == "__main__":
    import doctest

    doctest.testmod()