API reference

Network and solution

Assemble a network, solve the mean flow, and read the result.

shell.Network The main object for building and solving flow networks.
shell.Solution Converged mean-flow result with named edge-field access.
shell.parameter_study Solve the mean flow over a grid of parameter values, warm-started point to point.
shell.StudyResult The outcome of a :func:parameter_study: the grid, convergence and probed outputs.
shell.build_problem Assemble a CompiledProblem from elements and directed (tail, head, area) edges.
shell.build_problem_from_connectivity Assemble a CompiledProblem from elements and a prebuilt Connectivity.
shell.validate_network Check structural and area-consistency invariants before compiling.

Elements — atomic

Factories for the atomic elements: boundaries, area changes, losses, ducts, junctions, and reacting closures.

elements.catalog.total_pressure_inlet Prescribed total-pressure inlet feeding a stream of the given composition.
elements.catalog.mass_flow_inlet Prescribed mass-flow inlet feeding a stream of the given composition.
elements.catalog.pressure_outlet Static-pressure outlet; becomes a total-pressure inlet on backflow, feeding composition at Tt_backflow
elements.catalog.mass_flow_outlet Prescribed-mass-flow outlet: the outflow rate is pinned to mdot.
elements.catalog.choked_nozzle_outlet Compact choked-nozzle outlet of throat area throat_area lumped downstream.
elements.catalog.isentropic_area_change A smooth (lossless) contraction or diffuser; optionally length-bearing to model
elements.catalog.sudden_area_change Sudden area change: Borda-Carnot expansion, vena-contracta contraction.
elements.catalog.loss A concentrated total-pressure loss Pt_in - Pt_out = K * (1/2 rho u^2).
elements.catalog.linear_resistance A linear flow resistance Pt_in - Pt_out = R * mdot (a quiescent acoustic resistance).
elements.catalog.duct A length-bearing, lossless, constant-area duct.
elements.catalog.pipe A length-bearing pipe: Darcy-Weisbach wall friction + the duct acoustic phase.
elements.catalog.junction A static-pressure manifold (header node) tying all ports to a common pressure.
elements.catalog.splitter A lossless (total-pressure) manifold; optionally a finite-volume plenum.
elements.catalog.forced_splitter A flow divider: one inflow split into N outflows at prescribed mass fractions.
elements.catalog.wall An impermeable single-port termination: mdot = 0 on its incident edge.
elements.catalog.cavity A lumped finite-volume cavity: a wall to the mean flow, a compliance to acoustics.
elements.catalog.heat_release_flame A compact constant-area flame that adds heat power Qdot [W] to the flow.
elements.catalog.equilibrium_flame A compact reacting flame: frozen unburnt inflow -> equilibrium products.
elements.catalog.mass_source A 2-port inline mass-injection element (e.g. a fuel injector).
elements.catalog.transfer_matrix_element A 2-port whose acoustic response is a user-supplied transfer matrix.

Elements — composites

Composite elements that expand into a small graph of atoms, and the element specs.

elements.catalog.orifice Orifice plate: an isentropic contraction to the throat, then a Borda-Carnot loss.
elements.catalog.lossy_nozzle General lossy nozzle (De Domenico): A1 ->isen-> AT ->isen-> Aj ->Borda-> A2.
elements.catalog.sudden_contraction Sudden contraction that resolves the vena-contracta state (composite).
elements.catalog.helmholtz_resonator Side-branch Helmholtz resonator: a tee, a neck duct, and a backing cavity.
elements.catalog.fanno_pipe Distributed (Fanno) pipe: an n_segments chain of :func:pipe atoms.
elements.catalog.tapered_duct Tapered duct / horn / con-di nozzle resolved from an (x, A) profile.
elements.catalog.segments_for_frequency Smallest segment count N that keeps each segment acoustically compact at f_max.
elements.catalog.ElementSpec One network element: its residual type and the ordered parameters its kernel reads.
elements.catalog.CompositeElementSpec A convenience element that expands to >= 2 atomic ElementSpec sub-elements.

Perturbation and acoustics

The linear perturbation network: boundary closures, responses, eigenmodes, matrices, and identification.

perturbation.PerturbationBC Acoustic/perturbation closure for a single-port terminal node.
perturbation.perturbation_response Drive every forced incoming wave and store the perturbation fields.
perturbation.PerturbationResponse Stored independent perturbation fields; extracts N x N matrices on demand.
perturbation.forced_response Solve the perturbation field under each terminal’s declared boundary condition.
perturbation.ForcedResponse Nodal perturbation field of a physically-terminated network over a sweep.
perturbation.eigenmodes Free-oscillation eigenmodes of the perturbation network in a region of the complex plane.
perturbation.EigenmodeResult Validated free-oscillation eigenmodes of the perturbation network.
perturbation.TransferMatrix A 2-port transfer matrix v_down = T(f) @ v_up versus frequency [Hz].
perturbation.ScatteringMatrix A 2-port scattering matrix w_out = S(f) @ w_in versus frequency [Hz].
perturbation.identify_transfer_function Recover the transfer function(s) of a marked flame / mass-source feedback.
perturbation.identify_transfer_matrix Recover the 2-port transfer matrix of any interior element from a network measurement.
perturbation.find_terminals All 1-port boundary terminals of the network (edges at a boundary node).
perturbation.verify_perturbation

Input / output

Load and save cases and solutions.

io.load_case Load a YAML file exported from the UI tool into a Network.
io.load_solution Load a network and a saved solution from a UI/YAML case, without a cold re-solve.
io.load_connectivity Load a UI-export YAML file and build its Connectivity.
io.case_from_dict Build a Network from an already-parsed UI/YAML case document.
io.save_case Write a network (and optional results) to a UI-readable YAML file.
io.save_solution Write or append a solved network to a UI-readable YAML case.
io.dump_case Serialize a network (and optional results) to a UI-readable YAML string.

Plotting

The nefes plotly theme and the standard figure helpers.

plotting.use_nefes_theme Register the Nefes template and make it the process-wide default.
plotting.use_latex Enable or disable MathJax ($...$) labels on Nefes figures process-wide.
plotting.plot_complex_matrix Plot the magnitude and phase of every (selected) entry of a complex matrix.
plotting.plot_transfer_matrix Plot a perturbation transfer matrix versus frequency (magnitude over phase).
plotting.plot_scattering_matrix Plot a perturbation scattering matrix versus frequency (magnitude over phase).
plotting.plot_transfer_function Plot one or more complex functions of frequency.
plotting.plot_spectrum Plot the stability spectrum: growth rate versus modal frequency.
plotting.plot_pole_map Plot a continuation’s poles and zeros in the (frequency, growth) plane.
plotting.plot_mode_shape Plot a mode’s wave amplitudes along the edges: magnitude (top) over phase (bottom).
plotting.animate_mode_shape Animate one or more spatial perturbation fields over one phase cycle.
plotting.plot_network_topology Plot the element/edge topology of a :class:~nefes.shell.network.Network.
plotting.plot_fit Overlay a continued curve on the tabulated samples it was fitted to.
Back to top