Engee documentation
Notebook

Thermal diagram of the electric motor

This example demonstrates how the thermal state of a brushless motor can be modelled using a concentrated parameter model. The heat generated due to power losses in the stator, winding and rotor is represented by three sources of heat flux: stator heat generation (Q Stator), winding heat generation (Q Winding) and rotor heat generation due to magnetisation and eddy current losses (Q Rotor). The losses were recorded during the simulation of a typical motor cycle and stored in Repeating table blocks. The motor thermal circuit consists of heat conducting elements, thermal masses and convective heat transfer blocks that reproduce the heat paths in the parts: winding, stator, housing, rotor, front and rear bearing supports and flange. The motor exchanges heat with the atmosphere through housing-atmosphere, flange-atmosphere and bearing 1 -atmosphere contacts. Ambient conditions are simulated using an ideal temperature source set at 300 K.

Schematic of the model:

motor_thermal_circuit_1733400267958.png

Define the function to load and run the model:

In [ ]:
function start_model_engee()
    try
        engee.close("motor_thermal_circuit", force=true) # закрытие модели 
        catch err # в случае, если нет модели, которую нужно закрыть и engee.close() не выполняется, то будет выполнена её загрузка после catch
            m = engee.load("$(@__DIR__)/motor_thermal_circuit.engee") # загрузка модели
        end;

    try
        engee.run(m) # запуск модели
        catch err # в случае, если модель не загружена и engee.run() не выполняется, то будут выполнены две нижние строки после catch
            m = engee.load("$(@__DIR__)/motor_thermal_circuit.engee") # загрузка модели
            engee.run(m) # запуск модели
        end
end
Out[0]:
start_model_engee (generic function with 1 method)

Running the simulation

In [ ]:
try
    start_model_engee() # запуск симуляции с помощью специальной функции, реализованной выше
    catch err
    end;

Write temperature and heat flux signals from simout to variables:

In [ ]:
t = collect(simout["Тепловая масса статора.T"].time[:])
Температура_ротора = collect(simout["Тепловая масса ротора.T"].value[:])
Температура_обмоток = collect(simout["Тепловая масса обмоток.T"].value[:])
Температура_статора = collect(simout["Тепловая масса статора.T"].value[:])
Температура_корпуса = collect(simout["Тепловая масса корпуса.T"].value[:])
Тепловыделение_ротора = collect(simout["Тепловая масса ротора.T"].value[:])
Тепловыделение_обмоток = collect(simout["Тепловая масса обмоток.T"].value[:])
Тепловыделение_статора = collect(simout["Тепловая масса статора.T"].value[:]);

Visualising simulation results

In [ ]:
using Plots
In [ ]:
plot(t[:,1], Температура_ротора[:,1], label="Температура ротора, K", linewidth=2)
plot!(t[:,1], Температура_статора[:,1], label="Температура статора, K", linewidth=2)
plot!(t[:,1], Температура_обмоток[:,1], label="Температура обмоток, K", linewidth=2)
plot!(t[:,1], Температура_корпуса[:,1], label="Температура корпуса, K", linewidth=2, legend=:bottomright)
Out[0]:
In [ ]:
plot(t[:,1], Тепловыделение_ротора[:,1], label="Тепловыделение ротора, Вт", linewidth=2)
plot!(t[:,1], Тепловыделение_статора[:,1], label="Тепловыделение статора, Вт", linewidth=2)
plot!(t[:,1], Тепловыделение_обмоток[:,1], label="Тепловыделение обмоток, Вт", linewidth=2, legend=:bottomright)
Out[0]: