Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxcode123 committed Apr 9, 2024
1 parent e9c70f2 commit 6374a8e
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# property-utils
Utilities for programming that involves physical properties
[![image](https://img.shields.io/pypi/v/property-utils.svg)](https://pypi.python.org/pypi/property-utils)
[![image](https://img.shields.io/pypi/l/property-utils.svg)](https://opensource.org/license/mit/)
[![image](https://img.shields.io/pypi/pyversions/property-utils.svg)](https://pypi.python.org/pypi/property-utils)
[![Actions status](https://github.com/Maxcode123/property-utils/actions/workflows/test-package.yml/badge.svg?branch=main)](https://github.com/Maxcode123/property-utils/actions/workflows/test-package.yml?query=branch%3Amain)


---
**Documentation:** https://maxcode123.github.io/property-utils/
Expand All @@ -8,10 +11,13 @@ Utilities for programming that involves physical properties

---

# property-utils
*Utilities for programming that involves physical properties*

## What is property-utils?
property-utils is a python library that aims at making programming with physical properties easier. It was created to be used by scientists and engineers with little programming experience.

**What is provided by property-utils?**
***What is provided by property-utils?***

### Unit arithmetics
You can divide and multiply units to create new units. For example you can create velocity units by dividing length units with time units.
Expand Down Expand Up @@ -48,7 +54,7 @@ from property_utils.units import (

tube_radius = p(12, CENTI_METER)
tube_length = p(2.3, METER)
heat_exchange_area = 2 * math.pi * tube_radius * tube_length
heat_exchange_area = 2 * math.pi * tube_length * tube_radius

heat_transfer_coeff = p(150, BTU / RANKINE / FOOT**2 / HOUR)

Expand All @@ -60,13 +66,25 @@ diff_in = hot_in - cold_in
diff_out = hot_out - cold_out
temperature_diff = (diff_in - diff_out) / math.log((diff_in / diff_out).value)

heat_duty = (heat_transfer_coeff * heat_exchange_area * temperature_diff).to_unit(KILO_WATT)
print("Heat transfer coefficient =", heat_transfer_coeff)
print("Heat exchange area =", heat_exchange_area)
print("Temperature difference =", temperature_diff)

heat_duty = heat_transfer_coeff * heat_exchange_area * temperature_diff

print(heat_duty)
print("\nHeat duty =", heat_duty)
print(" =", heat_duty.to_si())
print(" =", heat_duty.to_unit(KILO_WATT))
```

Result:

```
306.1224518046951 kW
Heat transfer coefficient = 150 Btu / (ft^2) / hr / °R
Heat exchange area = 1.7341591447815656 (m^2)
Logarithmic mean temperature difference = 207.24308513672648 K
Heat duty = 1044588.4611345044 Btu / hr
= 306122.45180469507 J / s
= 306.12245180469506 kW
```

0 comments on commit 6374a8e

Please sign in to comment.