diff --git a/symplyphysics/laws/hydro/dynamic_pressure_via_density_and_flow_speed.py b/symplyphysics/laws/hydro/dynamic_pressure_via_density_and_flow_speed.py index 0c06dcfbd..d7dea87c5 100644 --- a/symplyphysics/laws/hydro/dynamic_pressure_via_density_and_flow_speed.py +++ b/symplyphysics/laws/hydro/dynamic_pressure_via_density_and_flow_speed.py @@ -2,9 +2,8 @@ Dynamic pressure from speed =========================== -*Dynamic pressure*, sometimes called *velocity pressure*, is a physical quantity denoting the -pressure caused by a flowing fluid. It is numerically equal to the kinetic energy of the -fluid per unit volume (see :doc:`laws.quantities.quantity_is_volumetric_density_times_volume`). +**Dynamic pressure**, sometimes called **velocity pressure**, is a physical quantity denoting the +pressure caused by a flowing fluid. **Notes:** @@ -16,43 +15,29 @@ #. `Wikipedia `__. """ -from sympy import (Eq, solve) -from symplyphysics import (units, Quantity, Symbol, validate_input, validate_output) +from sympy import Eq, solve +from symplyphysics import Quantity, validate_input, validate_output, symbols -dynamic_pressure = Symbol("dynamic_pressure", units.pressure) +dynamic_pressure = symbols.dynamic_pressure """ -Dynamic pressure of the fluid. - -Symbol: - :code:`q` +:symbols:`dynamic_pressure` of the fluid. """ -density = Symbol("density", units.mass / units.volume) -r""" -Density of the fluid. - -Symbol: - :code:`rho` - -Latex: - :math:`\rho` +density = symbols.density """ - -flow_speed = Symbol("flow_speed", units.velocity) +:symbols:`density` of the fluid. """ -Flow speed of the fluid. -Symbol: - :code:`u` +flow_speed = symbols.flow_speed +""" +:symbols:`flow_speed` of the fluid. """ law = Eq(dynamic_pressure, density * flow_speed**2 / 2) -r""" -:code:`q = 1/2 * rho * u^2` +""" +:laws:symbol:: -Latex: - .. math:: - q = \frac{1}{2} \rho u^2 +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/efficiency_of_the_hydraulic_press_from_force_and_height.py b/symplyphysics/laws/hydro/efficiency_of_the_hydraulic_press_from_force_and_height.py index 95a875015..0bbf2f816 100644 --- a/symplyphysics/laws/hydro/efficiency_of_the_hydraulic_press_from_force_and_height.py +++ b/symplyphysics/laws/hydro/efficiency_of_the_hydraulic_press_from_force_and_height.py @@ -1,50 +1,71 @@ +""" +Efficiency of hydraulic press from force and height +=================================================== + +A real hydraulic press is never :math:`100%` efficient due to friction and other energy +losses. Its efficiency is the ratio of the useful work (given by the product of output +force and the height of the output side) to the expended work (given by the product of +input force and the height of the input side). + +.. + TODO: find link +""" + from sympy import Eq, solve from symplyphysics import ( clone_as_symbol, symbols, - units, Quantity, - Symbol, validate_input, validate_output, - dimensionless, convert_to_float, ) -# Description -## Since the hydraulic press is a mechanism, its operation can be characterized by a coefficient of efficiency. +output_force = clone_as_symbol(symbols.force, subscript="2") +""" +Output :symbols:`force`. +""" + +output_distance = clone_as_symbol(symbols.euclidean_distance, subscript="2") +""" +:symbols:`euclidean_distance` covered by the output piston. +""" + +input_force = clone_as_symbol(symbols.force, subscript="1") +""" +Input :symbols:`force`. +""" -## Law: n = (F2 * h2) / (F1 * h1) -## Where: -## F2 is the force spent on useful work (work on lifting the load) -## h2 is the movement of load -## F1 is expended force -## h1 is expended height -## n is coefficient of efficiency +input_distance = clone_as_symbol(symbols.euclidean_distance, subscript="1") +""" +:symbols:`euclidean_distance` covered by the input piston. +""" -# TODO find link +efficiency = symbols.mechanical_efficiency +""" +:symbols:`mechanical_efficiency` of the hydraulic press. +""" -useful_force = clone_as_symbol(symbols.force, display_symbol="F_1", display_latex="F_1") -useful_height = Symbol("useful_height", units.length) -expended_force = clone_as_symbol(symbols.force, display_symbol="F_2", display_latex="F_2") -expended_height = Symbol("expended_height", units.length) -efficiency = Symbol("efficiency", dimensionless) +law = Eq(efficiency, (output_force * output_distance) / (input_force * input_distance)) +""" +:laws:symbol:: -law = Eq(efficiency, (useful_force * useful_height) / (expended_force * expended_height)) +:laws:latex:: +""" -@validate_input(useful_force_=useful_force, - useful_height_=useful_height, - expended_force_=expended_force, - expended_height_=expended_height) +@validate_input(useful_force_=output_force, + useful_height_=output_distance, + expended_force_=input_force, + expended_height_=input_distance) @validate_output(efficiency) def calculate_efficiency(useful_force_: Quantity, useful_height_: Quantity, expended_force_: Quantity, expended_height_: Quantity) -> float: result_expr = solve(law, efficiency, dict=True)[0][efficiency] result_efficiency = result_expr.subs({ - useful_force: useful_force_, - useful_height: useful_height_, - expended_force: expended_force_, - expended_height: expended_height_ + output_force: useful_force_, + output_distance: useful_height_, + input_force: expended_force_, + input_distance: expended_height_ }) return convert_to_float(result_efficiency) diff --git a/symplyphysics/laws/hydro/efflux_speed_via_height.py b/symplyphysics/laws/hydro/efflux_speed_via_height.py index efeedde18..1d2ac0f33 100644 --- a/symplyphysics/laws/hydro/efflux_speed_via_height.py +++ b/symplyphysics/laws/hydro/efflux_speed_via_height.py @@ -2,8 +2,12 @@ Efflux speed via height ======================= -The speed of a fluid flowing out from a small orifice can be expressed as a function -of the height of the fluid column. It is also known as the *Torricelli's law*. +The speed of a fluid flowing out from a small orifice can be expressed as a function of +the height of the fluid column. It is also known as the **Torricelli's law**. + +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. **Conditions:** @@ -16,32 +20,24 @@ #. `Wikipedia `__. """ -from sympy import (Eq, solve, sqrt) -from symplyphysics import (units, Quantity, Symbol, validate_input, validate_output) +from sympy import Eq, solve, sqrt +from symplyphysics import Quantity, validate_input, validate_output, symbols, quantities -efflux_speed = Symbol("efflux_speed", units.velocity) +efflux_speed = symbols.flow_speed """ -Speed of the fluid flowing out of the pipe. - -Symbol: - :code:`v` +:symbols:`flow_speed` of the fluid flowing out of the pipe. """ -height = Symbol("height", units.length) +height = symbols.height """ -Height of the fluid column above the orifice. - -Symbol: - :code:`h` +:symbols:`height` of the fluid column above the orifice. """ -law = Eq(efflux_speed, sqrt(2 * units.acceleration_due_to_gravity * height)) -r""" -:code:`v = sqrt(2 * g * h)` +law = Eq(efflux_speed, sqrt(2 * quantities.acceleration_due_to_gravity * height)) +""" +:laws:symbol:: -Latex: - .. math:: - v = \sqrt{2 g h} +:laws:latex:: """ # TODO Derive from Bernoulli's equation and constancy of volume flux diff --git a/symplyphysics/laws/hydro/efflux_speed_via_hydrostatic_pressure_and_density.py b/symplyphysics/laws/hydro/efflux_speed_via_hydrostatic_pressure_and_density.py index 20354b681..e369daa80 100644 --- a/symplyphysics/laws/hydro/efflux_speed_via_hydrostatic_pressure_and_density.py +++ b/symplyphysics/laws/hydro/efflux_speed_via_hydrostatic_pressure_and_density.py @@ -15,52 +15,32 @@ TODO find link """ -from sympy import (Eq, solve, sqrt) -from symplyphysics import ( - units, - Quantity, - Symbol, - validate_input, - validate_output, -) +from sympy import Eq, solve, sqrt +from symplyphysics import Quantity, validate_input, validate_output, symbols from symplyphysics.core.expr_comparisons import expr_equals from symplyphysics.laws.hydro import hydrostatic_pressure_via_density_and_height as pressure_law from symplyphysics.laws.hydro import efflux_speed_via_height as velocity_law -efflux_speed = Symbol("efflux_speed", units.velocity) +efflux_speed = symbols.flow_speed """ -Speed of the fluid flowing out of the pipe. - -Symbol: - :code:`v` +:symbols:`flow_speed` of the fluid flowing out of the pipe. """ -hydrostatic_pressure = Symbol("hydrostatic_pressure", units.pressure) +hydrostatic_pressure = symbols.hydrostatic_pressure """ -Hydrostatic pressure of the fluid. - -Symbol: - :code:`p` +:symbols:`hydrostatic_pressure` of the fluid. """ -density = Symbol("density", units.mass / units.volume) -r""" -Density of the fluid. - -Symbol: - :code:`rho` - -Latex: - :math:`\rho` +density = symbols.density +""" +:symbols:`density` of the fluid. """ law = Eq(efflux_speed, sqrt(2 * hydrostatic_pressure / density)) -r""" -:code:`v = sqrt(2 * p / rho)` +""" +:laws:symbol:: -Latex: - .. math:: - v = \sqrt{\frac{2 p}{\rho}} +:laws:latex:: """ # This law might be derived via "hydrostatic_pressure_from_density_and_depth" law diff --git a/symplyphysics/laws/hydro/excessive_pressure_under_curved_surface_of_bubble.py b/symplyphysics/laws/hydro/excessive_pressure_under_curved_surface_of_bubble.py index 4fd721ca5..313a1ac17 100644 --- a/symplyphysics/laws/hydro/excessive_pressure_under_curved_surface_of_bubble.py +++ b/symplyphysics/laws/hydro/excessive_pressure_under_curved_surface_of_bubble.py @@ -1,55 +1,73 @@ -from sympy import (Eq, solve) -from symplyphysics import (units, Quantity, Symbol, validate_input, validate_output) -from symplyphysics.core.expr_comparisons import expr_equals +""" +Excess pressure under curved surface of bubble +============================================== -from symplyphysics.laws.thermodynamics import laplace_pressure_of_spherical_shapes as laplace_law +Under the curved surface of the liquid, in addition to the internal pressure, additional +pressure is created due to the curvature of the surface. For a bubble, this pressure is +created by two surfaces: the outer and the inner. + +**Links:** + +#. `Physics LibreTexts, formula 20.2.4 `__. -# Description -## Under the curved surface of the liquid, in addition to the internal pressure, -## additional pressure is created due to the curvature of the surface. -## For a bubble, this pressure is created by two surfaces: the outer and the inner. +.. + TODO: fix file name +""" + +from sympy import Eq, solve +from symplyphysics import Quantity, validate_input, validate_output, symbols, clone_as_symbol +from symplyphysics.core.expr_comparisons import expr_equals +from symplyphysics.laws.thermodynamics import laplace_pressure_of_spherical_shapes as laplace_law -## Law is: p = 4 * sigma / R, where -## p - excessive pressure under the curved surface of bubble, -## sigma - surface tension of the liquid, -## R - radius of bubble. +pressure_difference = clone_as_symbol(symbols.pressure, display_symbol="Delta(p)", display_latex="\\Delta p") +""" +:symbols:`pressure` difference between the surfaces of the bubble. +""" -# Links: Physics LibreTexts, formula 20.2.4 +surface_tension = symbols.surface_tension +""" +:symbols:`surface_tension` of the bubble. +""" -excessive_pressure = Symbol("excessive_pressure", units.pressure) +radius = symbols.radius +""" +:symbols:`radius` of the bubble. +""" -surface_tension_of_the_liquid = Symbol("surface_tension_of_the_liquid", units.force / units.length) -radius_of_bubble = Symbol("radius_of_bubble", units.length) +law = Eq(pressure_difference, 4 * surface_tension / radius) +""" +:laws:symbol:: -law = Eq(excessive_pressure, 4 * surface_tension_of_the_liquid / radius_of_bubble) +:laws:latex:: +""" # This law might be derived via Laplace law. # TODO prefix all variables used in proof with underscore -laplace_law_applied = laplace_law.law.subs({ - laplace_law.surface_tension: surface_tension_of_the_liquid, - laplace_law.radius_of_curvature: radius_of_bubble +_laplace_law_applied = laplace_law.law.subs({ + laplace_law.surface_tension: surface_tension, + laplace_law.radius_of_curvature: radius }) # This is an excess pressure in a spherical drop. -pressure_derived = solve(laplace_law_applied, laplace_law.laplace_pressure, +_pressure_derived = solve(_laplace_law_applied, laplace_law.laplace_pressure, dict=True)[0][laplace_law.laplace_pressure] # Check if derived pressure is same as declared. # The bubble has two surfaces – an outer and an inner one, each of which creates additional pressure. # Therefore, an additional multiplier of "2" appears. -assert expr_equals(2 * pressure_derived, law.rhs) +assert expr_equals(2 * _pressure_derived, law.rhs) -@validate_input(surface_tension_of_the_liquid_=surface_tension_of_the_liquid, - radius_of_bubble_=radius_of_bubble) -@validate_output(excessive_pressure) +@validate_input(surface_tension_of_the_liquid_=surface_tension, + radius_of_bubble_=radius) +@validate_output(pressure_difference) def calculate_excessive_pressure(surface_tension_of_the_liquid_: Quantity, radius_of_bubble_: Quantity) -> Quantity: - solved = solve(law, excessive_pressure, dict=True)[0][excessive_pressure] + solved = solve(law, pressure_difference, dict=True)[0][pressure_difference] result_expr = solved.subs({ - surface_tension_of_the_liquid: surface_tension_of_the_liquid_, - radius_of_bubble: radius_of_bubble_ + surface_tension: surface_tension_of_the_liquid_, + radius: radius_of_bubble_ }) return Quantity(result_expr) diff --git a/symplyphysics/laws/hydro/froude_number.py b/symplyphysics/laws/hydro/froude_number.py index 440ae1a8e..c77657915 100644 --- a/symplyphysics/laws/hydro/froude_number.py +++ b/symplyphysics/laws/hydro/froude_number.py @@ -1,46 +1,65 @@ +""" +Froude number formula +===================== + +The Froude number is based on the speed-to-length ratio as defined by Froude. It has +some analogy with the :ref:`Mach number `, +but it is not frequently used in the field of theoretical fluid dynamics. It relates the +inertia forces in a system to the effects due to gravity, in other words, it is related +to the tendency of the fluid to make `gravity waves `__. + +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. + +**Links:** + +#. `Wikipedia `__. +#. `ScienceDirect `__. + +.. + TODO: rename file +""" + from sympy import Eq, solve, sqrt from symplyphysics import ( - units, Quantity, - Symbol, validate_input, validate_output, - dimensionless, convert_to_float, + symbols, + quantities, ) -# Description -# Froude number characterizes the ratio between the force of inertia and -# the external force, in the field of which the motion occurs, acting on -# an elementary volume of liquid or gas. There is a characteristic length in -# the formula. The characteristic length is the dimension -# that defines the length scale of a physical system. A characteristic length -# is usually the volume of a system divided by its surface: L = V / A, -# where V is the volume of the body, and A is the cross-sectional area. -# For example, it is used to calculate flow through circular and non-circular -# tubes in order to examine flow conditions. D = 4 * A / p, where -# D is characteristic diameter, A is the cross-sectional are, p is wetted perimeter. -# Law: Fr = u / sqrt(g * L), where -# u is velocity, -# g is acceleration due to gravity, -# L is a characteristic length, -# Fr is Froude number. - -# Links: Wikipedia - -velocity = Symbol("velocity", units.velocity) -characteristic_length = Symbol("characteristic_length", units.length) -froude_number = Symbol("froude_number", dimensionless) - -law = Eq(froude_number, velocity / sqrt(units.acceleration_due_to_gravity * characteristic_length)) - - -@validate_input(velocity_=velocity, characteristic_length_=characteristic_length) +flow_speed = symbols.flow_speed +""" +:symbols:`flow_speed`. +""" + +characteristic_length = symbols.characteristic_length +""" +:symbols:`characteristic_length` of the fluid container. +""" + +froude_number = symbols.froude_number +""" +:symbols:`froude_number`. +""" + +law = Eq(froude_number, flow_speed / sqrt(quantities.acceleration_due_to_gravity * characteristic_length)) +""" +:laws:symbol:: + +:laws:latex:: +""" + + +@validate_input(velocity_=flow_speed, characteristic_length_=characteristic_length) @validate_output(froude_number) def calculate_froude_number(velocity_: Quantity, characteristic_length_: Quantity) -> float: result_expr = solve(law, froude_number, dict=True)[0][froude_number] result_applied = result_expr.subs({ - velocity: velocity_, + flow_speed: velocity_, characteristic_length: characteristic_length_ }) return convert_to_float(result_applied) diff --git a/symplyphysics/laws/hydro/hagen_poiseuille_equation.py b/symplyphysics/laws/hydro/hagen_poiseuille_equation.py index e0e569935..54e98e13f 100644 --- a/symplyphysics/laws/hydro/hagen_poiseuille_equation.py +++ b/symplyphysics/laws/hydro/hagen_poiseuille_equation.py @@ -1,22 +1,67 @@ +""" +Pressure difference at pipe ends from dynamic viscosity and flow rate +===================================================================== + +In non-ideal fluid mechanics, the Hagen—Poiseuille equation is a physical law that gives +the pressure drop in an incompressible and Newtonian fluid in laminar flow flowing +through a long cylindrical pipe of constant cross section. It can be successfully +applied to air flow in lung alveoli, or the flow through a drinking straw. + +**Conditions:** + +#. The fluid is incompressible and Newtonian. +#. The flow of the fluid is laminar. +#. The pipe is long enough for the flow to be laminar. +#. The pipe has constant cross section. + +**Links:** + +#. `Wikipedia, first part of the first equation `__. + +.. + TODO: rename file to use descriptive name +""" + from sympy import Eq, solve, pi -from symplyphysics import (Quantity, Symbol, units, validate_input, validate_output) +from symplyphysics import ( + Quantity, + validate_input, + validate_output, + symbols, + clone_as_symbol, +) + +dynamic_viscosity = symbols.dynamic_viscosity +""" +:symbols:`dynamic_viscosity` of the fluid. +""" + +length = symbols.length +""" +:symbols:`length` of the pipe. +""" + +flow_rate = symbols.volumetric_flow_rate +""" +:symbols:`volumetric_flow_rate` of the fluid through the pipe. +""" -# Law: delta_p = 8 * mu * L * Q / (pi * R**4) -# delta_p - pressure difference, -# mu is viscosity, -# L is length, -# Q is the volumetric flow rate, -# R is the pipe radius +radius = symbols.radius +""" +:symbols:`radius` of the pipe. +""" -# Links: Wikipedia, first part of the first equation +pressure_difference = clone_as_symbol(symbols.pressure, display_symbol="Delta(p)", display_latex="\\Delta p") +""" +Difference in :symbols:`pressure` between the two ends of the pipe. +""" -dynamic_viscosity = Symbol("dynamic_viscosity", units.pressure * units.time) -length = Symbol("length", units.length) -flow_rate = Symbol("flow_rate", units.volume / units.time) -radius = Symbol("radius", units.length) -delta_pressure = Symbol("delta_pressure", units.pressure) +law = Eq(pressure_difference, 8 * dynamic_viscosity * length * flow_rate / (pi * radius**4)) +""" +:laws:symbol:: -law = Eq(delta_pressure, 8 * dynamic_viscosity * length * flow_rate / (pi * radius**4)) +:laws:latex:: +""" @validate_input( @@ -25,10 +70,10 @@ flow_rate_=flow_rate, radius_=radius, ) -@validate_output(delta_pressure) +@validate_output(pressure_difference) def calculate_delta_pressure(dynamic_viscosity_: Quantity, length_: Quantity, flow_rate_: Quantity, radius_: Quantity) -> Quantity: - result_expr = solve(law, delta_pressure, dict=True)[0][delta_pressure] + result_expr = solve(law, pressure_difference, dict=True)[0][pressure_difference] result_applied = result_expr.subs({ dynamic_viscosity: dynamic_viscosity_, length: length_, diff --git a/symplyphysics/laws/hydro/hydraulic_stress_is_bulk_modulus_times_strain.py b/symplyphysics/laws/hydro/hydraulic_stress_is_bulk_modulus_times_strain.py index ce87babc2..72d4d59ae 100644 --- a/symplyphysics/laws/hydro/hydraulic_stress_is_bulk_modulus_times_strain.py +++ b/symplyphysics/laws/hydro/hydraulic_stress_is_bulk_modulus_times_strain.py @@ -10,52 +10,41 @@ **Links:** #. `Wikipedia, derivable from 12.5.3 `__. + +.. + TODO: rename `hydraulic stress` to `bulk stress` """ from sympy import Eq from symplyphysics import ( - units, - dimensionless, Quantity, - Symbol, validate_input, validate_output, + symbols, + clone_as_symbol, ) -hydraulic_stress = Symbol("hydraulic_stress", units.pressure) +bulk_stress = clone_as_symbol(symbols.pressure, display_symbol="Delta(p)", display_latex="\\Delta p") """ -Hydraulic stress. - -Symbol: - :code:`p` +Bulk stress. See :symbols:`pressure`. """ -bulk_modulus = Symbol("bulk_modulus", units.pressure) +bulk_modulus = symbols.bulk_modulus """ -Bulk modulus of the material. - -Symbol: - :code:`B` +:symbols:`bulk_modulus` of the material. """ -fractional_volume_change = Symbol("fractional_volume_change", dimensionless) -r""" -:doc:`Fractional volume change `. - -Symbol: - :code:`e_V` - -Latex: - :math:`e_V` +fractional_volume_change = clone_as_symbol(symbols.fractional_change, subscript="V") +""" +:symbols:`fractional_change` of volume. See :ref:`Fractional change is change over +initial value`. """ -law = Eq(hydraulic_stress, bulk_modulus * fractional_volume_change) -r""" -:code:`p = B * e_V` +law = Eq(bulk_stress, bulk_modulus * fractional_volume_change) +""" +:laws:symbol:: -Latex: - .. math:: - p = B e_V +:laws:latex:: """ @@ -63,7 +52,7 @@ bulk_modulus_=bulk_modulus, fractional_volume_change_=fractional_volume_change, ) -@validate_output(hydraulic_stress) +@validate_output(bulk_stress) def calculate_hydraulic_stress( bulk_modulus_: Quantity, fractional_volume_change_: Quantity, diff --git a/symplyphysics/laws/hydro/hydrostatic_pressure_from_density_and_depth_acceleration.py b/symplyphysics/laws/hydro/hydrostatic_pressure_from_density_and_depth_acceleration.py index aa3e834b3..3cab50c57 100644 --- a/symplyphysics/laws/hydro/hydrostatic_pressure_from_density_and_depth_acceleration.py +++ b/symplyphysics/laws/hydro/hydrostatic_pressure_from_density_and_depth_acceleration.py @@ -1,34 +1,57 @@ -from sympy import Eq, solve -from symplyphysics import symbols, units, Quantity, Symbol, validate_input, validate_output +""" +Hydrostatic pressure from density, height and acceleration +========================================================== + +Hydrostatic pressure is the pressure exerted by a fluid at equilibrium at a given point +within the fluid, due to the force of gravity. + +**Conditions:** + +#. The only force acting on the fluid is the gravitational force. -# Description -# Law: P = ρ * a * h -# P - hydrostatic pressure -# ρ - density of liquid -# a - acceleration of vessel (should be directed vertically upwards) -# h - depth +.. + TODO: find link +""" -# Conditions -# - No other accelerations involved, ie gravitational acceleration +from sympy import Eq, solve +from symplyphysics import symbols, Quantity, validate_input, validate_output + +density = symbols.density +""" +:symbols:`density` of the fluid. +""" -# TODO: find link +height = symbols.height +""" +:symbols:`height` of the fluid column. +""" -density = Symbol("density", units.mass / units.volume) -depth = Symbol("depth", units.length) acceleration = symbols.acceleration -hydrostatic_pressure = Symbol("hydrostatic_pressure", units.pressure) +""" +:symbols:`acceleration` of the vessel. +""" + +hydrostatic_pressure = symbols.hydrostatic_pressure +""" +:symbols:`hydrostatic_pressure` of the fluid. +""" + +law = Eq(hydrostatic_pressure, density * acceleration * height) +""" +:laws:symbol:: -law = Eq(hydrostatic_pressure, density * acceleration * depth) +:laws:latex:: +""" -@validate_input(density_=density, depth_=depth, acceleration_=acceleration) +@validate_input(density_=density, depth_=height, acceleration_=acceleration) @validate_output(hydrostatic_pressure) def calculate_hydrostatic_pressure(density_: Quantity, depth_: Quantity, acceleration_: Quantity) -> Quantity: result_pressure_expr = solve(law, hydrostatic_pressure, dict=True)[0][hydrostatic_pressure] result_expr = result_pressure_expr.subs({ density: density_, - depth: depth_, + height: depth_, acceleration: acceleration_, }) return Quantity(result_expr) diff --git a/symplyphysics/laws/hydro/hydrostatic_pressure_via_density_and_height.py b/symplyphysics/laws/hydro/hydrostatic_pressure_via_density_and_height.py index 1b6f8cd00..a96ae0aa4 100644 --- a/symplyphysics/laws/hydro/hydrostatic_pressure_via_density_and_height.py +++ b/symplyphysics/laws/hydro/hydrostatic_pressure_via_density_and_height.py @@ -5,6 +5,10 @@ Hydrostatic pressure is the pressure exerted by a fluid at equilibrium at any point of time due to the force of gravity. +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. + **Conditions:** #. The fluid is in statical equilibrium. @@ -17,53 +21,38 @@ """ from sympy import Eq, solve -from symplyphysics import units, Quantity, Symbol, validate_input, validate_output +from symplyphysics import Quantity, validate_input, validate_output, symbols, quantities from symplyphysics.core.expr_comparisons import expr_equals - from symplyphysics.laws.hydro import hydrostatic_pressure_from_density_and_depth_acceleration as pressure_law -hydrostatic_pressure = Symbol("hydrostatic_pressure", units.pressure) +hydrostatic_pressure = symbols.hydrostatic_pressure """ -Hydrostatic pressure of the fluid column. - -Symbol: - :code:`p` +:symbols:`hydrostatic_pressure` of the fluid column. """ -density = Symbol("density", units.mass / units.volume) -r""" -Density of the fluid. - -Symbol: - :code:`rho` - -Latex: - :math:`\rho` +density = symbols.density +""" +:symbols:`density` of the fluid. """ -height = Symbol("height", units.length) +height = symbols.height r""" -Height of the fluid column. - -Symbol: - :code:`h` +:symbols:`height` of the fluid column. """ -law = Eq(hydrostatic_pressure, density * units.acceleration_due_to_gravity * height) -r""" -:code:`p = rho * g * h` +law = Eq(hydrostatic_pressure, density * quantities.acceleration_due_to_gravity * height) +""" +:laws:symbol:: -Latex: - .. math:: - p = \rho g h +:laws:latex:: """ # This law might be derived via hydrostatic pressure law. _pressure_law_applied = pressure_law.law.subs({ pressure_law.density: density, - pressure_law.depth: height, - pressure_law.acceleration: units.acceleration_due_to_gravity, + pressure_law.height: height, + pressure_law.acceleration: quantities.acceleration_due_to_gravity, }) _pressure_derived = solve(_pressure_law_applied, pressure_law.hydrostatic_pressure, dict=True)[0][pressure_law.hydrostatic_pressure] diff --git a/symplyphysics/laws/hydro/inner_pressure_is_constant.py b/symplyphysics/laws/hydro/inner_pressure_is_constant.py index 8039426f7..d74467443 100644 --- a/symplyphysics/laws/hydro/inner_pressure_is_constant.py +++ b/symplyphysics/laws/hydro/inner_pressure_is_constant.py @@ -2,8 +2,8 @@ Inner pressure is constant ========================== -Bernoulli's equation applied to an ideal liquid specifies that the inner -pressure of the fluid is constant at all points along a streamline. +Bernoulli's equation applied to an ideal liquid specifies that the inner pressure of the +fluid is constant at all points along a streamline. **Conditions:** @@ -16,41 +16,29 @@ from sympy import Eq, dsolve, Derivative from symplyphysics import ( - units, Quantity, - Symbol, - Function, validate_input, validate_output, + symbols, + clone_as_function, ) -inner_pressure = Function("inner_pressure", units.pressure) -r""" -Inner pressure of the fluid at a chosen point in space. -See :doc:`laws.hydro.inner_pressure_is_sum_of_pressures`. - -Symbol: - :code:`p_inner(t)` - -Latex: - :math:`p_\text{inner}(t)` +time = symbols.time """ - -time = Symbol("time", units.time) +:symbols:`time`. """ -Time. -Symbol: - :code:`t` +inner_pressure = clone_as_function(symbols.pressure, [time], display_symbol="p_inner", display_latex="p_\\text{inner}") +""" +Inner pressure of the fluid at a chosen point in space as a function of :attr:`~time`. +See :ref:`Inner pressure is sum of pressures`. """ law = Eq(Derivative(inner_pressure(time), time), 0) -r""" -:code:`Derivative(p_inner(t), t) = 0` +""" +:laws:symbol:: -Latex: - .. math:: - \frac{d p_\text{inner}}{d t} = 0 +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/inner_pressure_is_sum_of_pressures.py b/symplyphysics/laws/hydro/inner_pressure_is_sum_of_pressures.py index 9342c6bdd..acbb06171 100644 --- a/symplyphysics/laws/hydro/inner_pressure_is_sum_of_pressures.py +++ b/symplyphysics/laws/hydro/inner_pressure_is_sum_of_pressures.py @@ -16,58 +16,38 @@ from sympy import Eq, solve from symplyphysics import ( - units, Quantity, - Symbol, validate_input, validate_output, + symbols, + clone_as_symbol, ) -inner_pressure = Symbol("inner_pressure", units.pressure) -r""" -Inner pressure of the fluid. - -Symbol: - :code:`p_inner` - -Latex: - :math:`p_\text{inner}` +inner_pressure = clone_as_symbol(symbols.pressure, display_symbol="p_inner", display_latex="p_\\text{inner}") """ - -static_pressure = Symbol("static_pressure", units.pressure) -r""" -Static pressure of the fluid. - -Symbol: - :code:`p_static` - -Latex: - :math:`p_\text{static}` +Inner :symbols:`pressure` of the fluid. """ -dynamic_pressure = Symbol("dynamic_pressure", units.pressure) +static_pressure = clone_as_symbol(symbols.pressure, display_symbol="p_static", display_latex="p_\\text{static}") """ -Dynamic pressure of the fluid. - -Symbol: - :code:`q` +Static :symbols:`pressure` of the fluid. """ -hydrostatic_pressure = Symbol("hydrostatic_pressure", units.pressure) +dynamic_pressure = symbols.dynamic_pressure +""" +:symbols:`dynamic_pressure` of the fluid. """ -Hydrostatic pressure of the fluid. -Symbol: - :code:`p` +hydrostatic_pressure = symbols.hydrostatic_pressure +""" +:symbols:`hydrostatic_pressure` of the fluid. """ law = Eq(inner_pressure, static_pressure + dynamic_pressure + hydrostatic_pressure) -r""" -:code:`p_inner = p_static + q + p` +""" +:laws:symbol:: -Latex: - .. math:: - p_\text{inner} = p_\text{static} + q + p +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/input_force_to_area_ratio_equals_to_output.py b/symplyphysics/laws/hydro/input_force_to_area_ratio_equals_to_output.py index 6c7893f94..dec6abb25 100644 --- a/symplyphysics/laws/hydro/input_force_to_area_ratio_equals_to_output.py +++ b/symplyphysics/laws/hydro/input_force_to_area_ratio_equals_to_output.py @@ -1,64 +1,97 @@ -from sympy import (Eq, solve, dsolve) -from symplyphysics import (clone_as_symbol, symbols, units, Quantity, Symbol, validate_input, - validate_output) +""" +Force to area ratio in hydraulic press +====================================== + +If both vertically positioned cylinders of communicating vessels are closed with +pistons, then with the help of external forces applied to the pistons, a large pressure +can be created in the liquid, many times exceeding the hydrostatic pressure at any point +in the system. If the pistons have different areas, then different forces act on them +from the liquid side. The same modulus, but oppositely directed external forces must be +applied to the pistons to keep the system in balance. + + +**Conditions:** + +#. This ratio is performed only in an ideal hydraulic press, i.e. one in which there is + no friction. + +**Links:** + +#. `Physics LibreTexts, formula 53.1.2 `__. + +.. + TODO: rename file +""" + +from sympy import Eq, solve, dsolve +from symplyphysics import ( + clone_as_symbol, + symbols, + Quantity, + validate_input, + validate_output, +) from symplyphysics.laws.dynamics import pressure_from_force_and_area as pressure_law from symplyphysics.core.expr_comparisons import expr_equals from symplyphysics.laws.hydro import inner_pressure_is_constant as constant_pressure_law -# Description -## If both vertically positioned cylinders of communicating vessels are closed with pistons, then with the help of external forces applied to the pistons, -## a large pressure can be created in the liquid, many times exceeding the hydrostatic pressure at any point in the system. -## If the pistons have different areas, then different forces act on them from the liquid side. The same modulus, but oppositely directed external forces must be applied to the pistons to keep the system in balance. +input_force = clone_as_symbol(symbols.force, subscript="1") +""" +:symbols:`force` acting on the first piston. +""" -## Law: F1 / S1 = F2 / S2 -## Where: -## F1 is the force acting on the first piston -## F2 is the force acting on the second piston -## S1 is the area of the first piston -## S2 is the area of the second piston +input_area = clone_as_symbol(symbols.area, subscript="1") +""" +:symbols:`area` of the first piston. +""" -## Conditions -## This ratio is performed only in an ideal hydraulic press, i.e. one in which there is no friction. +output_force = clone_as_symbol(symbols.force, subscript="2") +""" +:symbols:`force` acting on the second piston. +""" -# Links: Physics LibreTexts, formula 53.1.2 +output_area = clone_as_symbol(symbols.area, subscript="2") +""" +:symbols:`area` of the second piston. +""" -input_force = clone_as_symbol(symbols.force, display_symbol="F_in", display_latex="F_\\text{in}") -input_area = Symbol("input_area", units.area) -output_force = clone_as_symbol(symbols.force, display_symbol="F_out", display_latex="F_\\text{out}") -output_forces_area = Symbol("output_forces_area", units.area) +law = Eq(input_force / input_area, output_force / output_area) +""" +:laws:symbol:: -law = Eq(input_force / input_area, output_force / output_forces_area) +:laws:latex:: +""" # TODO prefix variables used in proof with underscore -pressure_input = pressure_law.law.rhs.subs({ +_pressure_input = pressure_law.law.rhs.subs({ pressure_law.force: input_force, pressure_law.area: input_area }) -pressure_output = pressure_law.law.rhs.subs({ +_pressure_output = pressure_law.law.rhs.subs({ pressure_law.force: output_force, - pressure_law.area: output_forces_area, + pressure_law.area: output_area, }) -## If the pistons are in equilibrium, then the pressures pressure_input and pressure_output are equal -dsolved = dsolve(constant_pressure_law.law, +## If the pistons are in equilibrium, then the pressures _pressure_input and _pressure_output are equal +_dsolved = dsolve(constant_pressure_law.law, constant_pressure_law.inner_pressure(constant_pressure_law.time)) -dsolved_input = dsolved.subs(constant_pressure_law.inner_pressure(constant_pressure_law.time), - pressure_input) -dsolved_output = dsolved.subs(constant_pressure_law.inner_pressure(constant_pressure_law.time), - pressure_output) -solved_input = solve([dsolved_input, dsolved_output], (pressure_input, "C1"), - dict=True)[0][pressure_input] -pressure_equation = Eq(pressure_input, solved_input) +_dsolved_input = _dsolved.subs(constant_pressure_law.inner_pressure(constant_pressure_law.time), + _pressure_input) +_dsolved_output = _dsolved.subs(constant_pressure_law.inner_pressure(constant_pressure_law.time), + _pressure_output) +_solved_input = solve([_dsolved_input, _dsolved_output], (_pressure_input, "C1"), + dict=True)[0][_pressure_input] +_pressure_equation = Eq(_pressure_input, _solved_input) -assert expr_equals(law.rhs, pressure_equation.rhs) -assert expr_equals(law.lhs, pressure_equation.lhs) +assert expr_equals(law.rhs, _pressure_equation.rhs) +assert expr_equals(law.lhs, _pressure_equation.lhs) @validate_input(input_force_=input_force, input_area_=input_area, - output_forces_area_=output_forces_area) + output_forces_area_=output_area) @validate_output(output_force) def calculate_output_force(input_force_: Quantity, input_area_: Quantity, output_forces_area_: Quantity) -> Quantity: @@ -66,6 +99,6 @@ def calculate_output_force(input_force_: Quantity, input_area_: Quantity, result_force = result_expr.subs({ input_force: input_force_, input_area: input_area_, - output_forces_area: output_forces_area_, + output_area: output_forces_area_, }) return Quantity(result_force) diff --git a/symplyphysics/laws/hydro/jurin_equation.py b/symplyphysics/laws/hydro/jurin_equation.py index 14a57878b..e55f28985 100644 --- a/symplyphysics/laws/hydro/jurin_equation.py +++ b/symplyphysics/laws/hydro/jurin_equation.py @@ -1,48 +1,85 @@ -from sympy import (Eq, solve, cos) -from symplyphysics import (units, Quantity, Symbol, validate_input, validate_output, angle_type) - -# Description -## The Jurin equation determines the height of the liquid rise in the capillaries. -## In the absence of wetting theta > 90, cos(theta) < 0, and the liquid level in the capillary drops by the value h. With full wetting theta =0, cos (theta) = 1, and the radius of the meniscus is equal to the radius of the capillary. - -## Conditions -## Surface of the meniscus is a sphere -## Height of the liquid is raised (lowered) h is much larger than the radius of the capillary r - -## Law: h = 2 * a * cos(theta) / (⍴ * g * r) -## Where: -## h is the height of the liquid column -## a is the coefficient of surface tension of the liquid -## theta is the angle between the surface of a solid and the tangent to the surface of a liquid -## ⍴ is density of liquid -## g is acceleration of free fall -## r is capillary radius - -# Links: Wikipedia - -height = Symbol("height", units.length) -surface_tension_coefficient = Symbol("surface_tension_coefficient", units.force / units.length) -angle = Symbol("angle", angle_type) -density_of_liquid = Symbol("density_of_liquid", units.mass / units.volume) -radius = Symbol("radius", units.length) +""" +Capillary rise from surface tension and contact angle +===================================================== + +The Jurin's law determines the height to which the liquid rises in capillaries. It +states that the maximum height of a liquid in a capillary tube is inversely proportional +to the tube's diameter. + +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. + +**Conditions:** + +#. The surface of the meniscus is spherical. +#. Height :math:`h` of the raised (lowered) liquid is much larger than the radius + :math:`r` of the capillary. + +**Links:** + +#. `Wikipedia `__. + +.. + TODO: rename file to use descriptive name +""" + +from sympy import Eq, solve, cos +from symplyphysics import ( + Quantity, + validate_input, + validate_output, + symbols, + quantities +) + +height = symbols.height +""" +:symbols:`height` of the liquid column. +""" + +surface_tension = symbols.surface_tension +""" +:symbols:`surface_tension` of the liquid. +""" + +angle = symbols.angle +""" +Contact :symbols:`angle` between of the liquid and the tube wall. +""" + +density = symbols.density +""" +:symbols:`density` of the liquid. +""" + +radius = symbols.radius +""" +:symbols:`radius` of the capillary. +""" law = Eq( - height, 2 * surface_tension_coefficient * cos(angle) / - (density_of_liquid * radius * units.acceleration_due_to_gravity)) + height, 2 * surface_tension * cos(angle) / + (density * radius * quantities.acceleration_due_to_gravity)) +""" +:laws:symbol:: + +:laws:latex:: +""" -@validate_input(surface_tension_coefficient_=surface_tension_coefficient, +@validate_input(surface_tension_coefficient_=surface_tension, angle_=angle, - density_of_liquid_=density_of_liquid, + density_of_liquid_=density, radius_=radius) @validate_output(height) def calculate_height(surface_tension_coefficient_: Quantity, angle_: Quantity, density_of_liquid_: Quantity, radius_: Quantity) -> Quantity: result_expr = solve(law, height, dict=True)[0][height] result_height = result_expr.subs({ - surface_tension_coefficient: surface_tension_coefficient_, + surface_tension: surface_tension_coefficient_, angle: angle_, - density_of_liquid: density_of_liquid_, + density: density_of_liquid_, radius: radius_, }) result_height_quantity = Quantity(result_height) diff --git a/symplyphysics/laws/hydro/mach_number_is_flow_speed_over_speed_of_sound.py b/symplyphysics/laws/hydro/mach_number_is_flow_speed_over_speed_of_sound.py index fe3cff60b..70f8e4946 100644 --- a/symplyphysics/laws/hydro/mach_number_is_flow_speed_over_speed_of_sound.py +++ b/symplyphysics/laws/hydro/mach_number_is_flow_speed_over_speed_of_sound.py @@ -12,49 +12,33 @@ from sympy import Eq, solve from symplyphysics import ( - units, Quantity, - Symbol, validate_input, validate_output, - dimensionless, convert_to_float, + symbols, ) -mach_number = Symbol("mach_number", dimensionless) -r""" -Local Mach number. - -Symbol: - :code:`M` - -Latex: - :math:`\text{M}` +mach_number = symbols.mach_number """ - -flow_speed = Symbol("flow_speed", units.velocity) -r""" -Flow speed with respect to internal or external boundaries. - -Symbol: - :code:`u` +Local :symbols:`mach_number`. """ -speed_of_sound = Symbol("speed_of_sound", units.velocity) +flow_speed = symbols.flow_speed +""" +:symbols:`flow_speed` with respect to internal or external boundaries. """ -Speed of sound in the medium. -Symbol: - :code:`c` +speed_of_sound = symbols.speed_of_sound +""" +Local :symbols:`speed_of_sound`. """ law = Eq(mach_number, flow_speed / speed_of_sound) -r""" -:code:`M = u / c` +""" +:laws:symbol:: -Latex: - .. math:: - \text{M} = \frac{u}{c} +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/nusselt_number.py b/symplyphysics/laws/hydro/nusselt_number.py index 227d8e8c8..d6f23f920 100644 --- a/symplyphysics/laws/hydro/nusselt_number.py +++ b/symplyphysics/laws/hydro/nusselt_number.py @@ -1,41 +1,54 @@ +""" +Nusselt number formula +====================== + +Nusselt number is the ratio of total heat transfer to conductive heat transfer at a +boundary in a fluid. It can be expressed using the heat transfer coefficient of the +flow, characteristic length of the system, and thermal conductivity of the fluid. + +**Links:** + +#. `Wikipedia `__. + +.. + TODO: rename file +""" + from sympy import Eq, solve from symplyphysics import ( - units, Quantity, - Symbol, validate_input, validate_output, - dimensionless, convert_to_float, + symbols ) -# Description -# Nusselt number is the ratio of convective to conductive heat transfer at -# a boundary in a fluid. There is a characteristic length in -# the formula. The characteristic length is the dimension -# that defines the length scale of a physical system. A characteristic length -# is usually the volume of a system divided by its surface: L = V / A, -# where V is the volume of the body, and A is the cross-sectional area. -# For example, it is used to calculate flow through circular and non-circular -# tubes in order to examine flow conditions. D = 4 * A / p, where -# D is characteristic diameter, A is the cross-sectional are, p is wetted perimeter. -# Law: Nu = h * L / k, where -# h is the heat transfer coefficient, -# L is the characteristic length, -# k is the thermal conductivity, -# Nu is Nusselt number. - -# Links: Wikipedia - -heat_transfer_coefficient = Symbol("heat_transfer_coefficient", - units.power / (units.area * units.temperature)) -characteristic_length = Symbol("characteristic_length", units.length) -thermal_conductivity = Symbol("thermal_conductivity", - units.power / (units.length * units.temperature)) - -nusselt_number = Symbol("nusselt_number", dimensionless) +heat_transfer_coefficient = symbols.heat_transfer_coefficient +""" +:symbols:`heat_transfer_coefficient` of the flow. +""" + +characteristic_length = symbols.characteristic_length +""" +:symbols:`characteristic_length` of the system. +""" + +thermal_conductivity = symbols.thermal_conductivity +""" +:symbols:`thermal_conductivity` of the fluid. +""" + +nusselt_number = symbols.nusselt_number +""" +:symbols:`nusselt_number`. +""" law = Eq(nusselt_number, heat_transfer_coefficient * characteristic_length / thermal_conductivity) +""" +:laws:symbol:: + +:laws:latex:: +""" @validate_input( diff --git a/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_horizontally.py b/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_horizontally.py index 8eae148ee..9bc9d8af1 100644 --- a/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_horizontally.py +++ b/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_horizontally.py @@ -1,45 +1,60 @@ +""" +Pressure of liquid in vessel moving horizontally +================================================ + +If a vessel with a liquid moves with horizontal acceleration, then the hydrostatic +pressure of the liquid depends on the density of the liquid, the acceleration of free +fall, the horizontal acceleration of the vessel and the height of liquid. + +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. + +.. + TODO: find link +""" + from sympy import (Eq, solve, sqrt) -from sympy.physics.units import acceleration_due_to_gravity as earth_free_fall_acceleration from symplyphysics import ( Vector, add_cartesian_vectors, symbols, - units, Quantity, - Symbol, validate_input, validate_output, vector_magnitude, + quantities, ) from symplyphysics.core.expr_comparisons import expr_equals from symplyphysics.laws.hydro import hydrostatic_pressure_from_density_and_depth_acceleration as pressure_law -# Description -## If a vessel with a liquid moves with horizontal acceleration, then the hydrostatic pressure of the liquid -## depends on the density of the liquid, the acceleration of free fall, the horizontal acceleration of the vessel -## and the height of liquid. -## Height is the distance from the surface of the water in the vessel to the surface of equal pressure. In a vessel -## moving with horizontal acceleration, the planes of equal pressure are inclined at an angle to the horizon. +pressure = symbols.pressure +""" +:symbols:`pressure` of the liquid. +""" -## Law is: p = p0 * sqrt(g^2 + a^2) * h, where -## p - pressure, -## p0 - density of liquid, -## g - earth free fall acceleration, -## a - acceleration of vessel, -## h - height. +density = symbols.density +""" +:symbols:`density` of the liquid. +""" -# TODO: find link - -pressure = Symbol("pressure", units.pressure) - -density_liquid = Symbol("density_liquid", units.mass / units.volume) acceleration = symbols.acceleration -height = Symbol("height", units.length) +""" +:symbols:`acceleration` of the vessel. +""" + +height = symbols.height +""" +:symbols:`height` of the liquid column. +""" law = Eq(pressure, - density_liquid * sqrt(earth_free_fall_acceleration**2 + acceleration**2) * height) + density * sqrt(quantities.acceleration_due_to_gravity**2 + acceleration**2) * height) +""" +:laws:symbol:: -# TODO prefix variables used in proof with underscore +:laws:latex:: +""" # This law might be derived via hydrostatic pressure law. # The vessel moves horizontally and the pressure exerted by the resultant force on a surface of equal pressure, @@ -48,31 +63,31 @@ # Earth free fall acceleration is directed downwards. It is equivalent to vessel acceleration # directed vertically upwards. -free_fall_acceleration_vector = Vector([0, earth_free_fall_acceleration]) +_free_fall_acceleration_vector = Vector([0, quantities.acceleration_due_to_gravity]) # Horizontal vector -vessel_acceleration_vector = Vector([acceleration, 0]) -total_acceleration = vector_magnitude( - add_cartesian_vectors(free_fall_acceleration_vector, vessel_acceleration_vector)) - -pressure_law_applied = pressure_law.law.subs({ - pressure_law.density: density_liquid, - pressure_law.depth: height, - pressure_law.acceleration: total_acceleration, +_vessel_acceleration_vector = Vector([acceleration, 0]) +_total_acceleration = vector_magnitude( + add_cartesian_vectors(_free_fall_acceleration_vector, _vessel_acceleration_vector)) + +_pressure_law_applied = pressure_law.law.subs({ + pressure_law.density: density, + pressure_law.height: height, + pressure_law.acceleration: _total_acceleration, }) -pressure_derived = solve(pressure_law_applied, pressure_law.hydrostatic_pressure, +_pressure_derived = solve(_pressure_law_applied, pressure_law.hydrostatic_pressure, dict=True)[0][pressure_law.hydrostatic_pressure] # Check if derived pressure is same as declared. -assert expr_equals(pressure_derived, law.rhs) +assert expr_equals(_pressure_derived, law.rhs) -@validate_input(density_liquid_=density_liquid, acceleration_=acceleration, height_=height) +@validate_input(density_liquid_=density, acceleration_=acceleration, height_=height) @validate_output(pressure) def calculate_pressure(density_liquid_: Quantity, acceleration_: Quantity, height_: Quantity) -> Quantity: result_expr = solve(law, pressure, dict=True)[0][pressure] result_expr = result_expr.subs({ - density_liquid: density_liquid_, + density: density_liquid_, acceleration: acceleration_, height: height_ }) diff --git a/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_vertically.py b/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_vertically.py index 2a44175b0..2558919c7 100644 --- a/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_vertically.py +++ b/symplyphysics/laws/hydro/pressure_of_liquid_in_vessel_moving_vertically.py @@ -1,41 +1,59 @@ +""" +Pressure of liquid in vessel moving vertically +============================================== + +If a vessel with a liquid moves with vertical acceleration, then the hydrostatic +pressure of the liquid depends on the density of the liquid, the acceleration of free +fall, the vertical acceleration of the vessel and the height of liquid. + +**Notation:** + +#. :quantity_notation:`acceleration_due_to_gravity`. + +.. + TODO: find link +""" + from sympy import (Eq, solve, sqrt) -from sympy.physics.units import acceleration_due_to_gravity as earth_free_fall_acceleration from symplyphysics import ( Vector, add_cartesian_vectors, symbols, - units, Quantity, - Symbol, - print_expression, validate_input, validate_output, vector_magnitude, + quantities, ) from symplyphysics.core.expr_comparisons import expr_equals from symplyphysics.laws.hydro import hydrostatic_pressure_from_density_and_depth_acceleration as pressure_law -# Description -## If a vessel with a liquid moves with vertical acceleration, then the hydrostatic pressure of the liquid -## depends on the density of the liquid, the acceleration of free fall, the vertical acceleration of the vessel -## and the height of liquid. +pressure = symbols.pressure +""" +:symbols:`pressure` of the liquid. +""" -## Law is: p = p0 * sqrt((g + a)^2) * h, where -## p - pressure, -## p0 - density of liquid, -## g - earth free fall acceleration, -## a - acceleration of vessel, -## h - height. +density = symbols.density +""" +:symbols:`density` of the liquid. +""" -# TODO: find link +acceleration = symbols.acceleration +""" +:symbols:`acceleration` of the vessel. +""" -pressure = Symbol("pressure", units.pressure) +height = symbols.height +""" +:symbols:`height` of the liquid column. +""" -density_liquid = Symbol("density_liquid", units.mass / units.volume) -acceleration = symbols.acceleration -height = Symbol("height", units.length) +law = Eq(pressure, density * sqrt((quantities.acceleration_due_to_gravity + acceleration)**2) * height) +""" +:laws:symbol:: -law = Eq(pressure, density_liquid * sqrt((earth_free_fall_acceleration + acceleration)**2) * height) +:laws:latex:: +""" # This law might be derived via hydrostatic pressure law. # The vessel moves vertically and the pressure exerted by the resultant force on a surface of equal pressure @@ -43,35 +61,31 @@ # If the acceleration "a" is positive, then it is directed upwards. If the acceleration "a" is negative, # then it is directed downward. -free_fall_acceleration_vector = Vector([0, earth_free_fall_acceleration]) +_free_fall_acceleration_vector = Vector([0, quantities.acceleration_due_to_gravity]) # Vertical vector -vessel_acceleration_vector = Vector([0, acceleration]) -total_acceleration = vector_magnitude( - add_cartesian_vectors(free_fall_acceleration_vector, vessel_acceleration_vector)) - -pressure_law_applied = pressure_law.law.subs({ - pressure_law.density: density_liquid, - pressure_law.depth: height, - pressure_law.acceleration: total_acceleration, +_vessel_acceleration_vector = Vector([0, acceleration]) +_total_acceleration = vector_magnitude( + add_cartesian_vectors(_free_fall_acceleration_vector, _vessel_acceleration_vector)) + +_pressure_law_applied = pressure_law.law.subs({ + pressure_law.density: density, + pressure_law.height: height, + pressure_law.acceleration: _total_acceleration, }) -pressure_derived = solve(pressure_law_applied, pressure_law.hydrostatic_pressure, +_pressure_derived = solve(_pressure_law_applied, pressure_law.hydrostatic_pressure, dict=True)[0][pressure_law.hydrostatic_pressure] # Check if derived pressure is same as declared. -assert expr_equals(pressure_derived, law.rhs) - - -def print_law() -> str: - return print_expression(law) +assert expr_equals(_pressure_derived, law.rhs) -@validate_input(density_liquid_=density_liquid, acceleration_=acceleration, height_=height) +@validate_input(density_liquid_=density, acceleration_=acceleration, height_=height) @validate_output(pressure) def calculate_pressure(density_liquid_: Quantity, acceleration_: Quantity, height_: Quantity) -> Quantity: result_expr = solve(law, pressure, dict=True)[0][pressure] result_expr = result_expr.subs({ - density_liquid: density_liquid_, + density: density_liquid_, acceleration: acceleration_, height: height_ }) diff --git a/symplyphysics/laws/hydro/reynolds_number_formula.py b/symplyphysics/laws/hydro/reynolds_number_formula.py index 0d543cc3e..7b7862311 100644 --- a/symplyphysics/laws/hydro/reynolds_number_formula.py +++ b/symplyphysics/laws/hydro/reynolds_number_formula.py @@ -2,10 +2,10 @@ Reynolds number formula ======================= -*Reynolds number* is a dimensionless quantity that characterizes the flow of a fluid. -It helps predict fluid flow patterns in different situations by measuring the ratio between inertial -and viscous forces. Low Reynolds numbers tend to correspond to laminar flows, while high Reynolds -numbers tend to correspond to turbulent flows. +*Reynolds number* is a dimensionless quantity that characterizes the flow of a fluid. It +helps predict fluid flow patterns in different situations by measuring the ratio between +inertial and viscous forces. Low Reynolds numbers tend to correspond to laminar flows, +while high Reynolds numbers tend to correspond to turbulent flows. **Links:** @@ -14,72 +14,43 @@ from sympy import Eq, solve from symplyphysics import ( - units, Quantity, - Symbol, validate_input, validate_output, - dimensionless, convert_to_float, + symbols, ) -reynolds_number = Symbol("reynolds_number", dimensionless) -r""" -Reynolds number of the fluid. - -Symbol: - :code:`Re` - -Latex: - :math:`\text{Re}` +reynolds_number = symbols.reynolds_number """ - -characteristic_length = Symbol("characteristic_length", units.length) +:symbols:`reynolds_number` of the fluid. """ -`Characteristic length `_ of the fluid -container whose value depends on its shape. -Symbol: - :code:`L` +characteristic_length = symbols.characteristic_length """ - -density = Symbol("density", (units.mass / units.volume)) -r""" -Density of the fluid. - -Symbol: - :code:`rho` - -Latex: - :math:`\rho` +:symbols:`characteristic_length` of the system. """ -flow_speed = Symbol("flow_speed", units.velocity) +density = symbols.density """ -Speed of the fluid flow. - -Symbol: - :code:`u` +:symbols:`density` of the fluid. """ -dynamic_viscosity = Symbol("dynamic_viscosity", units.pressure * units.time) -r""" -Dynamic viscosity of the fluid. - -Symbol: - :code:`mu` +flow_speed = symbols.flow_speed +""" +:symbols:`flow_speed` +""" -Latex: - :math:`\mu` +dynamic_viscosity = symbols.dynamic_viscosity +""" +:symbols:`dynamic_viscosity` of the fluid. """ law = Eq(reynolds_number, density * flow_speed * characteristic_length / dynamic_viscosity) -r""" -:code:`Re = rho * u * L / mu` +""" +:laws:symbol:: -Latex: - .. math:: - \text{Re} = \frac{\rho u L}{\mu} +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/shear_stress_is_proportional_to_speed_gradient.py b/symplyphysics/laws/hydro/shear_stress_is_proportional_to_speed_gradient.py index 587265418..8b2ad7008 100644 --- a/symplyphysics/laws/hydro/shear_stress_is_proportional_to_speed_gradient.py +++ b/symplyphysics/laws/hydro/shear_stress_is_proportional_to_speed_gradient.py @@ -29,60 +29,47 @@ """ from sympy import Eq, Derivative, solve -from symplyphysics import units, Quantity, Symbol, Function, validate_input, validate_output - -shear_stress = Symbol("shear_stress", units.pressure) -r""" -Shear stress. See :doc:`laws.dynamics.pressure_from_force_and_area`. - -Symbol: - :code:`tau` +from symplyphysics import ( + Quantity, + validate_input, + validate_output, + symbols, + clone_as_function, +) -Latex: - :math:`\tau` +shear_stress = symbols.shear_stress """ - -dynamic_viscosity = Symbol("dynamic_viscosity", units.pressure * units.time) -r""" -Dynamic viscosity of the fluid. - -Symbol: - :code:`eta` - -Latex: - :math:`\eta` +:symbols:`shear_stress`. """ -fluid_speed = Function("fluid_speed", units.velocity) +dynamic_viscosity = symbols.dynamic_viscosity """ -Fluid speed as a function of position perpendicular to the fluid flow, or layer position. - -Symbol: - :code:`u(y)` +:symbols:`dynamic_viscosity` of the fluid. """ -layer_position = Symbol("layer_position", units.length) +layer_position = symbols.position +""" +Layer :symbols:`position`, or position in the direction perpendicular to fluid velocity. """ -Layer position, or position in the direction perpendicular to fluid velocity. -Symbol: - :code:`y` +flow_speed = clone_as_function(symbols.flow_speed, [layer_position]) +""" +:symbols:`flow_speed` as a function of position perpendicular to the fluid flow, or +:attr:`~layer_position`. """ -law = Eq(shear_stress, dynamic_viscosity * Derivative(fluid_speed(layer_position), layer_position)) -r""" -:code:`tau = eta * Derivative(u(y), y)` +law = Eq(shear_stress, dynamic_viscosity * Derivative(flow_speed(layer_position), layer_position)) +""" +:laws:symbol:: -Latex: - .. math:: - \tau = \eta \frac{d u}{d y} +:laws:latex:: """ @validate_input( dynamic_viscosity_=dynamic_viscosity, - fluid_speed_before_=fluid_speed, - fluid_speed_after_=fluid_speed, + fluid_speed_before_=flow_speed, + fluid_speed_after_=flow_speed, layer_separation_=layer_position, ) @validate_output(shear_stress) @@ -96,7 +83,7 @@ def calculate_shear_stress( fluid_speed_before_) / layer_separation_ applied_law = law.subs({ dynamic_viscosity: dynamic_viscosity_, - fluid_speed(layer_position): fluid_speed_function, + flow_speed(layer_position): fluid_speed_function, }) result_expr = solve(applied_law, shear_stress)[0] return Quantity(result_expr) diff --git a/symplyphysics/laws/hydro/submerged_volume_of_floating_body_via_density_ratio.py b/symplyphysics/laws/hydro/submerged_volume_of_floating_body_via_density_ratio.py index 4c4ef5908..b5e6e08fb 100644 --- a/symplyphysics/laws/hydro/submerged_volume_of_floating_body_via_density_ratio.py +++ b/symplyphysics/laws/hydro/submerged_volume_of_floating_body_via_density_ratio.py @@ -11,7 +11,8 @@ **Conditions:** -#. :math:`\rho \le \rho_\text{fl}`, so the body must be floating. +#. :math:`\rho \le \rho_\text{fl}`, so the body must be floating. See below for the + description of the symbols. #. The body must be in static equilibrium. **Links:** @@ -19,57 +20,42 @@ #. `Physics LibreTexts, formula 10.3.17 `__. """ -from sympy import (Eq, solve) -from symplyphysics import (units, Quantity, Symbol, validate_input, validate_output, convert_to_si) - -submerged_volume = Symbol("submerged_volume", units.volume) -r""" -Volume submerged in the fluid, which is equal to the volume of the displaced fluid. - -Symbol: - :code:`V_fl` - -Latex: - :math:`V_\text{fl}` +from sympy import Eq, solve +from symplyphysics import ( + Quantity, + validate_input, + validate_output, + convert_to_si, + symbols, + clone_as_symbol, +) + +submerged_volume = clone_as_symbol(symbols.volume, display_symbol="V_fl", display_latex="V_\\text{fl}") """ - -body_volume = Symbol("body_volume", units.volume) +:symbols:`volume` submerged in the fluid, which is equal to the volume of the displaced +fluid. """ -Total volume of the body. -Symbol: - :code:`V` +body_volume = symbols.volume """ - -body_density = Symbol("body_density", units.mass / units.volume) -r""" -Density of the body. - -Symbol: - :code:`rho` - -Latex: - :math:`\rho` +Total :symbols:`volume` of the body. """ -fluid_density = Symbol("fluid_density", units.mass / units.volume) -r""" -Density of the fluid. - -Symbol: - :code:`rho_fl` +body_density = symbols.density +""" +:symbols:`density` of the body. +""" -Latex: - :math:`\rho_\text{fl}` +fluid_density = clone_as_symbol(symbols.density, display_symbol="rho_fl", display_latex="\\rho_\\text{fl}") +""" +:symbols:`density` of the fluid. """ law = Eq(submerged_volume / body_volume, body_density / fluid_density) -r""" -:code:`V_fl / V = rho / rho_fl` +""" +:laws:symbol:: -Latex: - .. math:: - \frac{V_\text{fl}}{V} = \frac{\rho}{\rho_\text{fl}} +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/surface_tension_force_via_surface_tension_and_length.py b/symplyphysics/laws/hydro/surface_tension_force_via_surface_tension_and_length.py index fd413ba57..66d895746 100644 --- a/symplyphysics/laws/hydro/surface_tension_force_via_surface_tension_and_length.py +++ b/symplyphysics/laws/hydro/surface_tension_force_via_surface_tension_and_length.py @@ -11,47 +11,29 @@ #. `Wikipedia `__. """ -from sympy import (Eq, solve) -from symplyphysics import ( - symbols, - units, - Quantity, - Symbol, - validate_input, - validate_output, -) +from sympy import Eq, solve +from symplyphysics import symbols, Quantity, validate_input, validate_output surface_tension_force = symbols.force """ Surface tension :symbols:`force`. """ -surface_tension = Symbol("surface_tension", units.force / units.length) -r""" -Surface tension of the fluid. - -Symbol: - :code:`gamma` - -Latex: - :math:`\gamma` +surface_tension = symbols.surface_tension """ - -length = Symbol("length", units.length) +:symbols:`surface_tension` of the fluid. """ -Length of the contour to which the force is applied. -Symbol: - :code:`l` +length = symbols.length +""" +:symbols:`length` of the contour to which the force is applied. """ law = Eq(surface_tension_force, surface_tension * length) -r""" -:code:`F = gamma * l` +""" +:laws:symbol:: -Latex: - .. math:: - F = \gamma l +:laws:latex:: """ diff --git a/symplyphysics/laws/hydro/volume_flux_is_constant.py b/symplyphysics/laws/hydro/volume_flux_is_constant.py index 27f55d909..4afc2728f 100644 --- a/symplyphysics/laws/hydro/volume_flux_is_constant.py +++ b/symplyphysics/laws/hydro/volume_flux_is_constant.py @@ -17,58 +17,46 @@ from sympy import Eq, solve, dsolve, Derivative from symplyphysics import ( - units, Quantity, - Symbol, - Function, validate_input, validate_output, + symbols, + clone_as_function, ) -tube_area = Function("tube_area", units.area) +time = symbols.time """ -Cross-sectional area of the tube of flow as a function of time. - -Symbol: - :code:`A(t)` +:symbols:`time`. """ -fluid_speed = Function("fluid_speed", units.velocity) +tube_area = clone_as_function(symbols.area, [time]) """ -Fluid speed as a function of time. - -Symbol: - :code:`u(t)` +Cross-sectional :symbols:`area` of the tube of flow as a function of :attr:`~time`. """ -time = Symbol("time", units.time) +flow_speed = clone_as_function(symbols.flow_speed, [time]) """ -Time. - -Symbol: - :code:`t` +:symbols:`flow_speed` of the fluid as a function of :attr:`~time`. """ -law = Eq(Derivative(tube_area(time) * fluid_speed(time), time), 0) -r""" -:code:`Derivative(A(t) * u(t), t) = 0` +law = Eq(Derivative(tube_area(time) * flow_speed(time), time), 0) +""" +:laws:symbol:: -Latex: - .. math:: - \frac{d (A u)}{d t} = 0 +:laws:latex:: """ @validate_input(tube_area_before_=tube_area, - fluid_speed_before_=fluid_speed, + fluid_speed_before_=flow_speed, tube_area_after_=tube_area) -@validate_output(fluid_speed) +@validate_output(flow_speed) def calculate_fluid_speed(tube_area_before_: Quantity, fluid_speed_before_: Quantity, tube_area_after_: Quantity) -> Quantity: - dsolved = dsolve(law, fluid_speed(time)) + dsolved = dsolve(law, flow_speed(time)) c1_value = solve(dsolved, "C1")[0].subs({ tube_area(time): tube_area_before_, - fluid_speed(time): fluid_speed_before_, + flow_speed(time): fluid_speed_before_, }) result_expr = dsolved.subs({ "C1": c1_value, diff --git a/symplyphysics/laws/hydro/weight_in_fluid_via_ratio_of_densities.py b/symplyphysics/laws/hydro/weight_in_fluid_via_ratio_of_densities.py index 4864f555d..9bde1c7e5 100644 --- a/symplyphysics/laws/hydro/weight_in_fluid_via_ratio_of_densities.py +++ b/symplyphysics/laws/hydro/weight_in_fluid_via_ratio_of_densities.py @@ -11,53 +11,44 @@ #. `Physics LibreTexts, derivable from here `__. """ -from sympy import (Eq, solve) -from symplyphysics import (clone_as_symbol, symbols, units, Quantity, Symbol, validate_input, - validate_output) +from sympy import Eq, solve +from symplyphysics import ( + clone_as_symbol, + symbols, + Quantity, + validate_input, + validate_output, +) weight_in_fluid = clone_as_symbol(symbols.force, display_symbol="W_fl", display_latex="W_\\text{fl}") """ -Weight of the body immersed in the fluid. +Weight of the body immersed in the fluid. See :symbols:`force`. """ weight_in_vacuum = clone_as_symbol(symbols.force, display_symbol="W_vac", display_latex="W_\\text{vac}") """ -Weight of the body in vacuum, i.e. its true weight. +Weight of the body in vacuum, i.e. its true weight. See :symbols:`force`. """ -fluid_density = Symbol("fluid_density", units.mass / units.volume) -r""" -Density of the fluid. - -Symbol: - :code:`rho_fl` - -Latex: - :math:`\rho_\text{fl}` +fluid_density = clone_as_symbol(symbols.density, display_symbol="rho_fl", display_latex="\\rho_\\text{fl}") +""" +:symbols:`density` of the fluid. """ -body_density = Symbol("body_density", units.mass / units.volume) -r""" -Density of the body. - -Symbol: - :code:`rho_b` - -Latex: - :math:`\rho_\text{b}` +body_density = clone_as_symbol(symbols.density, display_symbol="rho_b", display_latex="\\rho_\\text{b}") +""" +:symbols:`density` of the body. """ law = Eq(weight_in_fluid, weight_in_vacuum * (1 - (fluid_density / body_density))) -r""" -:code:`W_fl = W_vac * (1 - rho_fl / rho_b)` +""" +:laws:symbol:: -Latex: - .. math:: - W_\text{fl} = W_\text{vac} \left( 1 - \frac{\rho_\text{fl}}{\rho_\text{b}} \right) +:laws:latex:: """ diff --git a/symplyphysics/symbols/__init__.py b/symplyphysics/symbols/__init__.py index 89edfe68c..104eb8258 100644 --- a/symplyphysics/symbols/__init__.py +++ b/symplyphysics/symbols/__init__.py @@ -128,6 +128,16 @@ "diameter", "surface_tension", "orthogonal_distance", + "dynamic_pressure", + "mechanical_efficiency", + "hydrostatic_pressure", + "froude_number", + "volumetric_flow_rate", + "nusselt_number", + "reynolds_number", + "stress", + "shear_stress", + "flow_speed", # electrodynamics "admittance", "electrical_conductance", @@ -212,6 +222,7 @@ "thermal_diffusivity", "attractive_forces_parameter", "excluded_volume_parameter", + "heat_transfer_coefficient", # astronomy "absolute_magnitude", "apparent_magnitude", diff --git a/symplyphysics/symbols/classical_mechanics.py b/symplyphysics/symbols/classical_mechanics.py index bc365db06..dc90b1842 100644 --- a/symplyphysics/symbols/classical_mechanics.py +++ b/symplyphysics/symbols/classical_mechanics.py @@ -241,7 +241,12 @@ mass_flow_rate = SymbolNew("mu", units.mass / units.time, display_latex="\\mu") """ -**Mass flow rate** is the mass of a substance which passes per unit of time. +**Mass flow rate** is the mass of a substance which passes per unit time. +""" + +volumetric_flow_rate = SymbolNew("Q", units.volume / units.time) +""" +**Volumetric flow rate** is the volume of a substance which passes per unit time. """ stiffness = SymbolNew("k", units.force / units.length) @@ -428,3 +433,90 @@ #. `Wikipedia `__. """ + +dynamic_pressure = SymbolNew("q", units.pressure) +""" +**Dynamic pressure** is the :symbols:`kinetic_energy` per unit :symbols:`volume` of a +fluid. See :ref:`Quantity is volumetric density times volume`. + +**Links:** + +#. `Wikipedia `__. +""" + +mechanical_efficiency = SymbolNew("eta", dimensionless, display_latex="\\eta") +""" +**Mechanical efficiency** is a dimensionless ratio that measures the efficiency of a +mechanism or machine in transforming the power input to the device to power output. + +**Links:** + +#. `Wikipedia `__. +""" + +hydrostatic_pressure = SymbolNew("p", units.pressure) +""" +**Hydrostatic pressure** is the pressure exerted by a fluid at equilibrium at a given +point within the fluid, due to the force of gravity. + +**Links:** + +#. `Wikipedia `__. +""" + +froude_number = SymbolNew("Fr", dimensionless, display_latex="\\text{Fr}") +""" +The **Froude number** is a dimensionless number defined as the ratio of the flow inertia +to the external force field. +""" + +speed_of_sound = SymbolNew("c", units.velocity) +""" +The **speed of sound** is the distance traveled per unit of time by a sound wave as it +propagates through an elastic medium. + +**Links:** + +#. `Wikipedia `__. +""" + +nusselt_number = SymbolNew("Nu", dimensionless, display_latex="\\text{Nu}") +""" +The **Nusselt number** is the ratio of total heat transfer (convection + conduction) to +conductive heat transfer across a boundary of a fluid. + +**Links:** + +#. `Wikipedia `__. +""" + +reynolds_number = SymbolNew("Re", dimensionless, display_latex="\\text{Re}") +""" +The **Reynolds number** is a dimensionless quantity that helps predict fluid flow +patterns in different situations by measuring the ratio between inertial and viscous +forces. + +**Links:** + +#. `Wikipedia `__. +""" + +shear_stress = SymbolNew("tau", units.pressure, display_latex="\\tau") +""" +**Shear stress** is the component of stress coplanar with a material cross section. + +**Links:** + +#. `Wikipedia `__. +""" + +flow_speed = SymbolNew("u", units.velocity) +""" +**Flow speed** is the magnitude of the vector of **flow velocity** (also called +**macroscopic velocity**). Flow velocity is a vector field used to mathematically +describe the motion of a continuum. + +**Links:** + +#. `Wikipedia `__. +""" diff --git a/symplyphysics/symbols/thermodynamics.py b/symplyphysics/symbols/thermodynamics.py index bc971af7f..a87de60fe 100644 --- a/symplyphysics/symbols/thermodynamics.py +++ b/symplyphysics/symbols/thermodynamics.py @@ -231,3 +231,16 @@ Parameter specific to each individual substance, usually attributed to the amount of excluded molar volume due to a finite size of particles. """ + +heat_transfer_coefficient = SymbolNew("h", units.power / (units.area * units.temperature)) +""" +The **heat transfer coefficient** is the proportionality constant between the heat flux +:math:`d \dot{Q} / d A` and the thermodynamic driving force for the flow of heat +(i.e. the temperature difference :math:`\Delta T`). In other words, it is the rate of +heat transfer through a surface of unit area that results in a unit temperature +difference. + +**Links:** + +#. `Wikipedia `__. +"""