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;
57pub mod limiters;
58/// Layer 1g — mathematical special functions (inverse error function,
59/// incomplete gamma functions and their inverse).
60pub mod math;
61/// Layer 1b — dense `SquareMatrix` with direct (LU) solve.
62pub mod matrix;
63/// Layer 2 — the finite-volume mesh: cells, faces, boundary patches, and
64/// geometric metrics.
65pub mod mesh;
66/// Layer 1e — ordinary-differential-equation solvers (Euler, RKF45,
67/// Rosenbrock23).
68pub mod ode;
69/// Layers 1c/1d — polynomial evaluation and closed-form equation solvers
70/// (linear, quadratic, cubic).
71pub mod polynomial;
72/// Convenience re-exports of the most commonly used types and functions.
73pub mod prelude;
74/// Layer 1a — dimensionless scalar constants and the tensor-algebra
75/// primitives (`Vector3`, `Tensor`, `SymmTensor`, `SphericalTensor`).
76pub mod primitives;
77/// Layer 1h — specie-level thermophysics: equations of state, thermo, and
78/// transport models.
79pub mod thermophysics;
80
81/// this part is extension in Rust
82/// Now under here, I want to expose the openfoam primitives to something
83/// that can be human readable
84///
85/// Also useful add-ons for the underlying libraries are put here,
86/// eg. generating one dimensional meshes for system code type simulations
87/// in TAMPINES
88pub mod interface;