oemof / tespy

Thermal Engineering Systems in Python (TESPy). This package provides a powerful simulation toolkit for thermal engineering plants such as power plants, district heating systems or heat pumps.
https://tespy.readthedocs.io
MIT License
272 stars 85 forks source link

Tiny deviation in calculation of Darcy friction factor? #254

Closed stianchris closed 3 years ago

stianchris commented 3 years ago

Hello Francesco,

I'm just checking my model and I stumbled upon a tiny deviation in the formula for the darcy friction factor in comparison to the literature mentioned (https://tespy.readthedocs.io/en/master/api/tespy.tools.html#tespy.tools.helpers.darcy_friction_factor and same for the code https://tespy.readthedocs.io/en/master/_modules/tespy/tools/helpers.html#darcy_friction_factor in comparison to VDI Wärmeatlas, 2018):

Blasius according to VDI is relevant for Re ~3000 to 100,000 (10^5), for 10^4 < Re < 10^6 Hanakov is relevant. In the tespy documentation, Hanakov is used for 10^5 < Re < 510^6; in the tespy code Hanakov is used for 510^4 < Re < 10^6: if re <= 5e4: return blasius(re) elif re < 1e6: return hanakov(re)

Did I oversee something? I guess it does not really affect the results...

Kind regards,

Christian

fwitte commented 3 years ago

Hi Christian, thank you very much for reporting. I checked it for several values of Reynolds and there is indeed a small difference. I fixed it and uploaded the code to the dev branch, changes go on PyPI with the next release. Best Francesco

stianchris commented 3 years ago

Nice! and quick as always ;)

fwitte commented 3 years ago

How did you even spot that? :D