Skip to content

Heat-coupled depleted pulsed Type II SHG model in KTP crystal. Solves 5 coupled differential equations (3 field, 1 heat with temp-dependent conductivity, 1 phase) using FDM for thermal phase mismatch and lensing.

License

Notifications You must be signed in to change notification settings

Second-Harmonic-Generation/SHG-PW-G-Coupled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧰 How to Use This Template

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!

SHG Logo

SHG-PW-G-Coupled

Term Definition
SHG Second Harmonic Generation
PW Pulsed Wave
G Gaussian

 

Article title:
Heat coupled type II long-pulse second harmonic generation: a model for inclusion of thermal phase mismatching and thermal lensing

 


Table of Contents

       

1. About this repository

This repository contains the toolkit and computational tools used in the research article "Heat coupled type II long-pulse second harmonic generation: a model for inclusion of thermal phase mismatching and thermal lensing", including source code, numerical solvers, and reproducibility assets.

This toolkit provides a comprehensive time-dependent three-dimensional spatial model for the mutual interaction of type II pulsed second harmonic generation and thermal effects in potassium titanyl phosphate (KTP) crystals. The model investigates how thermally induced phase mismatching (TPM) and thermal lensing reduce conversion efficiency and beam quality, revealing the key limitations to achieving higher efficiency in second harmonic generation systems.

The toolkit implements a complete solution for five coupled differential equations solved simultaneously using the Finite Difference Method (FDM). The coupled equations include: three field equations for fundamental ordinary wave ($E^{o,\omega}$), fundamental extraordinary wave ($E^{e,\omega}$), and second harmonic wave ($E^{e,2\omega}$); one heat equation with temperature-dependent thermal conductivity $K(T)=K_0 T_0/T$; and one phase equation for thermal phase mismatching. The simulation runs over time until a sufficient number of pulses enter the system to reach a steady-state thermal condition.

The model considers Gaussian distribution for the transverse distribution of fundamental and second harmonic waves, depletion of pump waves during propagation along the $z$ axis, optical absorption of all waves (fundamental and second harmonic), transverse Laplacian effects (which are usually ignored for simplicity but are included here), evolution with successive pulses until steady-state temperature distribution is achieved, thermal cooling mechanisms including radiation and convection, thermal lensing with all associated optical aberrations, and temperature-dependent refractive indices calculated using Sellmeier's equations and Taylor expansion around phase match temperature.

The numerical procedure presented here offers substantial reduction in runtime for modeling repetitively pulsed pumping toward steady-state conditions. The optimized code requires approximately 16 GB RAM and 1 minute to complete simulations on personal computers, enabling accurate investigation of how thermally induced phase mismatching and thermal lensing reduce conversion efficiency and beam quality in second harmonic generation systems. The numerical calculations use 120 × 12000 meshes for $r$ and $z$ coordinates, respectively, and 2532 time steps for each pulse to achieve ultimate accuracy.

Folder PATH listing
+---citation                      <-- Contains citation materials and 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
│       E_045_f_4000_Np_1_tp_50…  <-- Elec12 radial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec12 time series data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec12 axial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec22 radial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec22 time series data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec22 axial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec32 radial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec32 time series data
│       E_045_f_4000_Np_1_tp_50…  <-- Elec32 axial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Optimization index data
│       E_045_f_4000_Np_1_tp_50…  <-- Phase radial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Phase time series data
│       E_045_f_4000_Np_1_tp_50…  <-- Phase axial distribution data
│       E_045_f_4000_Np_1_tp_50…  <-- Minimum phase data
│       E_045_f_4000_Np_1_tp_50…  <-- Psi2 picks data
│       E_045_f_4000_Np_1_tp_50…  <-- Psi3 picks data
│       E_045_f_4000_Np_1_tp_50…  <-- Temperature radial data
│       E_045_f_4000_Np_1_tp_50…  <-- Temperature time series data
│       E_045_f_4000_Np_1_tp_50…  <-- Temperature axial data
│       E_045_f_4000_Np_1_tp_50…  <-- Maximum temperature data
│
+---src                           <-- Contains source code
│       Code_SHG_PW_G_Coupled…    <-- Fortran solver for coupled equations
│
        LICENSE                   <-- Project license information
        README.md                 <-- Project overview and documentation

2. Getting Started

2.1. Prerequisites

To run this project, you will need the following software and tools: Fortran Compiler (Intel Fortran ifort is recommended, or gfortran as an alternative), Git for cloning the repository, Text Editor or IDE such as VS Code or Cursor with Fortran language support, and Terminal/Command Line Interface for compilation and execution.

For Ubuntu/Debian systems, Intel Fortran can be installed through Intel oneAPI toolkit. Alternatively, gfortran can be installed using sudo apt-get install gfortran. For macOS, gfortran can be installed via brew install gfortran. For Windows, install MinGW-w64 or Intel Fortran Compiler.

2.2. Quick Start

Follow these steps to get the project running:

Clone the Repository: Use git clone to obtain a local copy of the repository, then navigate into the project directory using cd SHG-PW-G-Coupled.

Navigate to Project Root: The source code is located in the src/ directory, but compilation should be performed from the project root directory.

Compile the Fortran Code: Use Intel Fortran compiler with the command ifort -o Code_SHG_PW_G_Coupled src/Code_SHG_PW_G_Coupled.f90. If Intel Fortran is not available, gfortran can be used as an alternative with gfortran -o Code_SHG_PW_G_Coupled src/Code_SHG_PW_G_Coupled.f90.

Run the Simulation: Execute the compiled program using ./Code_SHG_PW_G_Coupled. The program will prompt for input parameters including energy value, frequency, number of pulses, and pulse width. These can also be modified directly in the source code for automated runs.

View Results: The program generates output files in the results/ directory containing temperature distribution data, phase mismatch data, and electric field intensity data for fundamental and second harmonic waves. These files are in PLT format and can be analyzed using data visualization tools or imported into analysis software.

Development Environment: For enhanced development experience, open the project in VS Code or Cursor with Fortran language extensions installed for syntax highlighting and debugging capabilities. Use the integrated terminal for compilation and execution.

Note: Simulation parameters including energy, frequency, number of pulses, pulse width, crystal dimensions, and material properties can be modified directly in the Fortran source code (src/Code_SHG_PW_G_Coupled.f90) to explore different scenarios and crystal configurations. The code implements an optimized numerical procedure that significantly reduces computational requirements compared to initial implementations.

3. How to Cite Us

Please refer to the citation folder for accurate citations. It contains essential guidelines for accurate referencing, ensuring accurate acknowledgement of our work.

4. Contact Information

For questions not addressed in the resources above, please connect with Mostafa Rezaee on LinkedIn for personalized assistance.

About

Heat-coupled depleted pulsed Type II SHG model in KTP crystal. Solves 5 coupled differential equations (3 field, 1 heat with temp-dependent conductivity, 1 phase) using FDM for thermal phase mismatch and lensing.

Topics

Resources

License

Stars

Watchers

Forks