Learn thermal plugin basics
Learn how to compile the plugin and use it in Simcenter 3D.
Introduction
A thermal plugin is a collection of user-defined functions compiled into a .dll file and referenced within a simulation. These functions can include heat transfer windage and pumping or any other custom correlations and relationships relevant to your modeled physics.
For example, consider a function that computes a heat transfer coefficient based on mass flow, flow area, and characteristic length: HTC(M,A,L), where mass flow, flow area and characteristic length are externally supplied arguments.
In this workshop, you will:
- Open a sample plugin in Visual Studio.
- Compile the plugin into a .dll.
- Open a model that references the plugin.
- Modify the code to output debug messages.
- Inspect unit handling.
- Review header files to understand available solver data.
Open the Visual Studio project and compile
Set the required environment variable, open the Visual Studio project, and compile the sample thermal plugin into a .dll file.
Load the thermal plugin in Simcenter 3D
Load the thermal plugin.
- Open Simcenter 3D.
- Choose .
- Click Simulation, expand Pre/Post, and click Expressions.
- On the Plugin tab, select the Use Custom Plugin check box.
- Type the path to ExpressionsPlugin.dll retrieved from your Visual Studio output.
- Click Ok to exit the dialogue
- Exit Simcenter 3D and restart it to load the connection to the .dll.
Load the sample model and solve
Load the sample model and solve.
Write out messages to better debug the plugin
It is good practice to verify that your thermal plugin is returning the expected values. To assist with this validation, you can print the variables used within the function to confirm they contain reasonable values. This will be demonstrated in the next step.
Re-load the sample model and solve
Check units
Explore header files
Additional notes
- The sample plugin is updated with each thermal solver patch release and is located in the installation directory: THERMALFLOW\tmgsolver\plugin_examples\thermal_solver\ExpressionsVS2019\ExpressionsPlugin.
- If you prefer to compile the plugin using a script rather than Visual Studio, a .cmd file is available in: THERMALFLOW\tmgsolver\plugin_examples\thermal_solver\ExpressionsShell












