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. Individual input valves can be controlled with
setClosed() and checked with
isClosed(). The current mix ratios can be obtained using
getMixFactors() or
getMixFactorsMap().
Properties and Events The
connectAfterStart property defines whether the MixerLight connections are established after the simulation starts. The
inputFlows and
outputFlow properties provide access to the current inlet and outlet flow values. 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.