Here is a box example on which one end is fix at 100 degree C, and the other end is fix at zero temperature,(box.bdf)
The spcforces = all in the case control will gives you the heat of constraint or (Reaction force analogy in structure analysis) for for the grids that you have fix with a boundary temperature.
You can export that into a Excel spreadsheet and and add them and you will get Energy In minus Energy Out = zero
However you can modify the model to have convection to one end with a big H value such as 100 watt/m2.C convecting to a node 46. And the other end ,convection to zero degree also with H = 100 with node 47, now you will get heat of constraints as 50 watt, and -50 watt respectively.
box_conv.bdf
SOL 153
CEND
$ Direct Text Input for Global Case Control Data
ANALYSIS = HEAT
TITLE = MSC.Nastran job created on 30-Jun-21 at 10:51:52
ECHO = NONE
TEMPERATURE(INITIAL) = 1
SUBCASE 1
SUBTITLE=Default
NLPARM = 1
SPC = 1
THERMAL(SORT1,PRINT)=ALL
SPCFORCES(SORT1,REAL)=ALL
Using convection analogy: Only 2 nodes to look at: Energy In is equals to 50 watt,and -50 watt is leaving the body.
LOAD STEP = 1.00000E+00
F O R C E S O F S I N G L E - P O I N T C O N S T R A I N T
POINT ID. TYPE ID VALUE ID+1 VALUE ID+2 VALUE ID+3 VALUE ID+4 VALUE ID+5 VALUE