zoomy_core.model.boundary_conditions module

zoomy_core.model.boundary_conditions module#

Module zoomy_core.model.boundary_conditions.

class zoomy_core.model.boundary_conditions.BoundaryCondition(*, tag, name)#

Bases: Parameterized

Default implementation. The required data for the ‘ghost cell’ is the data from the interior cell. Can be overwritten e.g. to implement periodic boundary conditions.

tag = 'bc'#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute ghost cell value (legacy interface).

face_state(Q_face, Qaux_face, normal, parameters)#

Compute the boundary-side Riemann state from the reconstructed face value.

Called at boundary faces inside the flux operator. Q_face is the MUSCL-reconstructed interior state at the face. Returns the state that the Riemann solver sees on the boundary side.

Default: same as Q_face (Neumann / zero-flux).

name = 'BoundaryCondition'#
class zoomy_core.model.boundary_conditions.Extrapolation(*, use_gradient, tag, name)#

Bases: BoundaryCondition

Extrapolation. (class).

use_gradient = True#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

face_state(Q_face, Qaux_face, normal, parameters)#

Extrapolation: boundary state = interior face state (zero flux).

name = 'Extrapolation'#
class zoomy_core.model.boundary_conditions.InflowOutflow(*, prescribe_fields, tag, name)#

Bases: BoundaryCondition

InflowOutflow. (class).

prescribe_fields = {}#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'InflowOutflow'#
class zoomy_core.model.boundary_conditions.Lambda(*, prescribe_fields, tag, name)#

Bases: BoundaryCondition

Lambda. (class).

prescribe_fields = {}#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'Lambda'#
class zoomy_core.model.boundary_conditions.FromData(*, prescribe_fields, timeline, tag, name)#

Bases: BoundaryCondition

FromData. (class).

prescribe_fields = {}#
timeline = None#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'FromData'#
class zoomy_core.model.boundary_conditions.CharacteristicReflective(*, D, L, M, R, S, tag, name)#

Bases: BoundaryCondition

CharacteristicReflective. (class).

R = None#
L = None#
D = None#
S = None#
M = None#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'CharacteristicReflective'#
class zoomy_core.model.boundary_conditions.Wall(*, blending, momentum_field_indices, permeability, use_gradient, wall_slip, tag, name)#

Bases: BoundaryCondition

Wall. (class).

momentum_field_indices = [[1, 2]]#
permeability = 0.0#
wall_slip = 1.0#
blending = 0.0#
use_gradient = True#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

face_state(Q_face, Qaux_face, normal, parameters)#

Wall: reflect normal momentum component of the reconstructed face value.

name = 'Wall'#
class zoomy_core.model.boundary_conditions.RoughWall(*, CsW, Ks, blending, momentum_field_indices, permeability, use_gradient, wall_slip, tag, name)#

Bases: Wall

RoughWall. (class).

CsW = 0.5#
Ks = 0.001#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'RoughWall'#
class zoomy_core.model.boundary_conditions.Periodic(*, periodic_to_physical_tag, tag, name)#

Bases: BoundaryCondition

Periodic. (class).

periodic_to_physical_tag = ''#
compute_boundary_condition(time, X, dX, Q, Qaux, parameters, normal)#

Compute boundary condition.

name = 'Periodic'#
class zoomy_core.model.boundary_conditions.SystemExtrapolation(tag=None)#

Bases: object

Apply Extrapolation to all equations in the system.

apply_to_system_bcs(system_bcs, tag=None)#
class zoomy_core.model.boundary_conditions.SystemPeriodic(tag=None, periodic_to_physical_tag='')#

Bases: object

Apply Periodic to all equations in the system.

apply_to_system_bcs(system_bcs, tag=None)#
class zoomy_core.model.boundary_conditions.SystemWall(tag=None, permeability=0.0, wall_slip=1.0)#

Bases: object

System-aware wall BC: Extrapolation for scalars, reflection for momentum.

Applied via system.boundary_conditions.apply(SystemWall(), tag="right"). The Wall BC holds a reference to the system and reads its equations to determine scalar vs momentum fields automatically.

Parameters:
  • tag (str) – Boundary tag (e.g. “right”, “bottom”).

  • permeability (float) – 0 = impermeable (default), 1 = fully permeable.

  • wall_slip (float) – 1 = free-slip (default), 0 = no-slip.

apply_to_system_bcs(system_bcs, tag=None, system=None)#
class zoomy_core.model.boundary_conditions.WallMomentumBC(tag, system_bcs, permeability=0.0, wall_slip=1.0, use_gradient=True)#

Bases: object

Wall BC for momentum equations — reads the system to build reflection.

Holds a reference to the SystemBoundaryConditions (and thus knows which equations exist). At compile time, determines the momentum vector grouping automatically from the equation names.

The normal/tangential decomposition works for any system derived from INS: SWE (hu), SME (hu0, hu1, …), VAM (hu, hv, hw moments), full INS.

property momentum_equations#

Momentum equations in the current system.

zoomy_core.model.boundary_conditions.compile_system_bcs(system_bcs, equation_variable_map, dimension)#

Translate system-aware BCs into the legacy BoundaryConditions container.

Reads per-equation, per-tag BCs from system_bcs and produces a BoundaryConditions with one entry per tag. The equation_variable_map maps equation names to variable indices so the Wall BC knows which indices form the momentum vector.

Parameters:
  • system_bcs (SystemBoundaryConditions) –

  • equation_variable_map (dict) – {equation_name: [var_index, ...]}

  • dimension (int) – Model dimension (1 or 2 for horizontal).

Return type:

BoundaryConditions

class zoomy_core.model.boundary_conditions.BoundaryConditions(boundary_conditions=None, **params)#

Bases: Parameterized

BoundaryConditions. (class).

boundary_conditions_list = []#
property list_sorted_function_names#

List sorted function names.

property boundary_conditions_list_dict#

Boundary conditions list dict.

name = 'BoundaryConditions'#
get_boundary_condition_function(time, X, dX, Q, Qaux, parameters, normal, function_name='boundary_conditions')#

Get boundary condition function.