jonnymaserati/welleng

Why is `l_c` in feet while `l_cs` and `l_xs` are in meters?

Closed this issue · 1 comments

welleng/welleng/survey.py

Lines 1648 to 1658 in 0afc2dd

l_c = (
(sections[-1].md - sections[1].md) * ureg.meters
).to('ft').m
l_cs, l_xs = np.vstack([
[
l.md - u.md,
np.linalg.norm(np.array(l.location) - np.array(u.location))
]
for u, l in zip(sections_upper, sections_lower)
]).T

Because of America.

The original method came from University Texas where they assume that the world works in feet and came up with and index in feet (but not mentioning this anywhere in their papers).

If you look at the next chunk of code, you'll see that l_cs and l_xs are used as a ratio, so as long as their units are consistent then the ratio is dimensionless and some compute is saved, saving some energy and reducing welleng's carbon cost.

welleng/welleng/survey.py

Lines 1660 to 1669 in 0afc2dd

ti = np.hstack((
np.array([0.0]),
(
(n_sections / (n_sections + 1)) * (1 / l_c) * (
np.cumsum(
(l_cs / l_xs) - 1
)
)
) * 1e7
))