Understanding Class Base.Source
This component supplies chemical mixture of constant concentration. It has unlimited supply to the connected output pipe.
A source can be connected with exactly one output pipe.
Initial Concentration (fConcentration): is the concentration entered by the user before a simulation run. Because this class provides constant concentration through time, the value remains constant throughout the simulation.
Initialization (SG_xInit): simply registers the class type for later identification.
Pre-Evaluation (SG_xPreEval): deposits the Concentration to the output pipe.
This class is derived from Class Base.Source. It supplies chemical mixture with a variable concentration according to a transient function.
Similar to Class Base.Source, it can be connected with exactly one output pipe. The user need to supply the Initial Concentration and the Steady State Concentration at which the concentration will level off. The transient function implements a simple (exponential) lag for a first-order step response.
Initial Concentration (fConcentration): is the concentration entered by the user for the starting condition in the transient function. This attribute is inherited from the superclass Base.Source above but the meaning of it is slightly modified.
Steady State Concentration (fSteady): forms an asymptote for the transient function. The simulator implements a simple (exponential) lag for the first-order step response.
Current Concentration (fCurrent): is an output only attribute to record the calculated concentration from each time step. The time step is governed by the Mixer cycle simulation control object.
Initialization (SG_xInit): simply calls the base class (Base.Source) initialization function for its default behavior.
Pre-Evaluation (SG_xPreEval): calculates the concentration at a simulated time (Current Time) obtained from the simulation control class. The transient function to calculate the concentration C with Initial Concentration I, Steady State Concentration S, and simulated time t is as following:
The time constant here is hard-wired with the value set to 1 minute. You may want to change the code to make it an input attribute to be set by the user.
Mixer Example for SansGUI Version 1.0
Copyright © 2001-2003 ProtoDesign, Inc. All rights reserved.