|
| 1 | +# diffHeatTO |
| 2 | + |
| 3 | +A modular differentiable multi-physics framework in JAX for coupled thermal-fluidic-structural topology optimization. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +- Couples Stokes-Brinkman, conjugate heat transfer, and linear thermoelasticity |
| 8 | +- Reverse-mode AD with custom VJP rules (no manual adjoint derivation) |
| 9 | +- Sparse solver backend: O(n^1.1) scaling in 2D, GPU-native CG for 3D |
| 10 | +- Warm-start strategy enables three-physics optimization where cold-start fails |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +```bash |
| 15 | +pip install jax==0.4.30 jaxlib==0.4.30 scipy==1.12.0 numpy==1.26.4 pyamg==5.2.1 matplotlib |
| 16 | +``` |
| 17 | + |
| 18 | +## Quick Start |
| 19 | + |
| 20 | +```bash |
| 21 | +# Run 2D warm-start benchmark (80x40 mesh, ~3 min) |
| 22 | +python src/benchmarks/run_benchmark_v2.py |
| 23 | + |
| 24 | +# Run aluminum material validation |
| 25 | +python src/benchmarks/run_aluminum_validation.py |
| 26 | + |
| 27 | +# Validate Stokes assumption |
| 28 | +python src/benchmarks/validate_stokes.py |
| 29 | +``` |
| 30 | + |
| 31 | +## Project Structure |
| 32 | + |
| 33 | +``` |
| 34 | +src/ |
| 35 | +├── solvers/ # Physics solver modules |
| 36 | +│ ├── fem.py # 2D FEM infrastructure (Q4 elements) |
| 37 | +│ ├── fem3d.py # 3D FEM (H8 elements) |
| 38 | +│ ├── fem3d_q2q1.py # 3D Taylor-Hood Q2-Q1 elements |
| 39 | +│ ├── fluid.py # Stokes-Brinkman solver (2D) |
| 40 | +│ ├── fluid_3d.py # Stokes-Brinkman solver (3D) |
| 41 | +│ ├── thermal.py # Conjugate heat transfer |
| 42 | +│ ├── structural.py # Linear elasticity + thermal stress |
| 43 | +│ ├── coupled.py # 2D coupled multi-physics pipeline |
| 44 | +│ ├── heat_sink_solver.py # 2D integrated multi-physics |
| 45 | +│ ├── heat_sink_3d.py # 3D integrated multi-physics |
| 46 | +│ ├── sparse_solve.py # Sparse solver + custom VJP (CPU) |
| 47 | +│ ├── gpu_solve.py # GPU-native CG solver + custom VJP |
| 48 | +│ ├── gpu_stokes.py # GPU Schur complement for Q2-Q1 |
| 49 | +│ └── stokes_coupled.py # 3D Schur complement (CPU) |
| 50 | +├── optimization/ # SIMP, filtering, MMA, warm-start |
| 51 | +│ ├── optimizer.py # Main optimization loop + warm-start scheduler |
| 52 | +│ ├── mma_optimizer.py # Method of Moving Asymptotes |
| 53 | +│ ├── al_optimizer.py # Augmented Lagrangian optimizer |
| 54 | +│ └── filters.py # PDE-based filtering + Heaviside projection |
| 55 | +├── benchmarks/ # Reproducible experiment scripts |
| 56 | +│ ├── run_benchmark_v2.py # Primary 2D warm-start benchmark |
| 57 | +│ ├── run_3d_optimization.py |
| 58 | +│ ├── run_3d_large_gpu.py |
| 59 | +│ ├── run_beta_ablation.py |
| 60 | +│ ├── run_3d_beta_ablation.py |
| 61 | +│ ├── run_aluminum_validation.py |
| 62 | +│ ├── validate_stokes.py |
| 63 | +│ ├── run_robustness_study.py |
| 64 | +│ ├── run_warmstart_benchmark.py |
| 65 | +│ ├── run_gpu_benchmark.py |
| 66 | +│ ├── run_profiling.py |
| 67 | +│ ├── benchmark_mesh_convergence.py |
| 68 | +│ └── ... # Additional benchmarks and tests |
| 69 | +├── analysis/ # Paper figure generation |
| 70 | +│ ├── generate_paper_figures_v4.py |
| 71 | +│ ├── generate_methodology_figures.py |
| 72 | +│ └── generate_arch_figure.py |
| 73 | +├── surrogate/ # Surrogate model experiments |
| 74 | +│ ├── generate_data.py |
| 75 | +│ ├── train_surrogate.py |
| 76 | +│ └── generate_figures.py |
| 77 | +└── utils/ # Visualization, I/O |
| 78 | + └── visualization.py |
| 79 | +results/ # Pre-generated data (JSON, NPY) |
| 80 | +paper/ # LaTeX manuscript + figures |
| 81 | +``` |
| 82 | + |
| 83 | +## Reproducing Paper Results |
| 84 | + |
| 85 | +Total reproduction time: ~10-12 hours (CPU), ~14 hours for 3D GPU case. |
| 86 | + |
| 87 | +See `src/benchmarks/` for individual experiment scripts. |
| 88 | + |
| 89 | +## Hardware |
| 90 | + |
| 91 | +- CPU: Intel Xeon W-2245 (3.9 GHz, 8 cores, 64 GB RAM) |
| 92 | +- GPU: NVIDIA Quadro RTX 5000 (16 GB) -- for 3D 40x40x20 case |
| 93 | + |
| 94 | +## Citation |
| 95 | + |
| 96 | +[Paper citation to be added upon publication] |
| 97 | + |
| 98 | +## License |
| 99 | + |
| 100 | +MIT |
0 commit comments