<?xml version="1.0"?>

<!-- Information according to Flight Manual:
	
	release time wings: 3.5min (210secs) for 92l (one tank)
		-> 0.4381l per second
			0.4381 l water = 0.96585 lbs
	capacity wings:	92l per tank (two wing tanks)
	
	release time tail: 2min (120secs) for 11l (one tank)
		-> 0.09167l per second
			0.09167 l water (kg) = 0.202098 lbs
		capacity tail:		11l (one tail tank)
-->
<system name="Arcus: Water Ballast System">
	
	<channel name="Water Ballast Outflow Rate">
		
		
		<pure_gain>
			<input>/controls/water-ballast/outflow-valve</input>
			<gain>0.96585</gain>	<!-- 92 kg per 3.5 min to pounds per second -->
			<output>systems/water-ballast/wing-cmd-outflow-rate-pps</output>
		</pure_gain>
		
		<switch>
			<default value="0"/>
			<test value="systems/water-ballast/wing-cmd-outflow-rate-pps">
				inertia/pointmass-weight-lbs[2] gt 0.0
			</test>
			<output>systems/water-ballast/wing-outflow-rate-pps[0]</output>
		</switch>
		<switch>
			<default value="0"/>
			<test value="systems/water-ballast/wing-cmd-outflow-rate-pps">
				inertia/pointmass-weight-lbs[3] gt 0.0
			</test>
			<output>systems/water-ballast/wing-outflow-rate-pps[1]</output>
		</switch>
		
		<pure_gain>
			<input>/controls/water-ballast/outflow-valve</input>
			<gain>0.202098</gain>	<!--  11 kg per 2 min to pounds per second -->
			<output>systems/water-ballast/tail-outflow-cmd-rate-pps</output>
		</pure_gain>
		<switch>
			<default value="0"/>
			<test value="systems/water-ballast/tail-outflow-cmd-rate-pps">
				inertia/pointmass-weight-lbs[4] gt 0.0
			</test>
			<output>systems/water-ballast/tail-outflow-rate-pps</output>
		</switch>
	
	</channel>
	
	<channel name="Unit conversion for Wingflexer">
		
		<pure_gain>
			<input>inertia/pointmass-weight-lbs[2]</input>
			<gain>0.45359237</gain>	<!-- lbs to kg -->
			<output>systems/wingflexer/fuel-kg[0]</output>
		</pure_gain>
		<pure_gain>
			<input>inertia/pointmass-weight-lbs[3]</input>
			<gain>0.45359237</gain>	<!-- lbs to kg -->
			<output>systems/wingflexer/fuel-kg[1]</output>
		</pure_gain>
		
	</channel>
</system>
