Skip to main content

outram_foam_basic_lib/
lib.rs

1// SPDX-License-Identifier: GPL-3.0-only
2// Copyright (C) 2026 OUTRAM PARK contributors
3// Derived from OpenFOAM (www.openfoam.com)
4// Copyright (C) 2004-2023 OpenFOAM Foundation
5// Copyright (C) 2016-2023 OpenCFD Ltd.
6//
7// This file is part of OUTRAM PARK.
8//
9// OUTRAM PARK is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by the
11// Free Software Foundation, either version 3 of the License, or (at your
12// option) any later version.
13//
14// OUTRAM PARK is distributed in the hope that it will be useful, but
15// WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17// General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License along
20// with OUTRAM PARK.  If not, see <https://www.gnu.org/licenses/>.
21
22//! **This is OUTRAM PARK's independent Rust translation of selected
23//! OpenFOAM® primitive/finite-volume algorithms — it is not the official
24//! OpenFOAM® software and is not affiliated with, endorsed by, or
25//! sanctioned by OpenCFD Ltd. or the ESI Group.** OpenFOAM® is a registered
26//! trademark of OpenCFD Limited. See `TRADEMARKS.md` (this crate's
27//! directory, mirrored from the workspace root) for the full attribution
28//! and non-affiliation notice.
29
30/// Cross-layer — where a numerical kernel runs (`ComputeBackend`: serial,
31/// multi-CPU via `rayon`, or GPU via `wgpu`), the worker-count policy, and the
32/// backend-selection rule. Dispatch only, no kernels.
33pub mod compute;
34/// Layer 2 — field containers (`VolField`/`SurfaceField`), boundary
35/// conditions, and field-level tensor algebra.
36pub mod fields;
37/// Layer 4 — field-level fluid and solid thermodynamics (`FluidThermo`,
38/// `SolidThermo`, `PsiThermo`, `RhoThermo`).
39pub mod fluid_thermo;
40/// Layer 3 — finite-volume discretisation operators (`fvc` explicit, `fvm`
41/// implicit, and `adjust_phi` continuity correction).
42pub mod fv_operators;
43/// Layer 3 — optional source terms attached to finite-volume equations,
44/// OpenFOAM's `fvOptions` (Foundation `fvModels`) mechanism.
45pub mod fv_options;
46/// Layer 1f — one-dimensional data interpolation (linear and spline).
47pub mod interpolation;
48/// OpenFOAM ASCII case I/O — `FoamFile` dictionaries, `polyMesh` read/write,
49/// time-directory field read/write, and whole-case reading.
50pub mod io;
51/// Layer 2 — asymmetric Krylov iterative solvers (BiCGStab, restarted GMRES)
52/// and preconditioners (Jacobi, ILU(0)) for the sparse `LduMatrix`.
53pub mod krylov;
54/// Layer 2 — sparse LDU (lower/diagonal/upper) matrices, the assembled
55/// `FvMatrix`, and iterative linear solvers (CG, Gauss–Seidel, GAMG).
56pub mod ldu_matrix;
57/// Layer 2 — the discretisation-agnostic `LinearOperator` contract and the
58/// generic Krylov drivers (`cg_op`, `bicgstab_op`, `gmres_op`) written against
59/// it, so a finite-element crate can reuse this solver layer without adopting
60/// the finite-volume `LduMatrix` layout (GitHub issue #175). Purely additive:
61/// the existing finite-volume solvers are unchanged.
62pub mod linear_operator;
63pub mod limiters;
64/// Layer 1g — mathematical special functions (inverse error function,
65/// incomplete gamma functions and their inverse).
66pub mod math;
67/// Layer 1b — dense `SquareMatrix` with direct (LU) solve.
68pub mod matrix;
69/// Layer 2 — the finite-volume mesh: cells, faces, boundary patches, and
70/// geometric metrics.
71pub mod mesh;
72/// Layer 1e — ordinary-differential-equation solvers (Euler, RKF45,
73/// Rosenbrock23).
74pub mod ode;
75/// Layers 1c/1d — polynomial evaluation and closed-form equation solvers
76/// (linear, quadratic, cubic).
77pub mod polynomial;
78/// Convenience re-exports of the most commonly used types and functions.
79pub mod prelude;
80/// Layer 1a — dimensionless scalar constants and the tensor-algebra
81/// primitives (`Vector3`, `Tensor`, `SymmTensor`, `SphericalTensor`).
82pub mod primitives;
83/// Layer 1h — specie-level thermophysics: equations of state, thermo, and
84/// transport models.
85pub mod thermophysics;
86
87/// this part is extension in Rust
88/// Now under here, I want to expose the openfoam primitives to something
89/// that can be human readable
90///
91/// Also useful add-ons for the underlying libraries are put here,
92/// eg. generating one dimensional meshes for system code type simulations
93/// in TAMPINES
94pub mod interface;