Skip to main content

Crate tpt_sci_dft_classical

Crate tpt_sci_dft_classical 

Source
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 feos DFT pieces (feos_dft) — profiles, solvers, convolutions, geometries.
  • Wraps the PC-SAFT Helmholtz functional (feos::pcsaft::PcSaft, available with the feos crate’s pcsaft feature) behind a small ClassicalDft builder 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§

pub use feos;
pub use feos_dft;

Structs§

ClassicalDft
A classical-DFT problem handle, generic over the wrapped Helmholtz energy functional F (any type implementing HelmholtzEnergyFunctional, e.g. PcSaft from feos::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.
PlanarSolve
Inputs for a 1-D planar SquareGradientDft::solve_1d solve.
SolveStats
Iteration statistics returned alongside a solved density field.
SquareGradientDft
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).
VolumetricSolve
Inputs for a 3-D SquareGradientDft::solve_3d solve.

Enums§

DftError
Errors raised by the classical-DFT wrapper.