{"id":22357229,"url":"https://github.com/mdh266/pecs","last_synced_at":"2025-03-26T13:22:06.090Z","repository":{"id":93022777,"uuid":"61489926","full_name":"mdh266/PECS","owner":"mdh266","description":"Photoelctrochemical Solar Cell Simulator","archived":false,"fork":false,"pushed_at":"2019-05-03T07:49:43.000Z","size":3866,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T14:43:15.186Z","etag":null,"topics":["c-plus-plus","dealii","discontinuous-galerkin","domain-decomposition","finite-element-methods","high-performance-computing","multithreading","solar-cells"],"latest_commit_sha":null,"homepage":"http://michael-harmon.com/PECS/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdh266.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-06-19T16:42:21.000Z","updated_at":"2022-05-03T15:19:33.000Z","dependencies_parsed_at":"2023-03-08T11:00:44.412Z","dependency_job_id":null,"html_url":"https://github.com/mdh266/PECS","commit_stats":{"total_commits":49,"total_committers":2,"mean_commits":24.5,"dds":"0.020408163265306145","last_synced_commit":"7af9f6c064d96dc257afd10546fcb4276a2639e5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdh266","download_url":"https://codeload.github.com/mdh266/PECS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245659182,"owners_count":20651549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","dealii","discontinuous-galerkin","domain-decomposition","finite-element-methods","high-performance-computing","multithreading","solar-cells"],"created_at":"2024-12-04T14:13:37.861Z","updated_at":"2025-03-26T13:22:06.061Z","avatar_url":"https://github.com/mdh266.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhotoElectrochemical Cell Simulator\n## Introduction\n\n### Photoelectrochemical Solar Cells\n\nLarge-scale utilization of photovoltaic (PV) devices, or solar cells, has been hampered \nfor years due to high costs and lack of energy storage mechanisms.  \u003ca href=\"https://en.wikipedia.org/wiki/Photoelectrochemical_cell\"\u003ePhotoelectrochemical solar cells\u003c/a\u003e  (PECs), are an attractive alternative to conventional solid state PV devices.  PECs such as those depicted below are able to directly convert solar energy into hydrogen fuel.  The hydrogen fuel can then be used at a later time to generate electricity. The typical setup of a PEC is shown below\n\n![Photoelectrochemical Solar Cell](./Documentation/images/PEC.png)\n\nA PEC consists of four main components: the solid semiconductor electrode, the liquid electrolyte component, the semiconductor-electrolyte interface and the counter (metal or semiconductor) electrode.  When sunlight shines on the semiconductor component, photons are absorbed and generate electron-hole pairs. These electrons and holes are separated by a built-in electric field within the semiconductor. The separation of the electrons and holes leads to an electrical current in the cell and the accumulation of charges at the semiconductor-electrolyte interface.  At the interface, the photo-generated electrons or holes induce a chemical reaction at the semiconductor electrode. A similar chemical reaction also occurs at the counter electrode. These chemical reactions create or eliminate reductant-oxidant (redox) species in the electrolyte leading to the generation of hydrogen fuel.  \n\nResearch on PECs has traditionally focused on planar cell designs, but recently there has been interest in cell designs that use thin nanostructured wires such as those depicted below.\n\n![PEC](./Documentation/images/planar_vs_wire-eps-converted-to.png)\n\nIn a planar device such, photo-generated electrons and holes are collected in directions parallel to photon absorption. In order for PECs' to achieve sufficient energy conversion efficiencies to be commercially viable the electron/hole diffusion length (the average distance an electron/hole can be travel without being eliminated) must be larger than the absorption length (the average distance a photon will penetrate the semiconductor crystal before generating an electron-hole pair). This constraint necessitates the use of expensive, high quality crystals that either have large diffusion lengths or small absorption lengths. In PECs that use a nanowire design the electron/hole collection and photon absorption directions are  decoupled, thereby alleviating the need for high quality crystals to attain sufficient energy  conversion efficiencies.  Scientists believe that the shape of these nanowires can effect  the energy conversion efficiencies (see \u003ca href=\"http://pubs.rsc.org/en/content/articlelanding/2012/ee/c1ee02518j#!divAbstract\"\u003ehere\u003c/a\u003e for more information). This software therefore allows nanowires which are cylindrical or conic, like those seen below:\n\n\n![Cylinder](./Documentation/images/Cylinder.png)\n\n### Software Overview\n\nThis software is designed to simulate the dynamics of the reactive interface between a semiconductor and electrolyte in a 2D. The nanowire solar cells is then considered to be axially symmetric in order to reduce the 3D nanowire to a 2D domain. The interface between the semiconductor and electrolyte make up a \"half cell\" of a  \u003ca href=\"https://en.wikipedia.org/wiki/Photoelectrochemical_cell\"\u003ephotoelectrochemical cell\u003c/a\u003e. The main challenges in constructing numerical algorithms that produces reliable simulations of PECs are due to the highly nonlinear nature of the system and the different time scales of the semicondcutor and electrolye charge carrier.  Furthermore, regions of stiffness caused by boundary layer formation where sharp transitions in densities and electric potential occur near the interface (as shown below) and pose severe constraints on the choice of discretization strategy in order to maintain numerical stability.\n\nThis code will automatically run in parallel using the  \u003ca href=\"https://www.threadingbuildingblocks.org/\"\u003eThread Building Blocks\u003c/a\u003e for multithreading.\n\nThe resulting output files from simulations are in \u003ca href=\"http://www.vtk.org/\"\u003eVTK\u003c/a\u003e format and can viewed using \u003ca href=\"http://www.paraview.org/\"\u003eParaview\u003c/a\u003e.  An example of such results are shown below,\n\n![Densities](./Documentation/images/densities_bias_0.png)\n\n\n## Documentation\nFor **much more** background on the model and algorithms as well as code itself please see the  \u003ca href=\"http://mdh266.github.io/PECS/\"\u003edocumentation page\u003c/a\u003e.\n\nTo build the documentation locally, you need \u003ca href=\"http://www.stack.nl/~dimitri/doxygen/\"\u003edoxygen\u003c/a\u003e.  Once doxygen has been installed, cd into the \u003ccode\u003eDocumentation/\u003c/code\u003e directory and run,\n\n\tdoxygen dox\n\nThis will write the documentation locally in a folder \u003ccode\u003ehtml\u003c/code\u003e which should have been created in the main directory.  Open the file \u003ccode\u003eindex.html\u003c/code\u003e within the \u003ccode\u003ehtml\u003c/code\u003e folder in your browser to access the documentation.\n\n\n## Requirements\n\n1. \u003ca href=\"dealii.org\"\u003edeal.ii\u003c/a\u003e library version 8.3.0 or higher.\n2. \u003ca href=\"https://cmake.org/\"\u003eCMake\u003c/a\u003e version 2.8 or higher. \n2. \u003ca href=\"http://www.paraview.org/\"\u003eParaview\u003c/a\u003e for visualization.\n\n## Using Software\n\nFirst obtain and install a copy of the deal.ii library version 8.3.0 or higher. \nAfter downloading and installing the deal.II library. cd into the \u003ccode\u003ePECS\u003c/code\u003e directory.\n\nTo generate a make file to compile the source code type the following command into the terminal:\n\n\tcmake . -DDEAL_II_DIR=\"path to deal.II library\"\t\n\nOn a mac, if you downloaded the binaries of deal.ii library instead run the command:\n\n\tcmake .\n\nOnce the CMake build is completed you can run the command:\n\n\tmake release\t\n\nto compile the code.\n\nTo run the code use the command:\n\n\t./main\t\n\n\nMaterial and design choices can be chosen by the user through the input file,\n\n\tinput_file.prm\t\n\n**NOTE: Upon changing parameter values in the input file the code does not need to be recompiled.**\n\n## Input Parameter File\n\n\nMaterial and design choices can be chosen by the user through the input file:\n\u003ccode\u003einput_file.prm\u003c/code\u003e.\n\nMost of the parameters in \u003ccode\u003einput_file.prm\u003c/code\u003e will be self explanatory after reading the documentation and from the comments in the file. However, for clarity we will explain some here.  There are two end times in \u003ccode\u003einput_file.prm\u003c/code\u003e in case in the initial simulation has not fully converged to steady state. Instead of restarting the simulation from the initial conditions and rerunning the simulation we can restart the simulation and use the end conditions as our new starting conditions; this is achieved by setting:\n\n\u003ccode\u003e set restart status     = true\u003c/code\u003e\n\nAnd setting the \u003ccode\u003eend time 2\u003c/code\u003e to the desired new end time.\n\n\nA typical mesh for the semiconductor is seen below,\n\n![SeminconductoGrod](./Documentation/images/semiconductor-grid.png)\n\nThe height of the mesh is the height of the nanowire and is set by,\n\n\u003ccode\u003e  set mesh height    = ... \u003c/code\u003e\n\nThe top width is fixed by setting the top radius of the nano wire,\n\n\u003ccode\u003e  set radius one     =  ... \u003c/code\u003e\n\nthe bottom width is fixed by setting the bottom radius of the nano wire,\n\n\u003ccode\u003e  set radius two     =  ... \u003c/code\u003e\n\nRefining the mesh globally is achieved by,\n\n\u003ccode\u003e set global refinements = ... \u003c/code\u003e\n\nRefining the mesh locally is achieved by,\n\n\u003ccode\u003e set local refinements  = ... \u003c/code\u003e\n\nLocal refinement only occurs within a specified distance of the interface (on the right) and is that distance is set by,\n\n\u003ccode\u003e set boundary layer = ... \u003c/code\u003e\n\nThe whole simulation mesh is seen below, \n\n![Poisson Grid](./Documentation/images/Poisson-grid.png)\n\nThe details of this mesh (refinements, height, radii, boundary layer) are controlled as described above. \nThe width of the entire domain is set by,\n\n\u003ccode\u003e  set mesh length    = ... \u003c/code\u003e\n\nBoth radii **MUST** be smaller than the mesh width. See Grid_Maker::Grid for more information.  Finally, the left and the right boundaries of the the entire domain will have Dirchlet boundary conditions (explained in documentation), while the top and bottom of the domain will have Neumann conditions (explained in documentation) by,\n\n\n\u003ccode\u003e  set insulated    = true \u003c/code\u003e\n\notherwise the top and bottom of the domain will have Dirichlet conditions.  Finally, the\ninitial conditions are set in the source code file:\n\n\u003ccode\u003e InitialConditions.cpp \u003c/code\u003e\n\nand must be set before compilation.\n\n## Trouble Shooting\n\nIf your simulation seems to be losing stability, there are two options:\n\n1.) Choose a smaller time step, in \n\n\u003ccode\u003e  set time step size     = ... \u003c/code\u003e\n\n2.) Refining the mesh especially near the interface.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdh266%2Fpecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdh266%2Fpecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdh266%2Fpecs/lists"}