Fluid System Modeling
Simscape Fluid Domains
Simscape™ Foundation library contains several domains for modeling fluid systems. This table provides a summary of fluid domains, to help you select the appropriate domain for your application.
Domain | Working Fluid | Thermodynamic Effects |
---|---|---|
Isothermal Liquid | Liquid, possibly with a small amount of entrained air | No |
Thermal Liquid | Liquid | Yes |
Two-Phase Fluid | Part liquid and part vapor | Yes |
Gas | Gas: perfect, semiperfect, or real (single species) | Yes |
Moist Air | Mixture of dry air, water vapor, water droplets, and trace gas (or of up to three other semiperfect gas species) | Yes |
Specifying the Working Fluid
The rules that you must follow when building a physical model with Simscape software are described in Basic Principles of Modeling Physical Networks. This section briefly reviews the rules that are specific to fluid system modeling.
When modeling systems that contain fluid elements, it is very important to specify the working fluid correctly:
If you have isothermal liquid elements in your model, the working fluid is liquid, possibly with a small amount of entrained air. Attach an Isothermal Liquid Properties (IL) block to each topologically distinct circuit to define the working fluid properties. This block lets you specify whether the liquid bulk modulus is constant or pressure-dependent. You can also specify whether the fluid contains entrained air, and, if present, whether its amount is constant or pressure-dependent. The default working fluid is water, with constant bulk modulus and zero entrained air.
If you have a Simscape Fluids™ license, you can also use the Isothermal Liquid Predefined Properties (IL) block to specify the working fluid in a circuit. This block lets you select from a list of predefined liquids and specify values for various fluid properties, as well as visualize fluid properties in the circuit as a function of pressure.
Similarly, if you have thermal liquid elements in your model, attach a Thermal Liquid Settings (TL) block to each topologically distinct circuit to define the working fluid properties. The block takes as inputs the necessary fluid properties, each specified as a tabulated function of pressure and temperature.
If you have a Simscape Fluids license, you can also use the Thermal Liquid Properties (TL) block to specify the working fluid in a thermal liquid circuit. This block lets you select the name of the fluid from a list that includes water, seawater, and various mixtures with uses in cooling and deicing.
If you have two-phase elements in your model, the working fluid is part liquid and part vapor. Attach a Two-Phase Fluid Properties (2P) block to each topologically distinct circuit to specify the working fluid properties. This block lets you define the properties of liquid and vapor separately, each as a tabulated function of pressure and temperature.
If you have a Simscape Fluids license, you can also use the Two-Phase Fluid Predefined Properties (2P) block to specify the working fluid in a two-phase fluid circuit. This block lets you select the name of the fluid from a list that includes water, ammonia, CO2, and various other fluids at the specified ranges of pressure and temperature.
If you have gas elements in your model, default gas properties are for dry air. Attach a Gas Properties (G) block to each topologically distinct circuit to change gas properties.
If you have moist air elements in your model, default properties correspond to dry air, water vapor, and carbon dioxide (the optional trace gas). Attach a Moist Air Properties (MA) block to each topologically distinct circuit to change the air mixture properties.
If you omit the fluid properties block in a circuit, the working fluid in that circuit assumes the domain default properties. The default fluid properties for each domain correspond to the default parameter values of the fluid properties block in the respective Foundation library.
Specifying the Cross-Sectional Area at Ports
Many blocks in the gas, moist air, thermal liquid, and two-phase fluid domains let you specify the cross-sectional area at the inlet and outlet ports as a block parameter. It is recommended that you specify the same cross-sectional area for ports that are connected together. For example, if you have port A of a Constant Volume Chamber (G) block connected to a Pipe (G) block, set the Cross-sectional area at port A parameter of the Constant Volume Chamber (G) block to the same value as the Cross-sectional area parameter of the Pipe (G) block.
In practice, the cross-sectional areas do not have to match exactly, but they should not differ significantly. This rule is especially important for the blocks in the gas, moist air, and two-phase fluid domains because of the effect of the fluid velocity on temperature. Total enthalpy is convected from one component to the other, so if the areas are mismatched, then the velocities are different, and the changes in kinetic energy manifest as changes in temperature. If the flow rate is not too large, that is, if Mach number is not close to 1, then some differences in the port areas do not have a noticeable effect. However, for high-speed flows, differences in the port areas can result in unexpected temperature differences.