Thermal calculation for a D2PAK with a SMT Heatsink

I am trying to calculate the junction temperature of a D2PAK FET that is dissipating 5W. The junction-to-case thermal resistance is 0.4 C/W. The junction-to-ambient (PCB mounted, steady state) resistance is 40 C/W. It seems that D2PAK datasheets don't give a case-to-sink figure.

I am using this sink which has a thermal resistance of just 3 C/W with forced air flow. My question is, when calculating the junction temperature do I include the junction-to-ambient figure in the calculation?

Tj = Pd(Rth(jc) + Rth(ja) + Rth(heatsink)) + Tambient

Or can I ignore the ambient figure when using a heatsink?

You don't use the original Tja anymore because it's not valid - there are new thermal resistances to place between the junction and the ambient air.

Have a look at this Analog Devices application note MT-093.

You can see that: $$\Theta_{JA} = \Theta_{JC} + \Theta_{CA}$$

Now when you add a heatsink, you are inserting another thermal resistance between the case and ambient air, so your equation becomes:

$$\Theta_{JA} = \Theta_{JC} + \Theta_{CS} + \Theta_{SA}$$

Where Tcs is thermal resistance of the case to your sink. This depends on your interface material, sometimes known as "thermal grease". Various factors (surface area, applied pressure) change how well the thermal grease will conduct heat. An estimate of .25°C/W seems reasonable.

Tsa is the thermal resistance of the sink to ambient. (3°C/W as stated, with some airflow)

So to calculate your maximum allowable ambient temp:

$$T_A = T_J - P * (\Theta_{JC} + \Theta_{CS} + \Theta_{SA})$$