Expand description
§tpt-sci-dft-classical
Classical / soft-matter density functional theory (DFT) for the
tpt-science pillar, provided by wrapping the feos framework
(feos_dft, MIT OR Apache-2.0). This crate is a thin, opinionated layer
over feos so downstream science consumers get a stable, TPT-flavoured
entry point without reaching into the full feos API:
- Re-exports the
feosDFT pieces (feos_dft) — profiles, solvers, convolutions, geometries. - Wraps the PC-SAFT Helmholtz functional (
feos::pcsaft::PcSaft, available with thefeoscrate’spcsaftfeature) behind a smallClassicalDftbuilder that solves a 1-D density profile for a pure component given temperature and bulk density.
The heavy lifting (functional derivatives, Picard / Anderson mixing, FFT
convolutions) is done by feos itself; this crate only assembles the
inputs and exposes a tidy result.
§Example
ⓘ
use tpt_sci_dft_classical::ClassicalDft;
use feos::pcsaft::{PcSaft, PcSaftParameters};
use feos_core::parameter::IdentifierOption;
// Build a PC-SAFT functional for a single pure component from its
// parameters, then solve a planar density profile at (T, rho_bulk).
let parameters = PcSaftParameters::from_json(
vec!["propane"], "../../parameters/pcsaft/esper2023.json",
None, IdentifierOption::Name,
).unwrap();
let dft = ClassicalDft::with_functional(PcSaft::new(parameters));Re-exports§
Structs§
- Classical
Dft - A classical-DFT problem handle, generic over the wrapped Helmholtz energy
functional
F(any type implementingHelmholtzEnergyFunctional, e.g.PcSaftfromfeos::pcsaft). - DftSolution1D
- Output of a 1-D planar solve: the converged density profile and stats.
- DftSolution3D
- Output of a 3-D solve: the converged density field and stats.
- Planar
Solve - Inputs for a 1-D planar
SquareGradientDft::solve_1dsolve. - Solve
Stats - Iteration statistics returned alongside a solved density field.
- Square
Gradient Dft - A from-scratch square-gradient / local density-functional solver.
- VdWParams
- Parameters of the van der Waals square-gradient functional (all in units of
k_B T, i.e.β = 1). - Volumetric
Solve - Inputs for a 3-D
SquareGradientDft::solve_3dsolve.
Enums§
- DftError
- Errors raised by the classical-DFT wrapper.