Geometries
From the channel to the ball
Every geometry speaks the same language: you name the domain, write the same equations, and name the boundaries where conditions hold. Conatus chooses the bases that belong to the geometry, regular at the axis and at the centre, and prints them with explain().
Declaring a domain
A geometry is one line. The rest of the model does not depend on it: the same equation in a box or in a ball differs only by this line and by the boundary names.
import conatus as cn
disk = cn.Disk(1.0) # coordinates (phi, r), boundary "wall"
m = cn.Model(disk, name="heat in a disk", kappa=1.0)
T = m.scalar("T")
m.equations("dt(T) - kappa*lap(T) = 0")
m.at("wall", T=0)
print(m.explain()) # bases, conditions and their placementThe geometries
Box
cn.Box(x=cn.periodic(2.0), z=cn.walls(-0.5, 0.5))Periodic directions and at most one direction between two walls. Fourier along periodic axes, Chebyshev between walls, or sine and cosine series (basis="sincos") when the walls are stress-free or held at a fixed value.
Convection, Couette flow, boundary layers, pattern formation.
Lines, half lines and compound intervals
cn.Box(x=cn.periodic(2.0), y=cn.half_line(scale=0.5))Unbounded directions with the decay built into the basis (Hermite functions on the line, Laguerre functions on the half line); a width you choose, like a resolution. An interval cut into pieces, cn.walls(-1, -0.15, 0.15, 1), puts modes where a thin layer needs them, with continuity across the cuts added for you.
Boundary layers over a plate, localised waves, fronts and interior layers.
Channel
cn.Channel(2 * math.pi, math.pi)A box with walls at y = ±1, periodic in x and, in 3D, in z.
Plane Poiseuille and Couette flow, turbulent channels.
Disk
cn.Disk(1.0)Regular at the centre by construction: no axis condition to add, nothing singular to guard against.
Vortices, rotating tanks, flows in a circular cross-section.
Annulus
cn.Annulus(1.0, 2.0)The gap between two circles.
Taylor–Couette flow in a cross-section, rotating shear flows.
Sphere
cn.Sphere(1.0)The surface of a sphere, regular at both poles.
Shallow water, planetary waves, atmospheres.
Spherical shell
cn.Shell(0.35, 1.0)The space between two spheres, where planets and stars convect. Simulations on a CPU or a GPU, exact adjoints and optimal perturbations, and rotating convection ready to run; the wall conditions are written in a form that stays stable at any radial resolution, and checked before the first step.
Rotating convection, dynamos, mantle and core flows, rotating shells.
Ball
cn.Ball(1.0)The full sphere, regular at the centre by construction.
Flows in a spherical container, stellar interiors.
Every wall takes rigid or stress-free conditions (u=cn.free_slip), curved walls included. Mapped bases, other polynomial families and hand-chosen bases are available in the expert layer; see the user guide. The gap between two rotating cylinders is cn.TaylorCouette(ri, ro, length); pipe flow and Taylor–Couette flow are also ready problems (cn.problems), as native models in cn.problems.native. To see the geometries at work, open the gallery.