In petroleum refining simulation, the MixerLight provides several methods for controlling how two
incoming material flows are combined into a single output.
Setting the Mix Ratios The
setMerge() method sets the relative flow values for the first and second inputs. The values do not need to be normalized. When both values are positive, the mixer uses proportional merge mode. The mix can be specified as two individual values or as a two-element array: [firstInput, secondInput].
Other Flow Controls The MixerLight provides direct control of the incoming flows and the resulting mixed stream. The
setSpeedLimit() method limits the maximum outlet flow rate, while
getSpeedLimit() and
resetSpeedLimit() allow the current limit to be read or reset. The
resetState() method removes active flow restrictions and restores the mixer to its default operating state. Output valve can be controlled with
setClosed() and checked with
isClosed(). The current mix ratios can be obtained using
getMixFactors() or
getMixFactorsMap() and getMixRatios(). The
isAllFromFirst() method checks whether the entire input flow is received from the first input, allowing you to determine whether the mixer is currently operating exclusively with the first input stream.
Properties and Events The
connectAfterStart property defines whether the MixerLight connections are established after the simulation starts.The
inputFlows and
outputFlow properties provide references to the Mixer input and output flows, allowing the component to establish connections with external flow nodes. The
onAfterInitialize() event is triggered after the component is initialized, while
onSpeedChange() is triggered when the flow rate changes and provides the new flow rate.