<?xml version="1.0"?>
<system name="BN-2 Fuel System">
    <!--    ref. FM, Section 4, Page 21 -->
    <channel name="Fuel Pumps">
        <switch name="systems/fuel/engine-driven-pump[0]">
            <default value="0" />
            <test value="1">
                propulsion/engine[0]/set-running EQ 1
            </test>
        </switch>
        <switch name="systems/fuel/engine-driven-pump[1]">
            <default value="0" />
            <test value="1">
                propulsion/engine[1]/set-running EQ 1
            </test>
        </switch>
        <switch name="systems/fuel/auxiliary-pump[0]">
            <default value="0" />
            <test value="1" logic="OR">
                /systems/electrical/outputs/aux-fuel-pump[0] ge 10
                /systems/electrical/outputs/aux-fuel-pump[2] ge 10
            </test>
        </switch>
        <switch name="systems/fuel/auxiliary-pump[1]">
            <default value="0" />
            <test value="1" logic="OR">
                /systems/electrical/outputs/aux-fuel-pump[1] ge 10
                /systems/electrical/outputs/aux-fuel-pump[3] ge 10
            </test>
        </switch>
    </channel>
    <channel name="Calculations">
		<fcs_function name="propulsion/tank[0]/contents-volume-gal">
			<function>
				<quotient>
					<p> propulsion/tank[0]/contents-lbs </p>
					<p> propulsion/tank[0]/density-lbs_per_gal </p>
				</quotient>
			</function>
		</fcs_function>
		<fcs_function name="propulsion/tank[1]/contents-volume-gal">
			<function>
				<quotient>
					<p> propulsion/tank[1]/contents-lbs </p>
					<p> propulsion/tank[1]/density-lbs_per_gal </p>
				</quotient>
			</function>
		</fcs_function>
		<fcs_function name="propulsion/tank[2]/contents-volume-gal">
			<function>
				<quotient>
					<p> propulsion/tank[2]/contents-lbs </p>
					<p> propulsion/tank[2]/density-lbs_per_gal </p>
				</quotient>
			</function>
		</fcs_function>
		<fcs_function name="propulsion/tank[3]/contents-volume-gal">
			<function>
				<quotient>
					<p> propulsion/tank[3]/contents-lbs </p>
					<p> propulsion/tank[3]/density-lbs_per_gal </p>
				</quotient>
			</function>
		</fcs_function>
    </channel>
    <channel name="LH Tank Fuel Flow">
		<switch name="systems/fuel/lh-pump">
			<default value="0"/>
			<test logic="OR" value="1">
                systems/fuel/engine-driven-pump[0] EQ 1
                systems/fuel/auxiliary-pump[0] EQ 1
			</test>
		</switch>
		<switch name="systems/fuel/flow-0-to-2">
			<default value="0"/>
			<test logic="AND" value="0.2">
				propulsion/tank[0]/contents-volume-gal GT propulsion/tank[0]/unusable-volume-gal
				propulsion/tank[2]/contents-volume-gal LT 0.0008
                systems/fuel/lh-pump EQ 1
                /controls/fuel/fuel-cock[0] EQ 1
			</test>
		</switch>
		<switch name="systems/fuel/flow-0-to-3">
			<default value="0"/>
			<test logic="AND" value="0.2">
				propulsion/tank[0]/contents-volume-gal GT propulsion/tank[0]/unusable-volume-gal
				propulsion/tank[3]/contents-volume-gal LT 0.0008
                systems/fuel/lh-pump EQ 1
                /controls/fuel/fuel-cock[1] EQ 2
			</test>
		</switch>
    </channel>
    <channel name="RH Tank Fuel Flow">
		<switch name="systems/fuel/rh-pump">
			<default value="0"/>
			<test logic="OR" value="1">
                systems/fuel/engine-driven-pump[1] EQ 1
                systems/fuel/auxiliary-pump[1] EQ 1
			</test>
		</switch>
		<switch name="systems/fuel/flow-1-to-3">
			<default value="0"/>
			<test logic="AND" value="0.2">
				propulsion/tank[1]/contents-volume-gal GT propulsion/tank[1]/unusable-volume-gal
				propulsion/tank[3]/contents-volume-gal LT 0.0008
                systems/fuel/rh-pump EQ 1
                /controls/fuel/fuel-cock[1] EQ 1
			</test>
		</switch>
		<switch name="systems/fuel/flow-1-to-2">
			<default value="0"/>
			<test logic="AND" value="0.2">
				propulsion/tank[1]/contents-volume-gal GT propulsion/tank[1]/unusable-volume-gal
				propulsion/tank[2]/contents-volume-gal LT 0.0008
                systems/fuel/rh-pump EQ 1
                /controls/fuel/fuel-cock[0] EQ 2
			</test>
		</switch>
    </channel>
	<channel name="Flow Rates">
		<summer>
			<input>-systems/fuel/flow-0-to-2</input>
			<output>propulsion/tank[0]/external-flow-rate-pps</output>
		</summer>
		<summer>
			<input>-systems/fuel/flow-1-to-3</input>
			<output>propulsion/tank[1]/external-flow-rate-pps</output>
		</summer>
		<summer>
			<input>systems/fuel/flow-0-to-2</input>
			<output>propulsion/tank[2]/external-flow-rate-pps</output>
		</summer>
		<summer>
			<input>systems/fuel/flow-1-to-3</input>
			<output>propulsion/tank[3]/external-flow-rate-pps</output>
		</summer>
	</channel>

</system>
