{"id":22357225,"url":"https://github.com/mdh266/pecs-1d","last_synced_at":"2025-07-30T10:33:02.339Z","repository":{"id":93022803,"uuid":"71588950","full_name":"mdh266/PECS-1D","owner":"mdh266","description":"Photoelectrochemical Solar Cell Simulator in 1D","archived":false,"fork":false,"pushed_at":"2017-09-12T16:58:49.000Z","size":674,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-11T17:54:03.441Z","etag":null,"topics":["boost-libraries","c-plus-plus","discontinuous-galerkin","domain-decomposition","eigen-library","finite-element-methods","high-performance-computing","multithreading","photoelectrochemical-solar-cell","semiconductor-electrolyte-interface","simulation","solar-cells"],"latest_commit_sha":null,"homepage":"","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-10-21T18:51:49.000Z","updated_at":"2023-02-19T14:18:50.000Z","dependencies_parsed_at":"2023-03-13T17:23:04.112Z","dependency_job_id":null,"html_url":"https://github.com/mdh266/PECS-1D","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"c41df003104ed733c8029a49fa6452d0524a90c6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS-1D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS-1D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS-1D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdh266%2FPECS-1D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdh266","download_url":"https://codeload.github.com/mdh266/PECS-1D/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228124574,"owners_count":17873170,"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":["boost-libraries","c-plus-plus","discontinuous-galerkin","domain-decomposition","eigen-library","finite-element-methods","high-performance-computing","multithreading","photoelectrochemical-solar-cell","semiconductor-electrolyte-interface","simulation","solar-cells"],"created_at":"2024-12-04T14:13:37.261Z","updated_at":"2024-12-04T14:13:37.941Z","avatar_url":"https://github.com/mdh266.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhotoElectrochemical Cell Simulator\n\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 at the electrode interfaces create or eliminate reductant-oxidant (redox) species in the electrolyte leading to the generation of hydrogen fuel.  \n\n\n### Software Overview\n\nThis software is designed to simulate the dynamics of the reactive interface between a semiconductor and electrolyte in a 1D. The interface of 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 a 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 carriers.  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\nThe resulting output files from the simulation are in \u003ccode\u003e.dat\u003c/code\u003e format and can viewed using the python \u003ccode\u003eplotter.py\u003c/code\u003e script in \u003ccode\u003e/run/\u003c/code\u003e directoy.  The results of one simulation are shown below,\n\n![Densities](./documentation/images/Device_2_Illum.png)\n\n\nThis code will automatically run in parallel using the \u003ca href=\"http://www.openmp.org/\"\u003eOpenMP\u003c/a\u003e for multithreading if the library is present.\n\nFor **much more** background on the model and algorithms used in this project please see the  2D \u003ca href=\"http://mdh266.github.io/PECS/\"\u003edocumentation page\u003c/a\u003e.\n\n\n## Dependencies:\n1. \u003ca href=\"https://cmake.org/\"\u003eCMAKE 2.8\u003c/a\u003e   (Required)\n2. \u003ca href=\"https://www.gnu.org/software/gsl/\"\u003e GSL 1.16\u003c/a\u003e\t(Required)\n3. \u003ca href=\"http://eigen.tuxfamily.org/\"\u003eEIGEN 3.0\u003c/a\u003e   (Required)\n4. \u003ca href=\"http://www.boost.org/\"\u003eBOOST\u003c/a\u003e      (Required)\n5. \u003ca href=\"http://www.openmp.org/\"\u003e OpenMP\u003c/a\u003e \t(Optional)\n6. \u003ca href=\"https://www.python.org/\"\u003e Python\u003c/a\u003e, \u003ca href=\"http://www.numpy.org/\"\u003eNumPy\u003c/a\u003e and \u003ca href=\"http://matplotlib.org/\"\u003ematplotlib \u003c/a\u003e for visualization. (Optional)\n\n\n## Installing\n\nAfter installing all the dependencies for this code, go into the \u003ccode\u003ePECS-1D/\u003c/code\u003e directory.  Then use the following command in the terminal,\n\n\tmkdir build\n\tcd build \n\tcmake  ..\n\tmake solar_cell_app\n\tmv solar_cell_app ../run\n\n\n## Using the software\nFrom your terminal, cd in to the  \u003ccode\u003erun\u003c/code\u003e directory.  If you want to use multi-threading you need to first type into your terminal,\n\t\t\n\t\texport OMP_NUM_THREADS=num_threads\n\nwhere \u003ccode\u003enum_threads\u003c/code\u003e is the number of cores on your machine.\n\nTo set the paremeter values into you need to change the values in the input file,\n\n\t \tddp-input.ini \n\nsee the \u003ca href=\"http://mdh266.github.io/PECS/\"\u003edocumentation page\u003c/a\u003e for more datails on parameter values.\n\nTo run the code, type the following command from the \u003ccode\u003erun/\u003c/code\u003e directory,\n\t\t\t\n\t\t./solar_cell_app\n\nIf you want to change the doping/concentration profiles change the file the \u003ccode\u003eConcentrationProfile\u003c/code\u003e directory.  All units (densities and space) in these files are in non-dimensional form.  You will need to recompile if you change any of these files, i.e. use the steps,\n\nmake solar_cell_app\nmv solar_cell_app ../run\n\nThe data output files are labeled \u003ccode\u003eStateXXXX.dat\u003c/code\u003e where XXXX are specific numbers and contain the information,\n\t\n\t when (xvalues \u003c 0)\n\t\t xvalues, electron density, hole density, electric field, potential, current, time\n\n\t when\t(xvalues \u003e 0)\n\t\t xvalues, reductant density, oxidante density, electric field, potential, current, time\n\n\nTo make visualizations of the simulations use the Python script \u003ccode\u003eplotter.py\u003c/code\u003e in directory \u003ccode\u003erun\u003c/code\u003e by typing the command,\n\t\t\n\t\tpython plotter.py\n\nTo get rid of simulation produced files \u003ccode\u003e.dats\u003c/code\u003e, \u003c/code\u003e.png\u003c/code\u003e, \u003ccode\u003e.mp4\u003c/code\u003e invoke:\n\t\t\n\t\t./clean.sh\n\nEdit and use \u003ccode\u003eRunner_IV.py\u003c/code\u003e if you want to run this over multiple bias values.\n\n\n## Testing\n\nTo test the code run the following commands from the \u003ccode\u003ebuild/\u003c/code\u003e directory,\n\n\tmake test_System\n\t./test_System\n\nYou will then receive a report back of whether the code passed all the tests.\n\n\n## Documentation\n\nIf you want to build the documentation for this code tou must have\ndoxygen and latex installed.  Once it is has been obtained, from the \u003ccode\u003edocumentation\u003c/code\u003e \ndirectory type the command,\n\n\tdoxygen dox\n\nand a html file website we be built in the directory \u003ccode\u003ehtml/\u003c/code\u003e.  This\ncan be viewed from any web browser by opening the \u003ccode\u003eindex.html\u003c/code\u003e file within the directory.\n\n\n## Trouble Shooting\n* If oscillations appear in semiconductor domain (usually on the electron densities) \nuse a smaller value for the timeStepFactor. \n\n**NOTE: will slow down run time.**\n\n* If you see negative values/spikes/stability issues (NANs) in your results then increase the numBoundaryElements (make sure to \nincrease numElements so that numBoundaryElementsremains less than numElements). \nAlso, if this issue area is outside of the boundaryLayerWidth region, increase boundaryLayerWidth \nso that it covers these issue areas.  \n\n**NOTE: will slow down run time**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdh266%2Fpecs-1d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdh266%2Fpecs-1d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdh266%2Fpecs-1d/lists"}