.claude/skills/driftfusion-device-structure/SKILL.md
Define device layer structure, configure spatial and time meshes, and build device structures with interface grading. Use this skill when setting up the physical geometry and discretization of a simulation device.
npx skillsauth add ShaneLogic/SolarLab driftfusion-device-structureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Define layer types, configure meshes, and build device structures with graded interfaces.
Define layer_type property for each layer. Four types supported:
active_layer property)Critical Rule: Interface layers MUST be included between materials with different energy levels and eDOS values (at heterojunctions).
Call meshgen_x to generate spatial mesh:
Grid Structure:
xi)x_sub) where $x_{i+1/2} = (x_{i+1} + x_i) / 2$Mesh Types (xmesh_type):
'linear': Linear piece-wise spacing'erf-linear': Error function (bulk) + linear (interface) spacingParameters:
layer_points: Points per layer (constraint: ≥ 3)xmesh_coeff: Controls boundary point density (constraint: > 0)Recommendations:
'erf-linear' for high ionic defect densitiesxmesh_coeff if ionic depletion extends into bulkSolver Behavior: pdepe uses adaptive time stepping, interpolates to user-defined mesh
Convergence Factors:
tmax and MaxStepFactorMesh Types (tmesh_type): Linear, logarithmic, etc.
Usage Guidelines:
Structure Creation:
build_device and build_property create device structuresdev: Integer intervals ($x_i$), used for initial conditionsdev_sub: Subintervals ($x_{i+1/2}$), used by solverInterface Grading Options (set in build_device):
'zeroed': Property set to zero throughout interface'constant': Property set to user-defined constant (requires CSV value)'lin_graded': Linear grading using adjoining layer values (no interface value needed)'exp_graded': Exponential grading using adjoining layer valuesInput Requirements:
'lin_graded': Interface value NOT needed'constant': Interface value IS needed (must be in CSV)x and x_subdev and dev_sub structures with graded interface propertiesdevelopment
Understand and comply with Driftfusion software licensing terms, including the open-source AGPL v3.0 frontend and proprietary MATLAB pdepe solver backend. Use when using, modifying, or distributing Driftfusion code.
development
Initialize the Driftfusion simulation environment and create parameter objects. Use this skill when starting a new MATLAB session or setting up device properties for simulation.
research
Analyze simulation solutions, calculate physical quantities, and generate plots. Use this skill when processing completed simulations, extracting currents/densities, or visualizing results.
data-ai
Model charge transport in perovskite solar cells using drift-diffusion equations. Apply conservation equations, flux equations, and Poisson's equation for perovskite, ETL, and HTL regions. Use when setting up the core physics model for PSC simulations.