NatLabRockies / NatLabRockies/fastsim

Refactor `alt_eff` to be a FuelConverter/ReversibleEnergyStorage level aux load efficiency penalty

Open
#286 0 comments 0 reactions 1 assignee View on GitHub

@kylecarow is already working on this.

Since Jul 15, 2026.

enhancement
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
      • FuelConverter has alt_eff that accounts for this
  • 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 to HybridElectricVehicle (as in #272)
      • Does not apply when we get to modeling FCEVs, FCEVs have no alternator
    • Introduce a single vehicle-level field
      • can't distinguish between mechanical (FC) vs electrical (RES) conversion losses
    • Introduce multiple vehicle-level fields, for FC and RES
      • possibility 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
  • create new optional field 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.:
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.