Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cond): a380 temperature control and ventilation #8086

Merged
merged 29 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2423175
feat: trim air drive device and tcs application
mjuhe Apr 11, 2023
a0ab05c
feat: connect tadd and cpiom to air cond system
mjuhe Apr 15, 2023
9fbb688
feat: improve local controller channels
mjuhe Apr 16, 2023
902ee12
feat: use a380 volume for the cabin zones
mjuhe Apr 28, 2023
5fb00fd
feat: ventilation control module
mjuhe May 7, 2023
49732d3
feat: cpiom b ventilation control system app
mjuhe May 14, 2023
66dc6a2
feat: cargo bulk ventilation
mjuhe May 25, 2023
a290765
feat: forward cargo temperature control and tests
mjuhe Jun 11, 2023
8fee63b
style: small refactor and style improvements
mjuhe Jun 18, 2023
1492f85
refactor: variable trim air system volume
mjuhe Jun 18, 2023
5f9fb55
feat: system outputs
mjuhe Jun 24, 2023
132fda3
fix: power source for HP fans
mjuhe Jun 24, 2023
1c35eef
fix: wrong vcm updating aft fans
mjuhe Jun 24, 2023
5e0d4aa
Merge remote-tracking branch 'upstream/master' into air-cond-a380-tem…
mjuhe Jun 24, 2023
c000d3a
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Jun 29, 2023
3d053a0
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Jul 11, 2023
78c0ffa
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Jul 21, 2023
25b6485
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Aug 27, 2023
63d2fb7
Merge remote-tracking branch 'upstream/master' into air-cond-a380-tem…
mjuhe Sep 29, 2023
3e7c4c1
fix: merge conflicts
mjuhe Sep 29, 2023
f749cdd
fix: review comments
mjuhe Sep 30, 2023
ba497c4
refactor: small final style updates
mjuhe Sep 30, 2023
d1a1561
refactor: move local controllers to aircraft crate
mjuhe Oct 1, 2023
fb8dcb4
fix: second round of comments
mjuhe Oct 3, 2023
75f70e0
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Oct 8, 2023
c4a8f52
style: add comment to clarify duct_demand_temperature fn
mjuhe Oct 13, 2023
73c2b29
Merge branch 'master' into air-cond-a380-temperature-control
mjuhe Oct 13, 2023
8b5a5cb
fix: comment typo
mjuhe Oct 14, 2023
ba86b3a
Merge remote-tracking branch 'upstream/master' into air-cond-a380-tem…
mjuhe Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 38 additions & 14 deletions fbw-a32nx/src/wasm/systems/a320_systems/src/air_conditioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use systems::{
AdirsToAirCondInterface, Air, AirConditioningOverheadShared, AirConditioningPack, CabinFan,
Channel, DuctTemperature, MixerUnit, OutflowValveSignal, OutletAir, OverheadFlowSelector,
PackFlowControllers, PressurizationConstants, PressurizationOverheadShared, TrimAirSystem,
ZoneType,
VcmShared, ZoneType,
},
overhead::{
AutoManFaultPushButton, NormalOnPushButton, OnOffFaultPushButton, OnOffPushButton,
Expand All @@ -33,7 +33,7 @@ use systems::{
use std::time::Duration;
use uom::si::{
f64::*, pressure::hectopascal, ratio::percent, thermodynamic_temperature::degree_celsius,
velocity::knot,
velocity::knot, volume::cubic_meter, volume_rate::liter_per_second,
};

use crate::payload::A320Pax;
Expand Down Expand Up @@ -177,7 +177,7 @@ impl A320Cabin {
fn update(
&mut self,
context: &UpdateContext,
air_conditioning_system: &(impl OutletAir + DuctTemperature),
air_conditioning_system: &(impl OutletAir + DuctTemperature + VcmShared),
lgciu: [&impl LgciuWeightOnWheels; 2],
number_of_passengers: &impl NumberOfPassengers,
pressurization: &A320PressurizationSystem,
Expand Down Expand Up @@ -252,6 +252,8 @@ pub struct A320AirConditioningSystem {
}

impl A320AirConditioningSystem {
const CAB_FAN_DESIGN_FLOW_RATE_L_S: f64 = 325.; // litres/sec

pub(crate) fn new(context: &mut InitContext, cabin_zones: &[ZoneType; 3]) -> Self {
Self {
acs_interface: [
Expand Down Expand Up @@ -299,15 +301,29 @@ impl A320AirConditioningSystem {
),
],
cabin_fans: [
CabinFan::new(1, ElectricalBusType::AlternatingCurrent(1)),
CabinFan::new(2, ElectricalBusType::AlternatingCurrent(2)),
CabinFan::new(
1,
VolumeRate::new::<liter_per_second>(Self::CAB_FAN_DESIGN_FLOW_RATE_L_S),
ElectricalBusType::AlternatingCurrent(1),
),
CabinFan::new(
2,
VolumeRate::new::<liter_per_second>(Self::CAB_FAN_DESIGN_FLOW_RATE_L_S),
ElectricalBusType::AlternatingCurrent(2),
),
],
mixer_unit: MixerUnit::new(cabin_zones),
packs: [
AirConditioningPack::new(Pack(1)),
AirConditioningPack::new(Pack(2)),
AirConditioningPack::new(context, Pack(1)),
AirConditioningPack::new(context, Pack(2)),
],
trim_air_system: TrimAirSystem::new(context, cabin_zones, &[1]),
trim_air_system: TrimAirSystem::new(
context,
cabin_zones,
&[1],
Volume::new::<cubic_meter>(4.),
Volume::new::<cubic_meter>(0.03),
),

air_conditioning_overhead: A320AirConditioningSystemOverhead::new(context, cabin_zones),
}
Expand Down Expand Up @@ -424,9 +440,9 @@ impl A320AirConditioningSystem {
self.trim_air_system.update(
context,
&self.mixer_unit,
&[
&self.acsc[0].trim_air_pressure_regulating_valve_controller(),
&self.acsc[1].trim_air_pressure_regulating_valve_controller(),
[
self.acsc[0].trim_air_pressure_regulating_valve_controller(),
self.acsc[1].trim_air_pressure_regulating_valve_controller(),
],
&[&self.acsc[0], &self.acsc[1], &self.acsc[1]],
);
Expand Down Expand Up @@ -481,15 +497,21 @@ impl OutletAir for A320AirConditioningSystem {
outlet_air.set_temperature(self.duct_temperature().iter().average());

outlet_air

// TODO: This should use self.trim_air_system.outlet_air()
}
}

// This is not used in the A320
impl VcmShared for A320AirConditioningSystem {}

impl SimulationElement for A320AirConditioningSystem {
fn accept<V: SimulationElementVisitor>(&mut self, visitor: &mut V) {
accept_iterable!(self.acs_interface, visitor);
accept_iterable!(self.acsc, visitor);
self.trim_air_system.accept(visitor);
accept_iterable!(self.cabin_fans, visitor);
accept_iterable!(self.packs, visitor);

self.air_conditioning_overhead.accept(visitor);

Expand Down Expand Up @@ -550,7 +572,7 @@ impl AirConditioningSystemInterfaceUnit {
self.discrete_word_1.set_bit(21, acsc.channel_1_inop());
self.discrete_word_1.set_bit(22, acsc.channel_2_inop());
self.discrete_word_1
.set_bit(23, acs_overhead.hot_air_pushbutton_is_on());
.set_bit(23, acs_overhead.hot_air_pushbutton_is_on(1));
self.discrete_word_1.set_bit(24, acsc.galley_fan_fault());
self.discrete_word_1.set_bit(25, cabin_fans[0].has_fault());
self.discrete_word_1.set_bit(26, cabin_fans[1].has_fault());
Expand Down Expand Up @@ -637,7 +659,7 @@ impl<const ZONES: usize> AirConditioningOverheadShared
self.pack_pbs.iter().map(|pack| pack.is_on()).collect()
}

fn hot_air_pushbutton_is_on(&self) -> bool {
fn hot_air_pushbutton_is_on(&self, _hot_air_id: usize) -> bool {
self.hot_air_pb.is_on()
}

Expand Down Expand Up @@ -828,8 +850,10 @@ struct A320PressurizationConstants;

impl PressurizationConstants for A320PressurizationConstants {
// Volume data from A320 AIRCRAFT CHARACTERISTICS - AIRPORT AND MAINTENANCE PLANNING
const CABIN_VOLUME_CUBIC_METER: f64 = 139.; // m3
const CABIN_ZONE_VOLUME_CUBIC_METER: f64 = 139.; // m3
const COCKPIT_VOLUME_CUBIC_METER: f64 = 9.; // m3
const FWD_CARGO_ZONE_VOLUME_CUBIC_METER: f64 = 0.; // m3 Not used in A320
const BULK_CARGO_ZONE_VOLUME_CUBIC_METER: f64 = 0.; // m3 Not used in A320
const PRESSURIZED_FUSELAGE_VOLUME_CUBIC_METER: f64 = 330.; // m3
const CABIN_LEAKAGE_AREA: f64 = 0.0003; // m2
const OUTFLOW_VALVE_SIZE: f64 = 0.05; // m2
Expand Down
53 changes: 53 additions & 0 deletions fbw-a380x/docs/a380-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,72 @@
- UPPER_DECK_5
- UPPER_DECK_6
- UPPER_DECK_7
- CARGO_FWD
- CARGO_BULK

- A32NX_COND_{id}_DUCT_TEMP
- Degree Celsius
- Temperature of trim air coming out of the ducts in the cabin and cockpit
- {id}
- Same as A32NX_COND_{id}_TEMP

- A32NX_COND_PACK_{id}_IS_OPERATING
- Bool
- True when the pack operates normally (at least one FCV is open)
- {id} 1 or 2

- A32NX_COND_PACK_{id}_OUTLET_TEMPERATURE
- Degree Celsius
- Outlet temperature of the packs
- {id} 1 or 2

- A32NX_COND_{id}_TRIM_AIR_VALVE_POSITION
- Percentage
- Percentage opening of each trim air valve (hot air)
- {id}
- Same as A32NX_COND_{id}_TEMP

- A32NX_COND_HOT_AIR_VALVE_{id}_IS_ENABLED
- Bool
- True if the hot air valve {1 or 2} is enabled

- A32NX_COND_HOT_AIR_VALVE_{id}_IS_OPEN
- Bool
- True if the hot air valve {1 or 2} is open

- A32NX_COND_TADD_CHANNEL_FAILURE
- Number
- 0 if no failure
- 1 or 2 if single channel failure (for failed channel id)
- 3 if dual channel failure

- A32NX_VENT_PRIMARY_FANS_ENABLED
- Bool
- True if the primary (high pressure) fans are enabled and operating normally

- A32NX_VENT_{id}_EXTRACTION_FAN_ON
- Bool
- True when the the extraction fans of the fwd/bulk cargo compartment operate normally
- {id}
- FWD
- BULK

- A32NX_VENT_{id}_ISOLATION_VALVE_OPEN
- Bool
- True when the isolation valves of the fwd/bulk cargo compartment are open
- {id}
- FWD
- BULK

- A32NX_VENT_{id}_VCM_CHANNEL_FAILURE
- Number
- 0 if no failure
- 1 or 2 if single channel failure (for failed channel id)
- 3 if dual channel failure
- {id}
- FWD
- AFT

- A32NX_OVHD_COND_{id}_SELECTOR_KNOB
- Number (0 to 300)
- Rotation amount of the overhead temperature selectors for the cockpit and the cabin
Expand Down
Loading
Loading