NatLabRockies / NatLabRockies/fastsim
Refactor `alt_eff` to be a FuelConverter/ReversibleEnergyStorage level aux load efficiency penalty
@kylecarow is already working on this.
Since Jul 15, 2026.
- Dominant language
- Rust
- Stars
- 60
- Forks
- 19
- Avg merge
- 10d 2h
- Merged PRs (30d)
- 2
Description
Necessary for #270 Not necessary, but useful
Auxiliary Load Efficiency Refactoring Architecture
Problem with current state
-
In BEV, HEV, PHEV:
- We do not account for electrical-electrical conversion (DC:DC) losses from the RES to aux power
-
In HEV:
- We do not account for mechanical-electrical conversion (alternator) losses from the FC to aux power
FuelConverterhasalt_effthat accounts for this
- We do not account for mechanical-electrical conversion (alternator) losses from the FC to aux power
-
For FCEVs (modeled as a powertrain type around
HybridElectricVehicle): there should be no alternator, so how should this be accounted for? -
Potential solutions, but not ideal:Add alt_eff toHybridElectricVehicle(as in #272)Does not apply when we get to modeling FCEVs, FCEVs have no alternator
Introduce a single vehicle-level fieldcan't distinguish between mechanical (FC) vs electrical (RES) conversion losses
Introduce multiple vehicle-level fields, for FC and RESpossibility of modeling inapplicable vehicles (conventional vehicle with a RES aux load efficiency?)
Solution: Component-Level Efficiency Fields
Add optional aux_load_eff: Option<si::Ratio> to:
FuelConverter— represents mechanical-to-electrical conversion (alternator for ICE, inapplicable for fuel cell)ReversibleEnergyStorage— represents electrical-to-electrical conversion (DC-DC inverter)
Add initialization checks
-
Conv init:
- FC: (0, 100%] range check on aux_load_eff
-
HEV/PHEV init:
- FC: (0, 100%] range check on aux_load_eff
- RES: (0, 100%] range check on aux_load_eff
-
FCEV init:
- FC:
ensure!(fc.aux_load_eff == None or Some(1.0)) - RES: (0, 100%] range check
-FC does not supply aux load directly for FCEVs, it comes from the RES
- FC:
-
create new
optionalfield in FC and RES components for aux load efficiency penalty- FC: represents an alternator (fuel cell stacks dont directly supply aux power, all goes to RES)
- for FCEV, check on initialization this value is None or Some(1.0), e.g.:
- FC: represents an alternator (fuel cell stacks dont directly supply aux power, all goes to RES)
impl Init for FuelCellElectricVehicle {
fn init(&mut self) -> Result<(), Error> {
// Validate that FC doesn't have alternator (FCEV is purely electrical)
if let Some(eff) = self.fc.aux_load_eff {
ensure!(
eff == 1.0 * uc::R,
"FCEV fuel converter should not have alternator losses. aux_load_eff must be None or 1.0, got {}",
eff.get::<si::ratio>()
);
}
// ... rest of init
self.fc.init()?;
self.res.init()?;
// ...
Ok(())
}
}
- RES: represents DC:DC conversion efficiency
- figure out how to maintain serde format compatibilty
Eventually port to style of #279, delegate some efficiency range checks to that implementation Did this already, why not
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.