Step 1: Identify the given quantities.
Power of engine is
\[
P=20 \, kW
\]
Time of roundtrip is
\[
t=1 \, hour
\]
Convert time into seconds,
\[
t=3600 \, s
\]
Thermal efficiency is
\[
\eta=40\%=0.4
\]
Step 2: Calculate the useful work done by the engine.
Useful work output is given by
\[
W=Pt
\]
Substituting the values,
\[
W=20\times 3600
\]
\[
W=72000 \, kJ
\]
since \(1\,kW=1\,kJ/s\).
Step 3: Use the thermal efficiency relation.
Thermal efficiency is defined as
\[
\eta=\frac{\text{Useful work output}}{\text{Heat energy supplied}}
\]
Let the heat energy generated by fuel combustion be \(Q\).
Then,
\[
0.4=\frac{72000}{Q}
\]
\[
Q=\frac{72000}{0.4}
\]
\[
Q=180000 \, kJ
\]
Step 4: Final conclusion.
Hence, the energy generated by fuel combustion is
\[
\boxed{180000 \, kJ}
\]