zoomy_foam.vof#
The resolved participant of an SME | VOF coupling: OpenFOAM 13 incompressibleVoF in a
rectangular tank, with the swePreciceCoupling function object (this package’s
swePreciceCoupling/) imposing the reduced arm’s column on the coupled patches.
The function object compiles the reduced model’s kernels in (its Model.H /
NumericsKernels.H, emitted here from the model’s SystemModel), so coupling_library(sm)
builds it per model, cached by the hash of its sources, the emitted headers and the image.
tank = Tank(h0=0.04)
write_config(run / "precice-config.xml", arms=[Arm("Swe", "SweMesh", "VofInletMesh")],
t_end=2.5, window=2e-3, exchange=run)
case = write_case(run / "vof_case", tank, arms=..., config=..., t_end=2.5, window=2e-3)
lib = coupling_library(sm)
proc = start(case, lib) # blockMesh, setFields, foamRun
The column contract: six fields [b, h, u, v, w, p] (<field>_S written by the reduced
arm, <field>_V by this participant), the reduced arm’s vertices (x, y, sigma) at the
cell-centre heights of nz = the tank’s cells over its height (ny), the model’s
project_nz.
Module Contents#
Classes#
A reduced participant coupled to the tank: its preCICE name, its mesh, the tank’s mesh
of the shared patch, and which tank side it sits on ( |
|
The VOF tank |
Functions#
The preCICE configuration of the tank (participant |
|
The tank case in |
|
The directory holding |
|
|
|
The tank’s written time directories ( |
Data#
API#
- zoomy_foam.vof.FIELDS#
(‘b’, ‘h’, ‘u’, ‘v’, ‘w’, ‘p’)
- zoomy_foam.vof.FO_STARSTATE#
None
- class zoomy_foam.vof.Arm#
A reduced participant coupled to the tank: its preCICE name, its mesh, the tank’s mesh of the shared patch, and which tank side it sits on (
left: the inlet atx = 0,right: the outlet atx = lx).- participant: str#
None
- mesh: str#
None
- vof_mesh: str#
None
- side: str#
‘left’
- class zoomy_foam.vof.Tank#
The VOF tank
[0, lx] x [0, ly](thin in z),nx x nycells, still waterh0; the sides anArmdoes not take are walls.- lx: float#
1.5
- ly: float#
0.4
- nx: int#
120
- ny: int#
40
- lz: float#
0.02
- h0: float#
0.04
- fo: dict#
‘field(…)’
- zoomy_foam.vof.write_config(path, *, arms, t_end, window, exchange)#
The preCICE configuration of the tank (participant
Vof) and its reducedarms: oneparallel-explicitscheme for one arm, amultischeme with the tank as controller (max-iterations 1: the explicit-equivalent single pass) for several; m2n sockets through the directoryexchange(both containers must see it at that path).
- zoomy_foam.vof.write_case(dest, tank, *, arms, config, t_end, window, write_interval=0.05)#
The tank case in
dest: mesh (blockMeshDict), still waterh0(setFieldsDict), 0/ fields with the coupled patchesfixedValue(the function object imposes them),controlDictwith the function object onconfig. Returnsdest.
- zoomy_foam.vof.coupling_library(sm, *, cache=None)#
The directory holding
libswePreciceCoupling.sobuilt against the reduced modelsm(its SystemModel:Model.H/NumericsKernels.H/MarchConstants.Hemitted with the Foam printers next to a copy of this package’s C++ sources), built once per hash of the sources, the headers and the image.
- zoomy_foam.vof.start(case, lib, *, log=None)#
blockMesh,setFields, thenfoamRunof the tankcasewith the function object fromlib, in the background; returns the process (its output inlog, default<case>/../log.vof).
- zoomy_foam.vof.to_hdf5(case, out)#
The tank’s written time directories (
foamToVTK) as a zoomy HDF5 storeout.