The coil end cooling component is a cooling model used in combination with the equivalent temperature boundary pattern (rotation) condition.
It is primarily used to model the cooling of the coil ends of rotating machines.
The thermal circuit configuration has thermal resistors and a heat capacity component for each coil slot equivalent to the number of copies, and is linked to the model by the equivalent temperature boundary components.
Because it is modeled as a dynamic macro component, it tracks the number of copies in the equivalent temperature boundary pattern (rotation) condition.
This script places the equivalent temperature boundary pattern (rotation) condition, coil end cooling component, and temperature probe component, and also sets the terminal temperature to be output to a CSV file in the study properties.
Preconditions
- One or more thermal or thermal stress study has been created.
This script runs on the active study in the project tree. - The equation variable named SLOTS must have been defined for the number of copies of the equivalent temperature boundary pattern.
- The set for target surfaces has been created, and the title is known.
- The units of the setting values follow the unit system set for the model.
Script Function
- Create and place a coil end cooling component with the title “up.” Check whether the circuit has already been created, and if not, create it.
- Create a temperature probe component and place it so that it connects to the terminal of the coil end cooling component.
- Set the parameters of the coil end cooling element.
Set the thermal resistance (coil end) to 0.016, the thermal capacity (coil end) to 0.012, the cooling type to constant, the thermal resistance (cooling) to 1.2, and monitor coil end temperature to ON. - Set the equivalent temperature boundary pattern (rotation) condition for the face set “CoilSet.”
Set the linked circuit component to “up” and the number of copies to SLOTS. - Set the terminal temperature (thermal circuit) to ON in the CSV file output settings of the study properties.
# 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/
def getCircuitInStudy(study):
"""Retrieve the Circuit object from the study.if it does not exist, create a new circuit"""
if study.HasCircuit():
circuit = study.GetCircuit()
else:
circuit = study.CreateCircuit()
return circuit
def createCoilEndCoolingWithThermalProbe(circuit, targetCompName):
"""Place the coil end cooling element and temperature probe element in the circuit"""
CECComp = circuit.CreateComponent(u"CoilEndCooling", targetCompName)
posX = -2
posY = 8
circuit.CreateComponentInstance(CECComp, posX, posY)
TPComp = circuit.CreateComponent(u"ThermalProbe", u"TP")
# Place the temperature probe on the terminal of the coil end cooling element
circuit.CreateComponentInstance(TPComp, posX, posY + 3)
CECComp.SetValue(u"ThermalResistance", 0.016)
CECComp.SetValue(u"HeatCapacity", 0.012)
CECComp.SetValue(u"CoolingType", u"Thermal Resistance (Constant)")
CECComp.SetValue(u"ThermalResistanceCooling1", 1.2)
CECComp.SetValue(u"MonitorCoilEndTemp", u"On")
def createConditionOfSameTemperatureBoundaryPattern(study, targetCompName, patternOriginalFaceSet):
"""Create an isothermal boundary pattern (rotation) condition and associate the specified coil end cooling element"""
condition = study.CreateCondition(u"SameTemperatureBoundaryPattern", targetCompName)
# The title of the coil end cooling component must be unique in order to do SetLink by component name
condition.SetLink(targetCompName)
condition.SetValue(u"NumCopies", u"SLOTS")
condition.AddSet(patternOriginalFaceSet, 0)
def applyCsvResultTypeOnTerminalTemperature(study):
"""Enable Terminal Temperature (Thermal Circuit) in the CSV output settings for Study Properties"""
study.GetStudyProperties().SetValue(u"CsvResultTypes", u"TerminalTemperature")
app = designer.GetApplication()
study = app.GetCurrentStudy()
circuit = getCircuitInStudy(study)
circuitCompName = u"up"
createCoilEndCoolingWithThermalProbe(circuit, circuitCompName)
set = app.GetCurrentModel().GetSetList().GetSet(u"CoilSet")
createConditionOfSameTemperatureBoundaryPattern(study, circuitCompName, set)
applyCsvResultTypeOnTerminalTemperature(study)


