Coupled thermal and electromagnetic analysis of the NAFASSY magnet