PyMPDATA icon indicating copy to clipboard operation
PyMPDATA copied to clipboard

API: introduce equation-specific solvers that are able to handle systems of eq's.

Open slayoo opened this issue 11 months ago • 3 comments

slayoo avatar Mar 10 '25 12:03 slayoo

logic for computing advector field from momentum scalar fields and extrapolating it in time to t+1/2 would be part of it

slayoo avatar Mar 10 '25 12:03 slayoo

  • some parallelism control here?

slayoo avatar Mar 10 '25 12:03 slayoo

Current plan of refactoring PyMPDATA to include multiple solvers able to handle systems of eq's and enable reusable solver components.

classDiagram
        Advection --|> FluidDynamics
        Advection --|> BlackScholesMerton
        BlackScholesMerton --|> BSMAmerican
        BlackScholesMerton --|> BSMEuropean
        FluidDynamics --|>  Burgers
        FluidDynamics --|>  ShallowWater
        FluidDynamics  --|> Buoyant
        Buoyant --|>  Boussinesq
        Buoyant --|>  Anelastic
        class Advection {
            +MPDATA options
            +Jacobian of coordinate transformation
            +Diffusion (ON/OFF)
            +Dimensionality (1D, 2D, 3D)
            +System size (1eq, 2eq, ...)
            +Right hand side terms 
            +RHS Integrator (euler_a, euler_b, trapez)
        }
        class FluidDynamics {
            +Velocity interpolation
            +Velocity extrapolation (ON/OFF)
            +Momentum source terms (Coriolis, Immersed boundary)
        }
        class Burgers {
            +...
        }
        class ShallowWater {
            +Batimetry
        }
        class Buoyant {
            +Poisson solver type
            +Subgrid dynamics (Implicit LES, Smagoliński, ...)
        }
        class Boussinesq {
            +...
        }
        class Anelastic {
            +...
        }
        class BlackScholesMerton {
           +Averaging type
       }
       class BSMEuropean {
          +BSM equality
      }
       class BSMAmerican {
          +BSM inequality
      }

LIttle TODO list:

  • [ ] PR with support for multiple equations in current Solver
  • [ ] Implement velocity interpolation class
  • [ ] Think about constructors (what parameters do we need?)
  • [ ] Future implementations (Anelastic, Burgers)
  • [ ] add an __init__ flag enabling/disabling checks for CFL condition

Sfonxu avatar May 08 '25 12:05 Sfonxu