User layer: import conatus as cn¶
import conatus as cn
import conatus is light: nothing heavy (solvers, compiled core, GPU) is loaded until it is used.
The names below are reached as cn.<name>.
Geometries¶
A geometry fixes the coordinates, the spectral bases (chosen once per geometry, printed by
explain()) and the names of the boundaries used by Model.at.
Cartesian box: |
|
Plane channel: x periodic of length Lx, walls at y = -h and y = +h, and z periodic of length Lz in 3D (coordinates in the order x, y, z; boundaries "bottom"/"top"/"walls"). |
|
Disk r <= R: PolarCoordinates(phi, r), RealFourier(phi) x DiskBasis(r) (regular at the axis, no axis condition). |
|
Annulus ri <= r <= ro: RealFourier(phi) x AnnulusBasis(r). |
|
Pipe (cylinder) r <= R, z periodic of length L: CylindricalCoordinates(phi, r, z), RealFourier(phi) x DiskBasis(r) x ComplexFourier(z). |
|
Sphere surface of radius R: S2Coordinates(phi, theta), RealFourier(phi) x SphereBasis(theta). |
|
Ball r <= R: SphericalCoordinates(phi, theta, r), RealFourier x SphereBasis x BallBasis (regular at the centre). |
|
Spherical shell ri <= r <= ro: RealFourier x SphereBasis x ShellBasis. |
|
Annular cylinder ri <= r <= ro, z periodic of length L (Taylor–Couette geometry): CylindricalCoordinates(phi, r, z), RealFourier(phi) x AnnulusBasis(r) x ComplexFourier(z). |
|
Channel between two surfaces over periodic axes: |
|
Periodic axis of length |
|
Bounded axis [a, b] (walls at a and b); |
|
The whole line, discretized with Hermite functions psi_n((x - center)/scale) (no boundary, no condition: the functions decay like a Gaussian). |
|
The half line x >= start, discretized with Laguerre functions of (x - start)/scale; the wall at |
|
Vertical axis from the surface |
cn.Cylinder is another name for cn.Pipe.
Wall conditions on a vector unknown¶
Named conditions for m.at(...) (guide: Boundary conditions).
A named wall condition on a vector unknown ( |
|
A named wall condition on a vector unknown ( |
|
Navier partial-slip wall condition u·n = 0, u_t + l dn(u_t) = 0 (dn: outward normal derivative), for |
The model¶
A PDE model on a geometry, declared as on paper. |
What the model returns:
Time integration of a compiled IVP ( |
|
Normal modes of a model about a base state ( |
|
The IR problem of a model at one resolution, with the record of every automatic choice. |
Ready problems: cn.problems¶
Canonical flows written once, each returning an ordinary problem with its handles and the reference it reproduces.
3D plane channel (Poiseuille) flow, incompressible Navier–Stokes, as an IVP. |
|
Orr–Sommerfeld EVP of plane Poiseuille flow U = 1 - y^2 (2D modes). |
|
3D plane Couette flow, incompressible Navier–Stokes, as an IVP. |
|
Orr–Sommerfeld EVP of plane Couette flow U = y (2D modes), same form as |
|
2D Rayleigh–Benard convection between rigid, fixed-temperature plates (Boussinesq), IVP. |
|
Linear onset of Rayleigh–Benard convection: normal modes exp(i k x + s t) of the conduction state, same equations and units as |
|
Taylor–Couette flow between rotating cylinders: perturbation u of circular Couette flow U0 = V(r) e_phi, V = A r + B / r, incompressible Navier–Stokes, IVP. |
|
Linear stability of circular Couette flow: normal modes exp(i m phi + i k z + s t) of the equations of |
|
Pressure-driven pipe flow (Hagen–Poiseuille), incompressible Navier–Stokes, IVP. |
|
Linear stability of Hagen–Poiseuille flow U0 = (1 - r^2) e_z, primitive variables. |
|
Kuramoto–Sivashinsky equation on the periodic line (0, L), IVP. |
|
2D Kolmogorov flow on the torus [0, 2 pi]^2 (Chandler & Kerswell 2013), IVP in streamfunction form (u = psi_y, v = -psi_x, vorticity -lap(psi)). |
|
Swift–Hohenberg equation on a doubly periodic box, IVP (Swift & Hohenberg 1977). |
|
Rotating Boussinesq convection in a spherical shell (Christensen et al. 2001 geometry and units, non-magnetic), IVP. |
|
Linear onset of rotating shell convection: normal modes exp(i m phi + s t) about the conduction state, equations and units of |
|
A ready-to-discretize problem and its handles. |
The run registry: cn.runs¶
Record runs, find and compare them, reproduce one bit for bit (guide: The run registry).
Record a block ( |
|
Record one finished computation in one call and return the closed run. |
|
Runs matching every criterion, newest first. |
|
One run by id or unique id prefix. |
|
Differences between two runs (ids or Run objects): parameters, numerics, results, code. |
|
Parent chain and descendants (fork, restart, reproduce, cache reuse) of a run. |
|
Run the recorded computation again and compare with the recorded output. |
|
pandas DataFrame of |
|
Small JSON per run in |
|
Where the registry is, what it holds, and every declared constant. |
|
A registry run. |
|
A list of |
|
A registry root: run directories + index. |
Quantities of a run¶
Series, spectra and profiles of a simulation, what to watch while it runs, and the statistics of a result (guide: Diagnostics and visualization).
A number per callback, |
|
One-sided power spectrum of a field along a periodic axis, averaged over the others: with |
|
Mean of a field over every coordinate but |
|
Declare a view for |
|
Mean and standard error of a stationary, correlated series (one value per sample; |
|
Run |
|
Raised inside the computation's callback when the Studio asks to stop the run. |
cn.StopRun is the exception a callback raises to stop a run.
Utilities¶
Run every check and return the report; with |
|
Translate a Dedalus 3 script (a path, or the source text) into Conatus. |
|
Parse |
|
Parse one expression (no '=') into an IR expression (a number stays a Constant). |
Regions of the complex plane: cn.box, cn.contour¶
m.eigenvalues(N, ..., region=cn.box(re=(a, b), im=(c, d))) returns every eigenvalue in the box
with a certified count; cn.contour.count and cn.contour.beyn take any operator
(Eigenvalues in a region).
The rectangle |
|
Number of eigenvalues of |
|
Every eigenvalue of |
|
Number of eigenvalues of |
|
Certified eigenvalues of |
|
An |