Main Content

Change Flow Boundary Conditions

In the Simple Gas Model tutorial, you created a simple open-loop gas model. This example shows how to modify this model by changing the gas flow boundary conditions without affecting temperature. To open the completed model, in the MATLAB® Command Window, type ssc_gas_tutorial_step2.

To change the upstream boundary conditions from specified pressure and temperature to specified mass flow rate and temperature:

  1. Open the model created in the Simple Gas Model tutorial, by typing ssc_gas_tutorial_step1.

  2. Change the Upstream Reservoir block back to Atmospheric pressure, but keep the temperature of 400 K.

  3. Add a Flow Rate Source (G) block upstream from the local restriction. Set the Source type parameter to Constant and Mass flow rate to 0.15 kg/s.

  4. Simulate the model. The mass flow rate through the restriction is now 0.15 kg/s.

  5. To measure the absolute pressure and temperature upstream of the local restriction, add a Pressure & Temperature Sensor (G) block and connect an Absolute Reference (G) block to the B node of the sensor. Duplicate the converter-scope block pair to add the Pressure and Temperature scopes to the model, as shown in the diagram.

  6. Simulate the model. To drive 0.15 kg/s of gas through the restriction, the Mass Flow Rate Source (G) block increased the pressure from atmospheric (as specified by the Upstream Reservoir block) to almost 0.13 MPa.

    The temperature upstream of the restriction is approximately 427 K, not 400 K (as specified by the Upstream Reservoir block).

  7. The reason for the temperature increase is that the source needs to do work, to bring the pressure up and drive the desired flow rate through the system, which adds energy to the gas. This way, the source can be treated as an idealized compressor or pump. However, our intent is just to specify an upstream boundary condition of 400 K and 0.15 kg/s, regardless of whether there is actually a compressor upstream or not. Therefore, in the Mass Flow Rate Source (G) block dialog, switch the Power added parameter to None.

  8. Simulate the model. The temperature upstream of the restriction is now 400 K.

Related Examples

More About