Ch9.3 Model for a Hot Water Heater

Introduction

  • We derive a differential equation for the temperature of water being heated by an electric heating element.
  • The problem applies principles similar to those in described in the coffee cup problem, except that in this case heat is added to the system via the heating element.
  • We write a heat balance equation expressing the rates of change of heat inputs and outputs that leads to a differential equation for the temperature as a function of time.

title

Hot Water Heater

  • We model the time taken for body of water in a hot water tank to heat to a specified temperature.
  • In this application we also need to account for the heat supplied to system by heating element.

title

Problem Description

title

  • We consider electrically heated hot water system.
  • For cylindrical heater:
  • \( h = 1.444 \) m = \( 144.4 \) cm
  • \( d = 0.564 \) m = \( 56.4 \) cm
  • \( V = 250 \) L
(V <- pi*(56.4/2)^2*(144.4)/1000)
[1] 360.7574

Problem Description

  • Initially we assume water to be 15\( ^{\circ} \) C.
  • The heating element supplies heat at a constant rate of 3.6 kW (kJoules/sec).
  • We wish to determine how long it would take to heat water to 60\( ^{\circ} \) C.

title

Variables and Parameters

  • Let \( U(t) \) = temperature of the water at time t.
  • Let \( u_0 \) = initial temperature of the water,
  • \( u_f \) = final temperature,
  • \( m \) = mass of water in the heater
  • \( q \) = rate of heat energy supplied
  • \( S \) = surface area \( m^2 \) from which heat can escape, which in the case of the hot water heater is the surface of the tank.

Model assumptions

  • Assume water in tank is well stirred so that temperature remains homogeneous throughout.
  • Assume that heat is lost from surfaces of tank according to Newton's law of cooling.

title

Model assumptions

  • Assume that thermal constants, such as the specific heat and the Newton cooling coefficient, remain constant in our applications.

title

Homogeneous Temperature

  • Assume the water in tank is well stirred so that temperature remains homogeneous throughout.
  • Otherwise temperature would be function of time and position
  • We would need to account for heat transfer (by conduction and convection) between different points in tank.
  • By assuming that the water is well stirred, we only have to consider the temperature of the water as a function of time.

General compartmental model

  • Start with input-output diagram for the heat content of the system by applying the balance law.

title title

Heat Balance of System

\[ \begin{Bmatrix} \mathrm{rate \, of \, change} \\ \mathrm{of \, heat } \end{Bmatrix} = \begin{Bmatrix} \mathrm{rate \, heat \, produced} \\ \mathrm{by\, heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{rate \, heat \, lost} \\ \mathrm{to \, surroundings} \end{Bmatrix} \]

title title

Formulating the differential equation

  • Net heat produced goes into raising temperature of system.
  • Need mathematical expression for heat required to change temperature.
  • Use fundamental equation relating heat to temperature via specific heat (Ch9.2):

\[ Q = cm \frac{dU}{dt} \]

  • Here \( Q \) is rate of change of heat content, \( c \) is specific heat of water, \( m \) is mass of water and \( U(t) \) is temperature at time t.

Formulating the differential equation

  • On the previous slide, we found an expression for left side of word equation:

\[ Q = cm \frac{dU}{dt} \]

  • We next determine expressions for the right side.

\[ \begin{Bmatrix} \mathrm{rate \, of \, change} \\ \mathrm{of \, heat } \end{Bmatrix} = \begin{Bmatrix} \mathrm{rate \, heat \, produced} \\ \mathrm{by\, heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{rate \, heat \, lost} \\ \mathrm{to \, surroundings} \end{Bmatrix} \]

Formulating the differential equation

  • Assume heating element produces heat at a constant rate per unit time \( q \):

\[ \begin{Bmatrix} \mathrm{rate \, heat \, produced} \\ \mathrm{by\, heating \, element} \end{Bmatrix} = q \]

  • Word equation from before:

\[ \begin{Bmatrix} \mathrm{rate \, of \, change} \\ \mathrm{of \, heat } \end{Bmatrix} = \begin{Bmatrix} \mathrm{rate \, heat \, produced} \\ \mathrm{by\, heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{rate \, heat \, lost} \\ \mathrm{to \, surroundings} \end{Bmatrix} \]

Formulating the differential equation

  • Rate of heat lost to surroundings: Newton's law of cooling

\[ \begin{align*} \begin{Bmatrix} \mathrm{rate \, heat \, lost} \\ \mathrm{to \, surroundings} \end{Bmatrix} & = hS \begin{Bmatrix} \mathrm{temperature} \\ \mathrm{difference} \end{Bmatrix} \\ \\ & = hS\left[ U(t) - u_s \right] \end{align*} \]

  • Here \( S \) is the surface area of heater, \( h \) is the Newton cooling coefficient, \( U(t) \) is the water temperature and \( u_s \) is the temperature of surroundings.

Formulating the differential equation

  • Thus

\[ cm \frac{dU}{dt} = q - hS\left[ U(t) - u_s \right] \]

  • This ODE describes temperature variation of water with time.

title

Heat Balance of System

  • Recall this slide from before.
  • Note that the word equation uses rates of change.

\[ \begin{Bmatrix} \mathrm{rate \, of \, change} \\ \mathrm{of \, heat } \end{Bmatrix} = \begin{Bmatrix} \mathrm{rate \, heat \, produced} \\ \mathrm{by\, heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{rate \, heat \, lost} \\ \mathrm{to \, surroundings} \end{Bmatrix} \]

title

Alternative Derivation

  • We don't need to use rates of change in our word equation.
  • Use amount of change over time interval and let \( \Delta t \rightarrow 0 \).

\[ \begin{Bmatrix} \mathrm{change \, in} \\ \mathrm{heat \, energy } \\ \mathrm{of \, tank } \end{Bmatrix} = \begin{Bmatrix} \mathrm{amount \, heat } \\ \mathrm{produced \, by } \\ \mathrm{heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{amount\, heat} \\ \mathrm{lost \, to } \\ \mathrm{surroundings} \end{Bmatrix} \]

title

Alternative Derivation

\[ \begin{Bmatrix} \mathrm{change \, in} \\ \mathrm{heat \, energy } \end{Bmatrix} = \begin{Bmatrix} \mathrm{amount \, heat } \\ \mathrm{produced \, by } \\ \mathrm{heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{amount\, heat} \\ \mathrm{lost \, to } \\ \mathrm{surroundings} \end{Bmatrix} \]

  • Change in heat energy = \( mc \left[ U(t + \Delta t) - U(t) \right] \)
  • Amount heat produced = \( q \Delta t \)
  • Amount heat lost to surroundings = \( hS \left[ U(t^{*}) - u_s \right] \)
  • \( U(t^{*}) \) = temperature at \( t^{*} \in [t, t + \Delta t] \)

Alternative Derivation

\[ \begin{Bmatrix} \mathrm{change \, in} \\ \mathrm{heat \, energy } \end{Bmatrix} = \begin{Bmatrix} \mathrm{amount \, heat } \\ \mathrm{produced \, by } \\ \mathrm{heating \, element} \end{Bmatrix} - \begin{Bmatrix} \mathrm{amount\, heat} \\ \mathrm{lost \, to } \\ \mathrm{surroundings} \end{Bmatrix} \]

\[ \begin{align*} mc \left[ U(t + \Delta t) - U(t) \right] &= q \Delta t - hS \left[ U(t^*) - u_s \right] \\ mc \lim_{\Delta t \rightarrow 0} \frac{U(t + \Delta t) - U(t)}{\Delta t} &= q - hS \lim_{\Delta t \rightarrow 0} \frac{\left[ U(t^*) - u_s \right]}{\Delta t} \\ cm \frac{dU}{dt} &= q - hS\left[ U(t) - u_s \right] \end{align*} \]

Solving the ODE

  • We can use fourth-order Runge-Kutta (RK4) for this ODE.
  • We could also use ode45 program in MATLAB or Python.
  • Another choice is to use Maple.
  • The analytic solution is found in Ch10.2, using the method of integrating factors.

\[ cm \frac{dU}{dt} = q - hS\left[ U(t) - u_s \right] \]

title

Parameters

\[ \frac{dU}{dt} = \frac{q}{cm} - \frac{hS}{cm}\left[U - u_s \right] \]

title

  • Typical values:
  • \( q = 3600 W = 3600 \frac{J}{sec} \)
  • \( c = 4200 \, \frac{J}{kg ~^\circ C} \)
  • \( m = 250 \, kg \)
  • \( h = 12 \, \frac{W}{m^2 ~^\circ C}= 12 \frac{J}{m^2 sec~^\circ C } \)
  • \( S = 3.06 m^2 \)
  • \( u_0 = u_s = 15^\circ C \)

Unit Check for our ODE

\[ \frac{dU}{dt} = \frac{q}{cm} - \frac{hS}{cm}\left(U - u_s \right) \]

  • Units for left side of ODE are clearly \( \frac{C}{sec} \).
  • Units for right side ODE terms (see previous slide also):

\[ \begin{align*} \frac{q}{cm} &\sim \frac{ \frac{J}{sec} } { \left(\frac{J}{kg ~C}\right)kg } = \frac{C}{sec} \\ \frac{hS}{cm}\left(U - u_s \right) &\sim \frac{ \left(~\frac{J}{m^2 sec~ C}\right)\left(m^2~\right)\left(~C~\right) } { \left(\frac{J}{kg ~C~}\right)~kg~ } = \frac{C}{sec} \end{align*} \]

Numerical Solution Using R

Ch93Ex1(10)

title

Numerical Solution Using R

Ch93Ex1 <- function(T) {
#Ch9.3: Perform Rk4 for water heater
#T is time length in hours for [0, T]
N <- 3600*10   #N is number of time nodes
h <- 3600*T/N    #Time step size in seconds
#System Parameters
t0 <- 0
u0 <- 15 
us <- 15
q <- 3600    
c <- 4200    
m <- 250      
h <- 12    
S <- 3.06    
#Slope function from ODE
f <- function(U) {q/(c*m) - (h*S)/(c*m)*(U - us)}  

Numerical Solution Using R

#Initialize vectors for time t and temperature U. 
t <- rep(0, N)
U <- rep(0, N)
t[1] <- t0
U[1] <- u0
#Runge-Kutta Loop (Generate temperature vector U)
for(i in 1:N) {
a1 <- h*f(U[i]);          #f = slope of U
b1 <- h*f(U[i]+0.5*a1);   #Half-step predictor 
c1 <- h*f(U[i]+0.5*b1);   #Half-step predictor 
d1 <- h*f(U[i]+c1);       #Full-step predictor 
U[i+1]<-U[i]+(1/6)*(a1+2*b1+2*c1+d1);#Next U value
t[i+1] <- t[i] + h  #Next t value, need for plot}