I have an explicit FD (Finite Difference) code for diffusion/heat on a PDE in a cuboid domain, and it works fine. I would like to update the discretized equations and change the code so as to solve the problem on a sphere. From some preliminary searches, I can't seem to find any examples of FD on spheres using rectangular coordinates.
I have seen some in spherical coordinates, but that may require too many changes to the code (if this is the only way, please advice on how best to proceed)
$$\frac{\partial U}{\partial t} = \alpha \nabla^2U\quad in\enspace\mathbb{R}^3$$ $$U(x,y,z,0)=T$$ where T is a constant, and is also the boundary condition applied on all faces of the cube / the surface area of the sphere.
Question: Is it possible to adapt my code for a cube, to work on a sphere, and remain in rectangular coordinates? If so, how do I approach this?
Edit: (more context) This is a homogenous heat equation, where the boundary condition is a constant temperature (say T=100 degrees) applied on the entire surface area of the sphere (for the cube it was also applied on all 6 faces). The initial condition is the same heat source on the surface, while the entire insides of the sphere was initially at zero.