How to calculate temperature in Wire?
Is the 40A on the 12V side (480W) or the 230V side (9200W)?

2.5 mm2 wire has a resistance of 6.7 m&Omega; per meter, which means a voltage drop of 0.27 volts per meter. You probably can't tolerate more than about a 10% drop, which is only a total of 1.2 V on the low-voltage side &mdash; therefore, you can only use a total of about 4.4 m of wire (two runs of 2.2m).

Anyway, the power dissipation is (40 A)2 &times; 6.7 m&Omega; = 10 W per meter, which is a lot. The actual temperature rise is difficult to calculate; among other things, we'd need to know the thermal conductivity and thickness of the wire's insulation.

I personally wouldn't use less than AWG8 (roughly 8 mm2, 2 m&Omega;/m) in an application like this, no matter how "temporary" it might be. And don't forget that each connection adds a little resistance, too.