Modeling and Optimizing
Thermal Management in 
Electric Vehicles

Ankit Naik, Applications Engineer,
Wolfram MathCore

#WolframTechConf

Why Thermal Management Matters

Thermal management sits at the intersection of efficiency, comfort, and reliability — and modeling helps us optimize all three.

Increase range by reducing power consumption

Reduce auxiliary power consumption

Reuse battery heat for cabin heating (more efficient than electric coils)

Safety requirements

Battery temperature has to be between an operating range to avoid degradation from overheating or over-cooling

Thermal comfort

Driver cabin must heat/cool rapidly to target range

Every watt of waste heat affects how far you can drive and how long your components last.

Use Case—Battery Cooling

Maintain battery 20–40 °C (performance + safety)

Build up a thermal management system to maintain battery temperature step-by-step—starting with a simple cooling loop and ending with an optimized thermo-fluid circuit.

Model in System Modeler → Simulate → Analyze in Wolfram Language

Step 1—Battery cooling loop

We start with the simplest closed loop — coolant circulates through the battery to maintain temperature.

SystemModel["BatteryLoop",{"Diagram",Frame->False}]

Vary the flow rate through the battery to check the heat transfer rates.

Simulate in System Modeler and vary parameters in real-time:

SystemModeler["BatteryLoop","Modeling"]

Check the animation of the circuit in action:

sim1 = SystemModelSimulate["BatteryLoopSim",<|"ParameterValues"->{"valveOpening.k"->1}|>];
SystemModelPlot[sim1]

dynamicDiagram[sim1]

Faults:

Coolant temperature increases with time

Hence affects battery cooling

Step 2—Battery with radiator

Let’s cool the coolant using a air-to-liquid radiator.

SystemModel["BatteryRadiator",{"Diagram",Frame->False}]

Vary the flow rate through the battery and radiator to check the heat transfer rates.

Simulate in System Modeler and vary parameters in real-time:

How does the valves affect the heat transfer rates?

Let’s do parameter sweep and plot the battery temperatures.

Prepare different configurations of valve openings:

valveOpening1 = Range[0,1,0.1];
valveOpening2 = Range[0,1,0.1];
{paramvalveOpening1,paramvalveOpening2} = Transpose@Tuples[{valveOpening1,valveOpening2}];

Carry out simulations in parallel for the same pump volumetric flow rates:

sims1 = SystemModelSimulate["BatteryRadiatorSim",100,
<|"ParameterValues"->{"valveOpening1.k"->paramvalveOpening1,"valveOpening2.k"->paramvalveOpening2,"pump.constantVolumeFlow"->0.001}|>];

Plot the results and check the impact:

res1 = Transpose[
{
paramvalveOpening1,
paramvalveOpening2,
Through[sims1["battery.batteryBody.T",100]]-273.15
}
];
ListContourPlot[res1,PlotLegends->Automatic,FrameLabel->{"radiator valve", "battery valve"},PlotRange->All]

Does the system work also for warmer climates?

Simulate for several ambient temperatures:

paramTemp = Range[273,340,10];
simsAmbient = SystemModelSimulate["BatteryRadiatorSim",100,<|"ParameterValues"->{"valveOpening1.k"->1,"valveOpening2.k"->1,"pump.constantVolumeFlow"->0.001,"ambientT"->paramTemp}|>];

Plot the battery temperatures (at the end of 100s)

ListLinePlot[Transpose[
{
paramTemp-273.15,
Through[simsAmbient["battery.batteryBody.T",100]]-273.15
}
],AxesLabel->{"ambient temperature [°C]", "battery temperature [°C]"}]

Faults:

At higher temperatures the battery temperature increases

The air-to-liquid radiator is not enough

Step 3—Battery with heat pump and radiator

Let’s add a heat pump which can act as a cooling device (rather than a heating device!) during warm days.

SystemModel["BatteryHeatPump",{"Diagram",Frame->False}]

SystemModel["HeatPump",{"Diagram",Frame->False}]

Simulate for several temperatures:

paramTemp = Range[273,340,10];
simsAmbient = SystemModelSimulate["BatteryHeatPump",100,<|"ParameterValues"->{"ambientT"->paramTemp}|>];
ListLinePlot[Transpose[
{
paramTemp-273.15,
Through[simsAmbient["battery.batteryBody.T",100]]-273.15
}
],AxesLabel->{"ambient temperature [°C]", "battery temperature [°C]"}]

Check the animation of the circuit in action:

sim2= SystemModelSimulate["BatteryHeatPump",100,<|"ParameterValues"->{"ambientT"->320}|>];
dynamicDiagram[sim2]

Faults:

Can we reuse heat rather than dumping?

Step 4—With cabin space

Reuse heat for passenger cabin space heating:

SystemModel["SpaceHeating",{"Diagram",Frame->False,ImageSize->Large}]

How does cabin heating work?

SystemModel["CarBodyThermal",{"Diagram",Frame->False}]

How much mass flow is required for cabin heating?

Test from different valve openings:

paramvalveOpening3 = Range[0,1,0.05];
sims2 = SystemModelSimulate["ElectricVehiclesWebinar.SpaceHeating",100,<|"ParameterValues"->{"ambientT"->280,"valveOpening3.k"->paramvalveOpening3}|>];

Plot the cabin temperature:

res2 = Transpose[
{
paramvalveOpening3,
Through[sims2["cabinSpace.carSpace1.T",100]]-273.15
}
];
ListLinePlot[res2,AxesLabel->{"valve opening 3",  "temperature [°C]"},PlotRange->All]

The goal isn’t just to remove heat — it’s to manage it intelligently.

Libraries

Many libraries (free) available depending on the fidelity needs.

ThermoFluidFlow (builtin)

Fluid (builtin)

Hydraulic (System Modeler library store)

IBPSA (System Modeler library store)

ThermoFluidStream (GitHub)

more...

Summary

Model in System Modeler → Simulate → Optimize in Wolfram Language

Battery cooling loop: coolant warms over time

+ Radiator: Effective in mild climates

+ Heat Pump: Maintains temperature in warm climates

+ Cabin Space: Reuses heat for comfort and efficiency

Maintained battery temperature 20–40 °C under varying ambient conditions

Thermal management isn’t just about removing heat—it’s about managing energy intelligently across the vehicle.

Q&A

Code

dynamicDiagram[sim_]:=Module[{simDuration,symbolicDiag,numImages,images,animation},
simDuration = sim["SimulationLength"];
symbolicDiag=sim["Diagram",t];
numImages=10;
images=Table[symbolicDiag,{t,0,simDuration,Round[simDuration/(numImages-1)]}];
animation=ListAnimate[images,ControlPlacement->Top,AnimationRunning->False]
]