Click the green "Use this template" button at the top of the page, then choose "Create a new repository".
This will create your own copy of this project, which you can modify freely — no need to fork!
| Term | Definition |
|---|---|
| SHG | Second Harmonic Generation |
| CW | Continuous Wave |
| G | Gaussian |
Article title:
Temperature Distribution in a Gaussian End-Pumped Nonlinear KTP Crystal: the Temperature Dependence of Thermal Conductivity and Radiation Boundary Condition
Table of Contents
This repository contains the Toolkit for Modeling of 3D Temperature Distribution in KTP Crystal: Continuous-Wave Gaussian Second Harmonic Generation, an open-source toolkit for modeling the thermal dynamics that underpin continuous-wave second-harmonic generation (CW SHG), using KTP as a case study.
The toolkit provides comprehensive modules for geometry and material definitions of KTP crystals, boundary and cooling models with various heat transfer mechanisms, and transient and steady-state finite-difference solvers for temperature field computation.
The toolkit supports parameterized scenario sweeps including temperature-dependent versus constant thermal conductivity, convection with and without radiation boundary conditions, and heat-transfer coefficients spanning 6.5–2.0×10⁴ W·m⁻²·K⁻¹. It features compiled Fortran kernels with built-in benchmark reporting, reproducible pipelines with versioned code repository, and exportable datasets with spatiotemporal temperature fields. The toolkit generates both radial and axial temperature profiles for comprehensive analysis.
The implementation has been validated by reproducing temperature distributions and trends for KTP under Gaussian CW pumping, including the effects of temperature-dependent conductivity and boundary conditions. This toolkit was used to solve the thermal modeling problem described in the research article "Temperature Distribution in a Gaussian End-Pumped Nonlinear KTP Crystal: the Temperature Dependence of Thermal Conductivity and Radiation Boundary Condition".
Folder PATH listing
+---citation <-- Contains citation materials and research papers
│ 1_Heat-Equation_Continu… <-- Heat equation analytical paper
│ 2_Heat-Equation_Continu… <-- Heat equation continuous wave paper
│ 3_Heat-Equation_Pulsed-… <-- Heat equation pulsed wave paper
│ 4_Phase-Mismatch_Pulsed… <-- Phase mismatch pulsed wave paper
│ 5_Ideal_Continuous-Wave… <-- Ideal continuous wave paper
│ 6_Ideal_Pulsed-Wave_Be… <-- Ideal pulsed wave Bessel paper
│ 7_Coupled_Continuous-Wa… <-- Coupled continuous wave paper
│ README.md <-- Citation guidelines and information
│
+---images <-- Contains project images and logos
│ SHG-banner.png <-- SHG project banner
│
+---results <-- Numerical simulation results and benchmark data
│ ST_085_time_1_T_r.plt <-- Radial temperature profile data
│ ST_085_time_1_T_t.plt <-- Transverse temperature profile data
│ ST_085_time_1_T_z.plt <-- Axial temperature profile data
│
+---src <-- Toolkit source code and documentation
│ Code_SHG-CW-G-Heat-Equ… <-- Fortran finite difference solver (main toolkit)
│
│ Article_SHG-CW-G-Heat-… <-- Research paper PDF (problem solved by toolkit)
│ CITATION.cff <-- Citation metadata file
│ LICENSE <-- Project license information
│ README.md <-- Toolkit overview and documentation
│
- Fortran Compiler (gfortran, Intel Fortran, or similar)
- Text Editor (VS Code, Cursor, or any Fortran-capable editor)
- PDF Reader (for accessing research papers)
- Git (for cloning the repository)
-
Clone the repository
git clone https://github.com/Second-Harmonic-Generation/SHG-CW-G-Heat-Equation.git cd SHG-CW-G-Heat-Equation -
Explore the Research Papers
- Navigate to the
citation/folder - Read the main research paper:
Article_SHG-CW-G-Heat-Equation.pdf - Review additional papers for comprehensive understanding
- Navigate to the
-
Compile and Run the Toolkit
cd src gfortran -o heat_equation Code_SHG-CW-G-Heat-Equation.f90 ./heat_equation -
Analyze Results
- Check the
results/folder for output files and benchmark data - Examine
.pltfiles for temperature distribution profiles (radial, transverse, axial) - Use plotting software (Gnuplot, Python matplotlib, etc.) to visualize results
- Check the
-
Run Parameterized Scenarios (Optional)
- Edit the Fortran source code to change simulation parameters
- Explore different scenarios:
- Temperature-dependent vs. constant thermal conductivity
- Convection ± radiation boundary conditions
- Various heat-transfer coefficients (6.5–2.0×10⁴ W·m⁻²·K⁻¹)
- Recompile and run to compare results with published findings
Please refer to the citation folder for accurate citations. It contains essential guidelines for accurate referencing, ensuring accurate acknowledgement of our work.
For questions not addressed in the resources above, please connect with Mostafa Rezaee on LinkedIn for personalized assistance.
