Intercooler or exhaust gas recirculation (EGR) cooler
Powertrain Blockset / Propulsion / Combustion Engine Components / Fundamental Flow
The Heat Exchanger block models a heat exchanger, for example, an intercooler or exhaust gas recirculation (EGR) cooler. The inlet (port C) connects to an engine flow component (flow restriction, compressor, turbine, or engine block). The outlet (port B) connects to a volume (control volume or environment). Based on the upstream temperature, heat exchanger effectiveness, and cooling medium temperature, the block determines the heat transfer rate and downstream temperature.
For the heat exchanger effectiveness and cooling medium temperature, you can specify either a constant value or an external input. For example, if you specify a heat exchanger effectiveness that is:
Equal to 1, the downstream temperature is equal to the cooling medium temperature.
Equal to 0, there is no heat transfer to the cooling medium. The downstream temperature is equal to the upstream temperature.
The block assumes no pressure drop. To model pressure losses, use a Flow Restriction block.
The Heat Exchanger block implements equations that use these variables.
${T}_{upstr}$  Upstream temperature 
${T}_{dnstr}$  Downstream temperature 
${T}_{cool}$  Cooling medium temperature 
${T}_{cool,cnst}$  Constant cooling medium temperature 
${T}_{cool,input}$  External input cooling medium temperature 
$\epsilon $  Heat exchanger effectiveness 
${\epsilon}_{cnst}$  Constant heat exchanger effectiveness 
${\epsilon}_{input}$  Input heat exchanger effectiveness 
${c}_{p}$  Specific heat at constant pressure 
${q}_{ht}$  Heat exchanger heat transfer rate 
${p}_{flw,in}$  Pressure at inlet 
${p}_{vol,out}$  Pressure at outlet 
${T}_{vol,out}$  Temperature at outlet 
${h}_{vol,out}$  Specific enthalpy at outlet 
${q}_{in}$  Heat flow rate at inlet 
${q}_{out}$  Heat flow rate at outlet 
$\dot{m}$  Heat exchanger mass flow rate 
${T}_{flw,in}$  Temperature at inlet 
${T}_{in}$  Heat exchanger inlet temperature 
${T}_{out}$  Heat exchanger outlet temperature 
${h}_{in}$  Inlet specific enthalpy 
Heat exchanger effectiveness measures the effectiveness of heat transfer from the incoming hot fluid to the cooling medium:
$\epsilon =\frac{{T}_{upstr}{T}_{dnstr}}{{T}_{upstr}{T}_{cool}}$
In an ideal heat exchanger, the downstream temperature equals the cooling temperature. The effectiveness is equal to 1.
$\begin{array}{l}{T}_{dnstr}={T}_{cool}\\ \epsilon =1\end{array}$
The Heat Exchanger block uses the effectiveness to determine the downstream temperature and heat transfer rate.
$\begin{array}{l}{T}_{dnstr}={T}_{upstr}\epsilon \left({T}_{upstr}{T}_{cool}\right)\\ {q}_{ht}=\dot{m}{c}_{p}\left({T}_{upstr}{T}_{dnstr}\right)\end{array}$
Since the block assumes no pressure drop, ${P}_{flw,in}={P}_{vol,out}$.
The flow component connection to the heat exchanger inlet determines the direction of the mass flow. Based on the mass flow rate direction, these temperature and heat flow equations apply.
Fluid Flow  Mass Flow Rate  Temperatures and Heat Flow 

Forward — From engine flow component to outlet volume 
$\dot{m}\ge 0$ 
$\begin{array}{l}{T}_{upstr}={T}_{flw,in}\\ {T}_{in}={T}_{upstr}\\ {T}_{out}={T}_{dnstr}\\ {q}_{out}=\dot{m}{c}_{p}{T}_{dnstr}\end{array}$ 
Reverse — From outlet volume to engine flow component 
$\dot{m}<0$ 
$\begin{array}{l}{T}_{upstr}={T}_{vol,out}\\ {T}_{in}={T}_{dnstr}\\ {T}_{out}={T}_{vol,out}\\ {h}_{in}={c}_{p}{T}_{dnstr}\\ {q}_{out}=\dot{m}{h}_{vol,out}\end{array}$ 
The block uses the internal signal FlwDir
to track the direction of the flow.
For the power accounting, the block implements these equations.
Bus Signal  Description  Equations  



 Heat flow rate at port C  q_{in} 
 Heat flow rate at port B  q_{out}  

 Heat transfer rate to cooling medium  q_{ht}  
 Not used 
[1] Eriksson, Lars and Nielsen, Lars. Modeling and Control of Engines and Drivelines. Chichester, West Sussex, United Kingdom: John Wiley & Sons Ltd, 2014.