Running the Examples


Before you delve into the Schema Definition and the source code of the Mixer simulator, we suggest you run the three Project Models that we prepared to gain more insights from a simulation user's perspective. The three Project Models involve a simple mixer network, a solution to the Great Lakes problem from Chapra and Canale [Cha98], and a more complex mixer network with subassemblies.

We assume that you have the general knowledge about the SansGUI software and have gone through A Tour of SansGUI Examples in the SansGUI Getting Started guide.

Notes for MATLAB Users

The default simulator DLL in the sim directory was not built with the MATLAB libraries. If you have the MATLAB software installed, you can use the MATLAB engine in the simulator. You need to specify the Mixer Simulator DLL that is built with the MATLAB libraries:

 

Mixer Simulator DLL with MATLAB Engine

Language IDE

Mixer_1_0\Release_MATLAB\Mixer_1_0.DLL

MSVC++ Implementation

Mixer_1_0\Trace_MATLAB\Mixer_1_0.DLL

MSVC++ Implementation

Mixer_1_0F\Release_MATLAB\Mixer_1_0F.DLL

CVF Implementation

Mixer_1_0F\Debug_MATLAB\Mixer_1_0F.DLL

CVF Implementation

 

Alternatively, you can copy any of the above DLLs over the Mix_1_0.DLL file under the sim subdirectory. This effectively installs the simulator with the MATLAB calling capability as default. The Simulator Program Path of each Project Model can then be left blank.

Project Model: Transient

In this model, we configured three chemical mixers in a small network. The first mixer takes a constant input source and the second mixer takes a variable input source with a transient function. Both of them dispense their output to a third mixer, which then sends its output to a sink. An interesting experiment in this Project Model is related to a pipe that connects the first two mixers. In the first scenario, we simply shut the fluid flow off by having the flow rate 0. We then allow the mixture to be dispensed from the second mixer to the first by setting the flow rate to 2 in the second scenario.

Examining the Model

Running Simulation

Exercises for Simulation Users

Exercises for Simulation Developers

The following exercises are reflect some of the more advanced ideas for simulation developers. You are encouraged to browse through them for the first time and come back here once you are familiar with the entire Mixer Example.

Project Model: Lakes

This example solves the problem of concentrations of chloride in the Great Lakes, taken from Problem 12.7 of Chapra and Canale's text [Cha98]. To model the direct input to each of the lakes, we use a constant source with the Flow Rate in its connecting pipe set to 1. Because the measuring units are not given, we assume that multiplying the concentration in the constant source and the unit flow rate (1) will yield the direct input. There is also no balancing between input flow rates and output flow rates; therefore, the balance checking mechanism you implemented in the above exercise will have to be turned off. This example does not involve transient conditions. Only one cycle is needed to calculate the results.

Examining the Model

Running Simulation

Project Model: Plant

One of the advantages of the SansGUI Modeling and Simulation Environment is that it can handle subassembly replication. In this example, we demonstrate a more complex model with three similar subassemblies: Cluster-1, Cluster-2, and Cluster-3. When we built the model, Cluster-1 was created first with three ports exported for connections at its parent assembly. Cluster-2 and Cluster-3 are copies of Cluster-1. They are created by the Clone Part menu selection from the Cluster-1's right-click context menu. The exported ports are uniquely numbered by the inner part number (1, 3 and 4) so that the pipe connections can be clearly identified.

Examining the Model

Running Simulation

Before you start another simulation run, make sure that 1) you have reset the Current Time attribute to 0 located in SimControl.Cycle.Mixer_Default object under the Object tab and 2) select Edit>Clear Override Values from the pull-down menu. With these two operations, the residual values from the previous simulation run will not affect the results in the next run. In certain situations, however, resetting of the simulated time many not be desirable for each simulation run; therefore, we leave it as an option for the users.

 



Welcome to the Mixer Example Introduction An Overview of Mixer Classes

Mixer Example for SansGUI Version 1.0

Copyright 2001-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com