A numerical model is presented for heat-coupled continuous-wave second harmonic generation in a double-pass type-II potassium titanyl phosphate (KTP) cavity. The model solves eight coupled partial differential equations governing forward and backward ordinary and extraordinary fundamental fields at 1064 nm, forward and backward second-harmonic fields at 532 nm, three-dimensional transient heat diffusion, and thermally induced phase mismatching (TIPM). Given crystal geometry, beam parameters, pump power, and cooling boundary conditions, the solver produces spatiotemporal temperature distributions, phase-mismatch profiles, and electric-field amplitudes along the propagation axis. The implementation requires less than 8 GB of memory and runs on standard desktop hardware. Comparison with published experimental data yields agreement within 4 % in predicted conversion efficiency. The source code is available under the MIT License (v1.0.2, DOI 10.5281/zenodo.17362470).