zoomy_foam.solvers

zoomy_foam.solvers#

zoomy_foam.solvers — param.Parameterized solver wrappers (gui REQ-133).

The GUI/CLI-facing entry point for the OpenFOAM (zoomyFoam) backend. Same shape as zoomy_amrex.solvers / zoomy_dmplex.solvers: bounded param attributes (the GUI auto-generates widgets), a uniform solve(model, mesh, settings) that writes a VTK series into settings.output.directory and returns the .pvd path (the gui converts VTK→h5 with zoomy_prepost).

from zoomy_foam.solvers import HyperbolicSolver
solver = HyperbolicSolver(CFL=0.9, order=2)
solver.solve(model, mesh, settings)      # -> .pvd in settings.output.directory

Design (gui REQ-133, user-approved 2026-07-13):

  • settings is STRUCTURED — settings.output.{directory, filename, snapshots} is always honored; settings.time_end / settings.mesh.n_cells carry the run/grid properties. Model-/scheme-specific things (reconstruction, eigenvalues, sources, IC, BC) come from the MODEL symbolically.

  • mesh is a descriptor {"domain": [x0,x1(,y0,y1)], "n_cells": [nx(,ny)]} — a structured 1-D interval OR 2-D quad grid (dimension = len(n_cells)). RESOLUTION always comes from the mesh/settings, never a solver param. A 3-D or unstructured .msh case goes through gmshToFoam — a follow-up.

  • NO case knowledge lives here — the wrapper owns codegen → controlDict → wmake → run → VTK; case physics (walls, inflow) are BCs on the MODEL.

Module Contents#

Classes#

HyperbolicSolver

Explicit finite-volume march for hyperbolic models (SWE / SME).

SplitSolver

N sequential system models + pressure projection (Chorin pressure-corrector). The split structure — predictor / pressure / corrector sub-models — comes from the MODEL (model.chorin_split, e.g. VAM); this wrapper drives the chorinFoam app (split codegen → wmake chorin_app → case → run → VTK) and exposes only the march / pressure-solve knobs.

API#

class zoomy_foam.solvers.HyperbolicSolver(**params)#

Bases: zoomy_foam.solvers._BaseSolver

Explicit finite-volume march for hyperbolic models (SWE / SME).

The GUI auto-generates widgets from these bounded params.

Initialization

CFL#

‘Number(…)’

order#

‘Integer(…)’

time_scheme#

‘Selector(…)’

solve(model, mesh, settings, on_progress=None)#
class zoomy_foam.solvers.SplitSolver(**params)#

Bases: zoomy_foam.solvers._BaseSolver

N sequential system models + pressure projection (Chorin pressure-corrector). The split structure — predictor / pressure / corrector sub-models — comes from the MODEL (model.chorin_split, e.g. VAM); this wrapper drives the chorinFoam app (split codegen → wmake chorin_app → case → run → VTK) and exposes only the march / pressure-solve knobs.

Initialization

cfl#

‘Number(…)’

pressure_tol#

‘Number(…)’

pressure_maxit#

‘Integer(…)’

solve(model, mesh, settings, on_progress=None)#