if as you say, the foam is around the system, take it apart and get that foam out of there, dont run a/c till you do it,, you can be stuffing a/c system and vents, thereby the evaporator is clogged and if you hopefully havent damaged anything,,it might be ok, the sensors pick this up and shut off a/c,,failsafe, hopefully it worked, you can, with vents apart get some aluminum tape(from wallymart is fine) and some glue, i use good glue, not that regular spray glue, and fix vent doorS