Thermal model settings define a cooling model and the parameters that make up the model and are used to couple the thermal equivalent circuit with the FEA model through heat transfer boundary conditions.
This script creates thermal model settings for a cooling path combining a cooling jacket and hollow shaft spray and sets the parameters of the thermal model.
Preconditions
- One or more thermal analysis studies have been created.
This script runs on the active thermal analysis study in the project tree. - The units of the setting values follow the unit system set for the model.
- The thermal model is available in JMAG-Designer v25.1 and later.
Script Function
- Create thermal model setting with the title "motor". If the setting has already been created, retrieve the existing setting. Only one thermal model setting can be created per study.
- Set the coolant path to "Cooling Jacket + Hollow Shaft Spray".
- Set the external temperature to 70 and the rotation speed to 1,000.
- For Inlet 1, set the volume flow rate to 8e-05, the coolant temperature to 70 and the coolant type to oil.
- Set the flow rate distribution from the hollow shaft to the outlet, front shaft spray and rear shaft spray.
- Set the height of the housing to 300 and its thickness to 10.
- For the mounting, set the type to "front flange", the flange diameter to 43.7, the plate height to 265, the plate width to 265 and the plate temperature to 70.
- For the cooling jacket, set the tube width to 10, the tube height to 7 and the number of tubes to 3.
- Set the inner diameter of the shaft to 14.6.
- Set the coil thermal conductivity of the coil end to 400.
- For the bearing, set the front shaft diameter to 29.1, the bearing diameter to 37.8 and the bearing width to 10; for the rear, set the shaft diameter to 29.1, the bearing diameter to 37.8 and the bearing width to 10.
- Set the convection type of the external cooling to "natural"
# Copyright (c) 2026 JSOL CORPORATION
#
# This script is released under the MIT License.
# See the full license text at:
# https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/
app = designer.GetApplication()
def createOrGetThermalModelDefinition(study):
"""Create thermal model settings, or get the existing settings if already created."""
app.ClearError()
thermalModelDefinition = study.CreateThermalModelDefinition(u"motor")
if app.HasError():
app.ClearError()
thermalModelDefinition = study.GetThermalModelDefinition()
return thermalModelDefinition
def setThermalModelDefinition(thermalModelDefinition):
"""Set cooling, housing, and surrounding component parameters for the thermal model settings."""
thermalModelDefinition.SetCoolantPathType(u"Cooling Jacket + Hollow Shaft Spray")
parameterSettings = [
(u"ExternalTemperature", 70),
(u"Speed", 1000),
(u"Inlet-1CoolantVolumeFlowRate", 8e-5),
(u"Inlet-1SprayCoolantTemperature", 70),
(u"Inlet-1CoolantType", u"Oil"),
(u"FromHollowShaftToOutlet", 0.4),
(u"FromHollowShaftToFrontShaftSpray", 0.3),
(u"FromHollowShaftToRearShaftSpray", 0.3),
(u"HousingHeight", 300.0),
(u"HousingThickness", 10),
(u"MotorMountingType", u"FrontFlange"),
(u"FlangeDiameter", 43.7),
(u"FlangePlateHeight", 265.0),
(u"FlangePlateWidth", 265.0),
(u"FlangePlateTemperature", 70),
(u"TubeWidth", 10),
(u"TubeHeight", 7),
(u"TubeNumber", 3),
(u"ShaftInnerDiameter", 14.6),
(u"CoilEndThermalConductivity", 400),
(u"ShaftDiameterFront", 29.1),
(u"BearingDiameterFront", 37.8),
(u"BearingWidthFront", 10.0),
(u"ShaftDiameterRear", 29.1),
(u"BearingDiameterRear", 37.8),
(u"BearingWidthRear", 10.0),
(u"ConvectionType", u"Natural"),
]
for propertyName, value in parameterSettings:
thermalModelDefinition.SetValue(propertyName, value)
def main():
"""Create thermal model settings in the current study and set each parameter."""
study = app.GetCurrentStudy()
thermalModelDefinition = createOrGetThermalModelDefinition(study)
setThermalModelDefinition(thermalModelDefinition)
main()


