Main Content

Modeling Thermal Liquid Systems

When to Use Thermal Liquid Blocks

The thermal behavior of liquid systems is of interest in many engineering applications. Liquids can store energy and release it back to their surroundings, often doing work in the process. Oil flow through an underground pipeline and hydraulic fluid flow in an aircraft actuator are two examples.

When temperature fluctuations are negligible, liquids behave as isothermal fluids, which simplifies the modeling process. However, when detailed thermal analysis is a goal, or when temperature fluctuations are significant, this assumption is no longer suitable.

To decide whether Thermal Liquid blocks fit your modeling needs, consider the fluid system you are trying to represent. Other Simscape™ blocks, such as Isothermal Liquid or Two-Phase Fluid, may better suit your application. Assess the following:

  • Number of phases

    Is the fluid medium single phase or multiphase?

  • Relevant phases

    Is the fluid medium a gas, a liquid, or a multiphase mixture?

  • Thermal effects

    Does temperature change significantly in the time scale of the simulation? Are thermal effects important for analysis? Are the temperature dependences of the liquid properties important?

As a rule, use Thermal Liquid blocks for fluid systems in which a single-phase liquid experiences significant temperature changes.

Modeling Workflow

The suggested workflow for Thermal Liquid models includes four steps:

  1. Establish model requirements — Define the purpose and scope of the model. Then, identify the relevant components and interactions in the model. Use this information as a guide when building the model.

  2. Model physical components — Determine the appropriate blocks for modeling the relevant components and interactions. Then, add the blocks to the model canvas and connect them according to the Simscape connection rules. Specify the block parameters.

  3. Prepare model for analysis — Add sensors to the model. Alternatively, configure the model for Simscape data logging. Check the physical units of each sensed variable.

  4. Run simulation — Configure the solver settings. Then, run the simulation. If necessary, refine the model until you achieve the desired fidelity level.

Establish Model Requirements

The foundation of a good model is a clear understanding of its purpose and requirements. What are you trying to accomplish with the model? What are the relevant components, processes, and states? Determine what is essential and what is not. Start simple, using a rough approximation of the physical system as a guide. Then, iteratively add detail to reach the appropriate model fidelity for your application.

An insulated oil pipeline buried underground provides an example. As oil flows through the pipeline, it experiences conductive heat losses due to the cooler pipeline surroundings. Heat flows across three material layers—pipe wall, insulant, and soil—causing oil temperature to drop. However, only conduction across soil and insulant layers matter. A typical pipe wall is thin and conductive, and its effect on conductive heat loss is minimal at best. Omitting this process simplifies the model and speeds up simulation.

You also must determine the dimensions and properties of each component. During modeling, you specify these parameters in the Simscape blocks for the components. Obtain the physical properties of the liquid medium. Manufacturer data sheets typically provide this data. You can also use analytical expressions to define the physical property lookup tables.

When modeling pipes, consider the impact that dynamic compressibility and flow inertia have on the transient system behavior. If the time scale of an effect exceeds the simulation run time, the impact is usually negligible. During modeling, turn off negligible effects to improve simulation speed. Characteristic time scales for dynamic compressibility and flow inertia are approximately L/c and L/v, respectively, where:

  • L is the length of the pipe.

  • v is the mean flow velocity through the pipe.

  • c is the speed of sound in the liquid medium.

If you are unsure whether an effect is relevant to your model, simulate the model with and without that effect. Then, compare the two simulation results. If the difference is substantial, leave that effect in place. The result is greater model fidelity at small time scales, e.g., during transients associated with flow reversal in a pipe.

Model Physical Components

Start by adding a Thermal Liquid Settings (TL) block to the model canvas. Use this block to provide the physical properties of the liquid medium. Double-click the block and enter the physical property lookup tables that you acquired during the planning stage.

Identify the appropriate blocks for representing the physical components and their interactions. Components can be simple, requiring a single block, or complex, requiring multiple blocks, typically within a Simulink® Subsystem block. Add the blocks to the model canvas and connect them according to the Simscape connection rules.

The Hydraulic Fluid Warming Due to Losses example shows simple and complex components. The Flow Rate Source (TL) represents an ideal power source. It is a simple component. The Double-Acting Cylinder subsystem block represents the mechanical part of a hydraulic actuator. It contains two Translational Mechanical Converter (TL) blocks and is a complex component.

Once you have connected the blocks, specify the relevant parameters. These include dimensions, physical states, empirical correlation coefficients, and initial conditions. In Pipe (TL), Rotational Mechanical Converter (TL), and Translational Mechanical Converter (TL) blocks, select the appropriate setting for effects such as dynamic compressibility and flow inertia.


For accurate simulation results, always replace the default parameter values with data appropriate for your model.

Prepare Model for Analysis

To analyze a model, you must set up that model for data collection. The simplest approach is to add sensor blocks to the model. The Thermal Liquid library provides two sensor block types: one for Through variables (mass and energy flow rates), the other for Across variables (pressure and temperature). By using the PS-Simulink Converter block, you can specify the physical units of the sensed variable.

An alternative approach is to use Simscape data logging. This approach, which uses MATLAB® commands instead of blocks, provides access to a broader range of model variables and parameters. One example is the kinematic viscosity of the liquid medium inside a pipeline segment. You can analyze this parameter using Simscape data logging but not sensor blocks.

For an overview of Simscape data logging, see About Simscape Data Logging. For an example of how to plot logged data, see Log and Plot Simulation Data.

Run Simulation

The final step in the modeling workflow is to simulate the model. Before running simulation, check that the numerical solver is appropriate for your model. To do this, use the Configuration Parameters dialog box.

For physical models, variable-step solvers such as daessc, ode23t, and ode15s typically perform best. Reduce step sizes and tolerances for greater simulation accuracy. Increase them instead for faster simulation.

Run the simulation. Plot simulation data from sensors and Simscape data logging, or process it for further analysis. If necessary, refine the model. For example, correct simulation issues or to improve model fidelity.

Representing Thermal Liquid Components

Thermal liquid systems can range in complexity from basic to highly specialized. To model a basic system, simple components often suffice. These are components such as chambers, pipes, pumps, and the liquid medium itself. Simple components are often industry independent and can be modeled using a single Thermal Liquid block. For example, you can model a pipeline segment using a single Pipe (TL) block.

To model a specialized system, generally you use custom components. These are components that you cannot represent by a single Thermal Liquid block. The five-way directional control valve in the Hydraulic Fluid Warming Due to Losses example is one such component. Custom components are often industry specific and must be modeled by grouping Thermal Liquid blocks into more complex subsystems.

Specifying Thermal Liquid Medium

The Thermal Liquid Settings (TL) block specifies the thermodynamic properties of the liquid medium. These properties are assumed functions of both pressure and temperature. This assumption boosts model fidelity, especially in models in which pressure, temperature, or both, vary widely.

The block accepts two-way lookup tables as input. These tables provide the different thermodynamic property values at discrete pressures and temperatures. You can populate these tables using empirical data from product data sheets or values calculated from analytical expressions.

Modeling Multidomain Systems

Thermal Liquid blocks can contain different types of conserving ports. These ports include not only Thermal Liquid conserving ports but also thermal and mechanical conserving ports. By using these ports, you can interface a Thermal Liquid subsystem with thermal and mechanical subsystems.

For instance, you can use the thermal conserving port of a Pipe (TL) block to model conductive heat transfer through a pipe wall. Oil pipeline modeling is one application. The Optimal Pipeline Geometry for Heated Oil Transportation example shows this approach.

Similarly, you can use the translational mechanical conserving ports of a Translational Mechanical Converter (TL) block to convert hydraulic pressure in a thermal liquid system into a mechanical actuation force. Hydraulic actuator modeling is one application. The Hydraulic Fluid Warming Due to Losses example shows this approach.

The table lists the Thermal Liquid blocks that have thermal or mechanical conserving ports. You can use these blocks to create a multidomain model containing thermal liquid, thermal, and mechanical subsystems.

Thermal Liquid BlockThermal Conserving PortMechanical Conserving Port
Constant Volume Chamber (TL)
Pipe (TL)
Rotational Mechanical Converter (TL)
Translational Mechanical Converter (TL)

Related Examples

More About