and btw …
- Code: Select all
<capacity unit="LBS"> 0.1 </capacity>
I don't think FG understands the unit attribute ! But ought to have nothing to do with the issue …
<capacity unit="LBS"> 0.1 </capacity>
I don't think the JSBSim devs can do anything about it - there must be some error in the fuel system, but I can't find either …
<consumables>
<fuel>
<tank n="0">
<name>Left Tank</name>
<level-gal_us type="double">0</level-gal_us>
<selected type="bool">false</selected>
<water-contamination type="double">0.0</water-contamination>
<sample-water-contamination type="double">0.0</sample-water-contamination>
<fuel-sample-taken type="bool">false</fuel-sample-taken>
<unusable-gal_us type="double">1.49</unusable-gal_us>
</tank>
<tank n="1">
<name>Right Tank</name>
<level-gal_us type="double">0</level-gal_us>
<selected type="bool">false</selected>
<water-contamination type="double">0.0</water-contamination>
<sample-water-contamination type="double">0.0</sample-water-contamination>
<fuel-sample-taken type="bool">false</fuel-sample-taken>
<unusable-gal_us type="double">1.49</unusable-gal_us>
</tank>
<tank n="2">
<name>Integral Left Tank</name>
<level-gal_us type="double">0</level-gal_us>
<selected type="bool">false</selected>
<unusable-gal_us type="double">1.49</unusable-gal_us>
</tank>
<tank n="3">
<name>Integral Right Tank</name>
<level-gal_us type="double">0</level-gal_us>
<selected type="bool">false</selected>
<unusable-gal_us type="double">1.49</unusable-gal_us>
</tank>
<tank n="4">
<name>Float Chamber</name>
<capacity unit="LBS"> 0.1 </capacity>
<selected type="bool">true</selected>
<hidden type="bool">true</hidden>
</tank>
<contamination_allowed type="bool">false</contamination_allowed>
</fuel>
</consumables>
<!-- ****************************************************** -->
<!-- Collector Tank 4 level-maintenance -->
<!-- ****************************************************** -->
<channel name="To Tank6">
<!-- from Tank 0 (to Collector Tank 4) -->
<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>
<switch name="fuel/from-tank0-to-tank4">
<default value="0"/>
<test logic="AND" value="0.1">
propulsion/tank[0]/priority EQ 1
propulsion/tank[0]/contents-volume-gal GT propulsion/tank[0]/unusable-volume-gal
/consumables/fuel/tank[4]/level-lbs LT 0.05
propulsion/tank[4]/priority EQ 1
accelerations/Nz GE 0
fuel/tank EQ 0
</test>
</switch>
<!-- from Tank 1 (to Collector Tank 4) -->
<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>
<switch name="fuel/from-tank1-to-tank4">
<default value="0"/>
<test logic="AND" value="0.1">
propulsion/tank[1]/priority EQ 1
propulsion/tank[1]/contents-volume-gal GT propulsion/tank[1]/unusable-volume-gal
/consumables/fuel/tank[4]/level-lbs LT 0.05
propulsion/tank[4]/priority EQ 1
accelerations/Nz GE 0
fuel/tank EQ 0
</test>
</switch>
<!-- from Tank 2 (to Collector Tank 4) -->
<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>
<switch name="fuel/from-tank2-to-tank4">
<default value="0"/>
<test logic="AND" value="0.1">
propulsion/tank[2]/priority EQ 1
propulsion/tank[2]/contents-volume-gal GT propulsion/tank[2]/unusable-volume-gal
/consumables/fuel/tank[4]/level-lbs LT 0.05
propulsion/tank[4]/priority EQ 1
accelerations/Nz GE 0
fuel/tank EQ 1
</test>
</switch>
<!-- from Tank 3 (to Collector Tank 4) -->
<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>
<switch name="fuel/from-tank3-to-tank4">
<default value="0"/>
<test logic="AND" value="0.1">
propulsion/tank[3]/priority EQ 1
propulsion/tank[3]/contents-volume-gal GT propulsion/tank[3]/unusable-volume-gal
/consumables/fuel/tank[4]/level-lbs LT 0.05
propulsion/tank[4]/priority EQ 1
accelerations/Nz GE 0
fuel/tank EQ 1
</test>
</switch>
</channel>
<!-- Total from Tank 0 and Tank 1 to Collector Tank 4 -->
<channel name="Total flow rate into tank 4">
<summer name="tank0 and 1 to tank4">
<input>fuel/from-tank0-to-tank4</input>
<input>fuel/from-tank1-to-tank4</input>
<input>fuel/from-tank2-to-tank4</input>
<input>fuel/from-tank3-to-tank4</input>
<output>propulsion/tank[4]/external-flow-rate-pps</output>
</summer>
</channel>
<!-- ****************************************************** -->
<!-- FLOW RATE from each MAIN TANK (consumption) -->
<!-- ****************************************************** -->
<channel name="Total flow rates">
<summer name="fuel/tank0-flow-rate">
<input>-fuel/from-tank0-to-tank4</input>
<output>propulsion/tank[0]/external-flow-rate-pps</output>
</summer>
<summer name="fuel/tank1-flow-rate">
<input>-fuel/from-tank1-to-tank4</input>
<output>propulsion/tank[1]/external-flow-rate-pps</output>
</summer>
<summer name="fuel/tank2-flow-rate">
<input>-fuel/from-tank2-to-tank4</input>
<output>propulsion/tank[2]/external-flow-rate-pps</output>
</summer>
<summer name="fuel/tank3-flow-rate">
<input>-fuel/from-tank3-to-tank4</input>
<output>propulsion/tank[3]/external-flow-rate-pps</output>
</summer>
</channel>
<function>
<quotient>
<p> propulsion/tank[0]/contents-lbs </p>
<p> propulsion/tank[0]/density-lbs_per_gal </p>
</quotient>
</function>
<!-- Tank number 0 -->
<tank type="FUEL">
<location unit="IN">
<x> 48 </x>
<y>-44 </y>
<z> 55 </z>
</location>
<capacity unit="LBS">129.43</capacity>
<contents unit="LBS">0.0 </contents>
<type>AVGAS</type>
</tank>
<!-- Total from Tank 0 and Tank 1 to Collector Tank 4 -->
<channel name="Total flow rate into tank 4">
<summer name="tank0 and 1 to tank4">
<input>fuel/from-tank0-to-tank4</input>
<input>fuel/from-tank1-to-tank4</input>
<input>fuel/from-tank2-to-tank4</input>
<input>fuel/from-tank3-to-tank4</input>
<output>propulsion/tank[4]/external-flow-rate-pps</output>
</summer>
</channel>
double FGTank::Drain(double used)
{
double remaining = Contents - used;
if (remaining >= 0) { // Reduce contents by amount used. //this used to check if remaining is >= GetUnusable()
Contents -= used;
} else { // This tank must be empty.
if (Contents > GetUnusable())
Contents = GetUnusable();
remaining = Contents;
}
PctFull = 100.0*Contents/Capacity;
CalculateInertias();
return remaining;
FGColumnVector3 FGTank::GetXYZ(void) const
{
return vXYZ_drain + (Contents/Capacity)*(vXYZ - vXYZ_drain);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
double FGTank::GetXYZ(int idx) const
{
return vXYZ_drain(idx) + (Contents/Capacity)*(vXYZ(idx)-vXYZ_drain(idx));
}
wlbragg wrote in Fri Oct 28, 2022 10:44 pm:Also by changing only the consumables property unusable-gal_us to 1.49 which is a JSBSim internal as well fixes the entire issue.
but I do believe that the 'tell the user the fuel is gone' check should still test against the 'unusable tank contents' and not just 'zero'.
Users browsing this forum: No registered users and 11 guests