.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\04-Icepak\Icepak_Example.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_04-Icepak_Icepak_Example.py: Icepak: graphic card thermal analysis ------------------------------------- This example shows how you can use PyAEDT to create a graphic card setup in Icepak and postprocess results. The example file is an Icepak project with a model that is already created and has materials assigned. .. GENERATED FROM PYTHON SOURCE LINES 8-11 Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform required imports. .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: Python import os import pyaedt .. GENERATED FROM PYTHON SOURCE LINES 16-19 Set AEDT version ~~~~~~~~~~~~~~~~ Set AEDT version. .. GENERATED FROM PYTHON SOURCE LINES 19-22 .. code-block:: Python aedt_version = "2024.1" .. GENERATED FROM PYTHON SOURCE LINES 23-27 Set non-graphical mode ~~~~~~~~~~~~~~~~~~~~~~ Set non-graphical mode. You can set ``non_graphical`` either to ``True`` or ``False``. .. GENERATED FROM PYTHON SOURCE LINES 27-30 .. code-block:: Python non_graphical = False .. GENERATED FROM PYTHON SOURCE LINES 31-34 Download and open project ~~~~~~~~~~~~~~~~~~~~~~~~~ Download the project, open it, and save it to the temporary folder. .. GENERATED FROM PYTHON SOURCE LINES 34-46 .. code-block:: Python temp_folder = pyaedt.generate_unique_folder_name() project_temp_name = pyaedt.downloads.download_icepak(temp_folder) ipk = pyaedt.Icepak(projectname=project_temp_name, specified_version=aedt_version, new_desktop_session=True, non_graphical=non_graphical ) ipk.autosave_disable() .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\_tool\Python\3.10.9\x64\lib\subprocess.py:1072: ResourceWarning: subprocess 12128 is still running _warn("subprocess %s is still running" % self.pid, C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\generic\settings.py:383: ResourceWarning: unclosed file <_io.TextIOWrapper name='D:\\Temp\\pyaedt_ansys.log' mode='a' encoding='cp1252'> self._logger = val True .. GENERATED FROM PYTHON SOURCE LINES 47-50 Plot model ~~~~~~~~~~ Plot the model. .. GENERATED FROM PYTHON SOURCE LINES 50-53 .. code-block:: Python ipk.plot(show=False, export_path=os.path.join(temp_folder, "Graphics_card.jpg"), plot_air_objects=False) .. image-sg:: /examples/04-Icepak/images/sphx_glr_Icepak_Example_001.png :alt: Icepak Example :srcset: /examples/04-Icepak/images/sphx_glr_Icepak_Example_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 54-57 Create source blocks ~~~~~~~~~~~~~~~~~~~~ Create source blocks on the CPU and memories. .. GENERATED FROM PYTHON SOURCE LINES 57-61 .. code-block:: Python ipk.create_source_block("CPU", "25W") ipk.create_source_block(["MEMORY1", "MEMORY1_1"], "5W") .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 62-65 Assign openings and grille ~~~~~~~~~~~~~~~~~~~~~~~~~~ Assign openings and a grille. .. GENERATED FROM PYTHON SOURCE LINES 65-70 .. code-block:: Python region = ipk.modeler["Region"] ipk.assign_openings(air_faces=region.bottom_face_x.id) ipk.assign_grille(air_faces=region.top_face_x.id, free_area_ratio=0.8) .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 71-74 Assign mesh regions ~~~~~~~~~~~~~~~~~~~ Assign a mesh region to the heat sink and CPU. .. GENERATED FROM PYTHON SOURCE LINES 74-83 .. code-block:: Python mesh_region = ipk.mesh.assign_mesh_region(assignment=["HEAT_SINK", "CPU"]) mesh_region.UserSpecifiedSettings = True mesh_region.MaxElementSizeX = "3.35mm" mesh_region.MaxElementSizeY = "1.75mm" mesh_region.MaxElementSizeZ = "2.65mm" mesh_region.MaxLevels = "2" mesh_region.update() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 84-87 Assign point monitor ~~~~~~~~~~~~~~~~~~~~ Assign a point monitor and set it up. .. GENERATED FROM PYTHON SOURCE LINES 87-97 .. code-block:: Python ipk.assign_point_monitor(point_position=["-35mm", "3.6mm", "-86mm"], monitor_name="TemperatureMonitor1") ipk.assign_point_monitor(point_position=["80mm", "14.243mm", "-55mm"], monitor_type="Speed") setup1 = ipk.create_setup() setup1.props["Flow Regime"] = "Turbulent" setup1.props["Convergence Criteria - Max Iterations"] = 5 setup1.props["Linear Solver Type - Pressure"] = "flex" setup1.props["Linear Solver Type - Temperature"] = "flex" ipk.save_project() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 98-101 Solve project and postprocess ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Solve the project and plot temperatures. .. GENERATED FROM PYTHON SOURCE LINES 101-113 .. code-block:: Python quantity_name = "SurfTemperature" surflist = [i.id for i in ipk.modeler["CPU"].faces] surflist += [i.id for i in ipk.modeler["MEMORY1"].faces] surflist += [i.id for i in ipk.modeler["MEMORY1_1"].faces] surflist += [i.id for i in ipk.modeler["ALPHA_MAIN_PCB"].faces] plot5 = ipk.post.create_fieldplot_surface(surflist, "SurfTemperature") ipk.analyze() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 114-117 Release AEDT ~~~~~~~~~~~~ Release AEDT. .. GENERATED FROM PYTHON SOURCE LINES 117-119 .. code-block:: Python ipk.release_desktop(True, True) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** (2 minutes 45.631 seconds) .. _sphx_glr_download_examples_04-Icepak_Icepak_Example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Icepak_Example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Icepak_Example.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_