Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add friction model "Hofer" #683

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

Conversation

jkisse
Copy link
Collaborator

@jkisse jkisse commented Jan 6, 2025

The friction factor "Hofer" is introduced. It is an explicit implementation of Colebrook, used by some established Gas Grid Simulation tools.
Please refer to the added paragraph in the docs for more details.

@jkisse jkisse requested review from dlohmeier and kbensafta January 6, 2025 18:08
@jkisse jkisse changed the title add documentation for Hofer, add transition area approach add friction model "Hofer" Jan 7, 2025
@dlohmeier
Copy link
Collaborator

Looks interesting. I just thought that the transition area is relevant for different models. Maybe we should think about how to correct equations for laminar / turbulent flow. I think there is an issue on this topic and this implementation could be a nice approach.

dlohmeier
dlohmeier previously approved these changes Jan 7, 2025
@jkisse
Copy link
Collaborator Author

jkisse commented Jan 8, 2025

Thanks @dlohmeier!
I'd also appreciate your opinion on the usage of np.divide etc. in numba functions, e.g. here. It seems to me as if the advantage of array-processing cannot be used in the for-loops, thus it might be slightly more efficient to use the native "/" directly instead of np.divide? Did you investigate that a bit when you implemented the numba-functions?

(analogously for np.abs and np.power)

@dlohmeier
Copy link
Collaborator

As far as I can recall, numba was good at exactly this: identify numpy code within jit-decorated functions and compile them correctly. I always found it more readable and wrt. timings I remember that I found no difference or a slight advantage of the numpy ufuncs over native code. It might have changed with newer numba versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants