# 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 createConditionOfHeatTransfer(study, sel): """Create a heat transfer boundary condition for the set of component surfaces passed as arguments.""" htCond = study.CreateCondition(u"HeatTransfer", u"ht") htCond.SetValue(u"RefTemperatureType", "Constant") htCond.SetValue(u"Temperature", 11.2) htCond.SetValue(u"SettingType", "ThermalResistance") htCond.SetValue(u"ResistanceType", "CoolingSpray") htCond.SetValue(u"InputFlowType", "FlowVelocity") htCond.SetValue(u"ThermalCorrection", 1.2) htCond.SetValue(u"FlowVelocity", 0.1) htCond.SetValue(u"NozzleDiameter", 0.55) htCond.SetValue(u"CoolantType", "Water") htCond.ClearParts() htCond.AddSet(set, 0) app = designer.GetApplication() model = app.GetCurrentModel() set = model.GetSetList().GetSet(u"Heat Transfer Boundary") study = app.GetCurrentStudy() createConditionOfHeatTransfer(study, set)