Русская версия
README.ru.md.
Command-line tool in Rust for computing the steady-state temperature field in a 2D domain using the finite element method (according to Rumyantsev) and comparing the result with an Ansys APDL solution.
The program assembles the global stiffness matrix, solves the linear system (dense or sparse) and visualizes:
- temperature distribution from the FEM implementation;
- temperature distribution from Ansys APDL;
- the difference field between the two solutions;
- temperature plots versus node number.
- Reading input from Ansys APDL: files
NLIST.lis,ELIST.lis,DLIST.lis,PRNSOL.lisare parsed viaapdl-parser. - Rumyantsev FEM implementation:
- construction of local stiffness matrices for triangular elements;
- assembly of the global stiffness matrix;
- application of temperature boundary conditions.
- Two modes for solving the linear system:
- classical LU factorization of a dense matrix (
nalgebra); - sparse solvers (
russell_sparse: KLU, UMFPACK, MUMPS).
- classical LU factorization of a dense matrix (
- Flexible thermal conductivity settings:
lambda_xx,lambda_yy. - Result visualization:
- HTML plot in the browser (
plotly); - saving images in
svg,png,webp,jpegformats (configurable).
- HTML plot in the browser (
- Logging with configurable level (
info,debug,warn) viatracing.
- Installed Rust (stable) with
cargo. - Presence of files generated by Ansys APDL:
NLIST.lis— node list;ELIST.lis— finite element list (triangles);DLIST.lis— boundary conditions / prescribed temperatures;PRNSOL.lis— nodal temperature results.
Clone the repository and build the project:
git clone https://github.com/indraine/warm
cd warm
cargo build --releaseThe executable will be located at:
target/release/warmPlace NLIST.lis, ELIST.lis, DLIST.lis, PRNSOL.lis in the same directory where the binary is executed and run:
./target/release/warmBy default:
- input files
NLIST.lis,ELIST.lis,DLIST.lis,PRNSOL.lisare read from the current directory; - sparse solver KLU is used;
- thermal conductivities:
lambda_xx = 0.0001,lambda_yy = 0.0001; - log level is
info; - the resulting plot is opened in the browser.
For details on all parameters, see the built-in help:
warm --helpBelow is an example of a typical run via cargo with key settings:
cargo run --release -- \
--nlist ./files/NLIST.lis \
--elist ./files/ELIST.lis \
--dlist ./files/DLIST.lis \
--prnsol ./files/PRNSOL.lis \
--lambda-xx 0.15 \
--lambda-yy 0.12 \
--decomposition umfpack \
--image png \
--log-lvl debugThe implementation follows the classical steady-state heat conduction formulation and uses the finite element method according to Rumyantsev (triangular elements, linear approximation).
Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.
