Overview¶
The fuel_cell_3D codebase implements a meshfree numerical method for simulating 3D solid oxide fuel cells (SOFCs). It uses the Reproducing Kernel Particle Method (RKPM) to solve coupled diffusion and mechanical problems.
Code Structure¶
The codebase is organized into the following modules:
Module |
Description |
|---|---|
|
Main simulation driver; orchestrates the full simulation workflow |
|
Configuration parameters (geometry, materials, numerical settings) |
|
Backend abstraction (NumPy/SciPy or Legate/cuNumeric) |
|
Reads voxelized microstructure from TIFF images |
|
Generates node positions and Gauss quadrature points |
|
Vectorized implementations for Gauss point computations |
|
Computes RKPM shape functions and their gradients |
|
Vectorized shape function computations |
|
Vectorized shape function gradient computations |
|
Assembles diffusion stiffness matrix using Nitsche’s method |
|
Assembles mechanical stiffness matrix with elasticity tensor |
Simulation Workflow¶
The simulation proceeds through the following steps:
Configuration: Load parameters from
config.pyGeometry Setup: Read microstructure from TIFF image or generate synthetic geometry
Node Generation: Create nodes for each phase (electrolyte, electrode, pore)
Gauss Point Generation: Create integration points within each cell
Shape Function Computation: Compute RKPM shape functions and gradients
Matrix Assembly: Assemble diffusion and mechanical stiffness matrices
Boundary Conditions: Apply Dirichlet conditions via Nitsche’s method
Solve: Solve the coupled system using sparse linear solvers
Post-process: Compute stress, strain, and electrochemical quantities
Backend Abstraction¶
The code supports two computational backends:
NumPy/SciPy: Standard scientific Python stack (default)
Legate/cuNumeric: GPU-accelerated distributed computing
The backend is selected automatically in common.py. The abstraction layer
provides consistent APIs:
from common import np, sparse, spsolve, csr_array
This allows the same code to run on CPUs or GPUs without modification.