a system for cooling an electrical machine is disclosed . the electrical machine includes a stator including a plurality of coils , an exterior housing , and an end cap . during operation of the electrical machine , a fluid is sprayed from the end cap onto the plurality of coils to carry away heat generated by the electrical machine .