I am using Lienhard & Lienhard's A Heat Transfer Textbook (freely available here) to study Heat Transfer.
On page 19, the heat flux is written as $q=\bar{h}\cdot{(T_{body}(t)-T_\infty)}$, where $\bar{h}$, the average heat transfer coefficient along a body's surface, is assumed to be positive. But then on page 21, an equation for heat convection is derived from the First Law of thermodynamics:
$Q=\frac{dU}{dt}$
Where:
$Q=q\cdot{A}$
And:
$\frac{dU}{dt}=mc\cdot{\frac{dT}{dt}}=\rho\cdot{V}\cdot{c}\cdot{\frac{dT}{dt}}$
Where $T=T_{body}(t)$.
Now, naively plugging in the first equation for $q$ into $q\cdot{A}=\rho\cdot{V}\cdot{c}\cdot{\frac{dT}{dt}}$ leads to this first-order differential equation:
$\bar{h}\cdot{A}\cdot{(T-T_\infty)}=\rho\cdot{V}\cdot{c}\cdot{\frac{dT}{dt}}$
And when you solve for $T(t)$ given $T(0)=T_i$, you get that:
$T=T(t)=(T_i-T_\infty)\cdot{e^{\frac{\bar{h}\cdot{A}}{\rho \cdot{V} \cdot{c}}\cdot{t}}}+T_\infty$
Since the heat transfer coefficient, surface area, density, volume and the heat capacity of a material is assumed to be positive, this solution implies that the temperature $T(t)$ will increase or decrease indefinitely as time progresses, depending on whether the medium you're using to change $T_i$ is hotter or cooler than $T_i$, which makes no sense at all.
So in the book they derive $T$ using $Q=-\bar{h}\cdot{(T-T_\infty)}$, which results in a more intuitive solution:
$T=T(t)=(T_i-T_\infty)\cdot{e^{-\frac{\bar{h}\cdot{A}}{\rho \cdot{V} \cdot{c}}\cdot{t}}}+T_\infty$
Because this expression implies that the temperature difference between the medium and the body will get smaller as time progresses.
So it turns out that taking negative $q$ leads to a reasonable expression for $T(t)$, but the expression for flux was originally stated without flipping any signs. Is there an explanation or intuition behind taking the negative flux for this derivation, or is it just a matter of interpreting the maths and convincing yourself that the sign change was necessary to model reality more correctly?