There is an awful lot to understand in the damage model .. but essentially the definitions in various UPC files (for bulkheads, other equipment and then the compartments in the subs main UPC file) all affect how fast repair can be performed and more importantly, to what level something can be repaired (some items definitions mean they can not be 100% repaired) ... and even then my testing found some very strange behaviour suggesting it ignores the UPC files sometimes. I learned everything I know from Observer over on this forum / thread;
http://forum.kickinbak.com/viewtopic.php?f=70&t=1378
If you really want to understand how damage model works, read the whole thread.