-
Notifications
You must be signed in to change notification settings - Fork 4
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 common simulation functions #43
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very nice! I’ve been meaning to bring up the usage of project
for computing CFL number but didn’t have a chance to do it. Yet, I noticed it was extremely slow when I used it for post-processing, so I would really like to avoid using it especially with turtle. Please let me know if you want me to work on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments. In general a very nice and well written PR.
In general I wonder if we should switch print statements with a logger, as it would make it easier to turn on and off such statements.
Thank you both for your comments! I have addressed some of them now and will look at the other comments later. |
I think we have addressed all the comments. Is this ready to be merged? @jorgensd |
…flow_properties' functions as recommended by Jørgen
In this pull request I have added a set of functions in a new file called
simulation_common.py
. These functions provides various functionalities for mesh and data handling, as well as some flow analysis. Here's a short summary of each function:load_mesh_and_data
: Loads mesh, boundary data, and domain data from an HDF5 file.print_mesh_summary
: Prints geometric information about a volumetric mesh.load_mesh_info
: Loads and processes mesh information from a JSON file, returning various parameters like inlet IDs, outlet IDs, wall ID, mean flow rate, area ratios, and inlet areas. The information in the JSON file is currently not always correct, so this function is not so useful yet.load_probe_points
: Loads probe points from a file based on the mesh file's path.print_probe_points
: Prints velocity and pressure at specified probe points.peval
: Allows parallel synchronized evaluation of a function. This is used for probes.calculate_and_print_flow_properties
: Calculates and prints flow properties such as flow rate, velocity, CLF numbers and Reynolds numbers.