How mfjamao/unified-solar-cell-simulation works
Project Type and Purpose
• UniSolar is a simulation framework designed to streamline and “unify” multidimensional solar cell simulations.
• Its purpose is to allow users to generate process, optical, and electrical simulation workflows (all driven by 11 common simulation steps) simply by tuning variable values in a plain text configuration file.
• It leverages external commercial software (Sentaurus TCAD) to perform the heavy-duty simulation while managing the entire process via Tcl scripts.
File Structure
• Core script files at the root include key Tcl files:
• 11ctrlsim.tcl (the main control/driver script), which orchestrates the simulation workflow.
• 12savetpl.tcl and 13loadtpl.tcl (for archiving and retrieving simulation “templates” or prior run files in .tgz format).
• Other helper scripts (e.g., svisual_vis.tcl, sdevice.par, various *.cmd files) which support device simulation parameters, visualization, and process commands.
• The .mfj directory contains modules such as:
• mfjGrm.tcl (grammar checking),
• mfjIntrpr.tcl (interpreter),
• mfjProc.tcl and mfjST.tcl – all of which form the backbone for processing and validating the simulation input (i.e., the “grammar” and variable configuration).
• Configuration files like 10variables.txt and 10variables-brief.txt define simulation parameters and DOE settings.
• Directories such as 07tpl store templates and examples (often with demo files and archived simulation files) that illustrate the use case scenarios.
• Some auxiliary or experimental files (e.g., 04code, randtexture.tcl) and documentation (README.md) also exist.
README for Additional Insights
• The README clearly lists the simulation workflow, describing how key files are used to check grammar, convert variables, interface with Sentaurus, execute simulations, and save/load configurations.
• It also mentions the importance of adjusting Sentaurus connection parameters (hosts, paths, licensing, etc.), which points toward an external dependency integration.
• The document explains the “11-step” simulation control approach and hints that the design should reflect the separation between simulation control, configuration, processing, and external execution (via Sentaurus).
Main Components
• Input/Configuration Layer:
• The DOE / User Input files: 10variables.txt and 10variables-brief.txt.
• Additional input files such as Molefraction.txt, datexcodes.txt.
• Processing & Validation Layer:
• The .mfj modules (mfjGrm.tcl, mfjIntrpr.tcl, mfjProc.tcl, mfjST.tcl) responsible for grammar checking and interpretation.
• The main control file, 11ctrlsim.tcl, that calls these modules.
• Simulation Execution Layer:
• The interface to the external simulation package Sentaurus TCAD, which is invoked by 11ctrlsim.tcl after processing the input.
• Supporting files (such as sdevice.par, sde_dvs.cmd etc.) provide simulation-specific parameters.
• Template Management / Archiving Layer:
• 12savetpl.tcl and 13loadtpl.tcl, which manage saving and reloading simulation configurations and results.
• The 07tpl directory contains archived runs and demo cases.
• Auxiliary/Utility Components:
• Other TCL scripts like svisual_vis.tcl for visualization.
• Command scripts (sprocess_fps.cmd, sdevice_des.cmd) that might play roles in process or device simulation.
• The input configuration is read by 11ctrlsim.tcl – the central orchestrator.
• 11ctrlsim.tcl invokes the grammar and processing modules from the .mfj folder (mfjGrm.tcl, mfjIntrpr.tcl, etc.) to validate and prepare simulation parameters.
• Once validated, 11ctrlsim.tcl manages the simulation job – sending instructions to Sentaurus TCAD (conceptually represented as an external simulation engine).
• Results from Sentaurus TCAD are then handled (stored in an output directory, e.g., the “06out” directory referenced in the README even if not present in the file tree) and may be further processed or visualized using auxiliary scripts.
• The template management scripts (12savetpl.tcl and 13loadtpl.tcl) allow saving the current state or reloading a saved simulation “template.”
Overall Strategy
• Then drill down to show how the 11ctrlsim.tcl file acts as the hub, interfacing with both the grammar-check modules (.mfj) and the external Sentaurus.
• Finally, indicate the role of auxiliary modules like saving/loading operations for experiments (via 12savetpl.tcl and 13loadtpl.tcl).