Skip to content

Conversation

ray-chew
Copy link
Owner

Some stragglers have not yet been touched, see #57. But all crucial bottleneck functions have been refactored and optimised. The codebase has also been extensively restructured. This PR will prepare the stage for the plans in roadmap #60.

ray-chew added 30 commits June 16, 2025 22:48
since this function is no longer used
removed comments and code I intend to deprecate
removed comments and code I intend to deprecate
…ive_impl_part

also refactored second_projection.divergence_nodes. this commit removes more unnecessary code and make everything consistent with mem as an input argument
not all operators will be used, but might be worth keeping for future sake
but this appears to be really slow, as the stencil is never cached.
this seems to be substantially faster as it can be cached
refactored second_projection.euler_backward_non_advective_impl_part
and reflective of the current directory structure
fixed minor bug with set_boundary on rho
@ray-chew ray-chew added this to the First proper release milestone Jun 18, 2025
@ray-chew ray-chew requested a review from Copilot June 18, 2025 05:32
@ray-chew ray-chew self-assigned this Jun 18, 2025
@ray-chew ray-chew added enhancement New feature or request infrastructure All infrastructure needs go here refactor and optimisation The catch-it-all label labels Jun 18, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors and optimises crucial bottlenecks in the flow solver while restructuring the codebase for improved clarity and maintenance. Key changes include removal of legacy functions, renaming and consolidation of timestep and flux routines, and updating module dependencies from mpv to npf.

  • Removed the obsolete synchronise_variables function in the EOS module.
  • Renamed functions and updated boundary handling across CFD, advection, and data assimilation modules.
  • Updated test and documentation references to reflect the new module structure.

Reviewed Changes

Copilot reviewed 61 out of 61 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/pybella/flow_solver/physics/eos.py Removed unused legacy functions.
src/pybella/flow_solver/physics/cfl.py Updated function calls and parameter formatting for clarity.
src/pybella/flow_solver/numerics/implicit_euler.py New implementations with a potential issue in 3D system preparation.
src/pybella/flow_solver/numerics/explicit_euler.py Refactored explicit Euler step with minor style updates.
src/pybella/flow_solver/numerics/explicit_advection/* Renamed and restructured advection flux and recovery functions.
src/pybella/flow_solver/discretisation/time_update.py Adapted to use new npf variables and updated boundary calls.
src/pybella/data_assimilation/* Updated dependency references to use the new boundary modules.
docs/* Updated API and documentation to match module refactorings.
Comments suppressed due to low confidence (2)

src/pybella/flow_solver/numerics/explicit_advection/compute_advection.py:8

  • [nitpick] The function name 'strange_splitting' is ambiguous and does not clearly describe its behavior. Consider renaming it to a more descriptive name, such as 'advect' or 'explicit_splitting', to improve code clarity.
def strange_splitting(mem, ud, dt, odd, label, writer=None):

src/pybella/flow_solver/numerics/implicit_euler.py:219

  • In _prepare_3d_system, diag_inv is explicitly set to None, which may indicate a missing preconditioner for the 3D case. Please verify whether a computed diag_inv is required to ensure the solver's correctness.
    diag_inv = None  # TODO: Verify if this should be computed for 3D

@ray-chew
Copy link
Owner Author

Yet another massive PR. I am going to merge this, bypassing review requirements, after all tests have passed.
Hurhur:
image

@ray-chew ray-chew merged commit 61fd913 into develop Jun 18, 2025
2 checks passed
@ray-chew ray-chew deleted the refactor branch June 18, 2025 19:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request infrastructure All infrastructure needs go here refactor and optimisation The catch-it-all label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant