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

using fuel converter efficiency map in fuel economy calcs #165

Open
bharatwrrr opened this issue Nov 14, 2024 · 4 comments
Open

using fuel converter efficiency map in fuel economy calcs #165

bharatwrrr opened this issue Nov 14, 2024 · 4 comments
Assignees

Comments

@bharatwrrr
Copy link

bharatwrrr commented Nov 14, 2024

Is the fc_eff_map (fuel converter efficiency map) property not used in simdrive.py while calculating fuel economy? The code seems to use the constant kwh_per_gge parameter for conversion. Where else is the fc_eff_map property used?

I am trying to tune a few vehicle models. The glider mass and frontal area are known parameters. I wanted to make a list of other vehicle parameters to tune and was considering fc_eff_map as well.

@bharatwrrr bharatwrrr changed the title Using fuel converter efficiency map in fuel economy calcs using fuel converter efficiency map in fuel economy calcs Nov 14, 2024
@kylecarow
Copy link
Collaborator

kylecarow commented Nov 19, 2024

@bharatwrrr The fc_eff_map (fuel converter efficiency map) property is used during the simulation loop to calculate the engine's input power (which is equal to the fuel storage output power)

So, this code:

self.mpgge = self.dist_mi.sum() / (self.fs_kwh_out_ach.sum() / self.props.kwh_per_gge)

is affected by the fc_eff_map by way of self.fs_kwh_out_ach.sum(). For example, if the engine is less efficient, the achieved fuel storage output energy will be higher, thus the fuel economy will be worse.

Does that help?

EDIT:
To note about fc_eff_map when tuning, it is essentially the 'y-values' of the efficiency, where the x-values are the optional parameter fc_pwr_out_perc. The values of fc_pwr_out_perc represent fractions of the peak fc power, fc_max_kw. The default values for these for a spark ignition engine (and other fc_eff_types) are defined in parameters.py:

fc_pwr_out_perc 0 0.005 0.015 0.04 0.06 0.10 0.14 0.20 0.40 0.60 0.80 1.00
fc_eff_map_si 0.10 0.12 0.16 0.22 0.28 0.33 0.35 0.36 0.35 0.34 0.32 0.30

@bharatwrrr
Copy link
Author

@kylecarow Yep, I got it. Thanks!
I figured had to recompute attributes like fc_eff_array and fc_kw_out_array while tuning because just changing fc_eff_map did not seem to change fc_eff_array which is ultimately used to get the point efficiencies in simdrive.

I have another question. It seems that the mc_eff_map does not work similarly to fc_eff_map for BEVs. Tuning fc_eff_map works well for 'Conv' vehicles. Is there an analogous attribute that I can tune for BEVs?

I was also trying to output the mpgge values for BEVs but hit a wall. Using the following code for BEVs, the mpgge value that I get is 0:

veh = vehicle.Vehicle.from_vehdb(20) # 2016 Nissan Leaf 30 kWh

cyc = cycle.Cycle.from_file('udds')    
sim_drive = simdrive.SimDrive(cyc, veh)
sim_drive.sim_drive()

sim_drive_post = simdrive.SimDrivePost(sim_drive)
output = sim_drive_post.get_diagnostics()

output

Is there a functionality in place to compute the mpgge for BEVs? If not, I was planning on computing it using the attributes set in set_post_scalars().

@kylecarow
Copy link
Collaborator

kylecarow commented Nov 20, 2024

@bharatwrrr Ah, I see. I suppose the thing I neglected to mention is if you are modifying these values at runtime (after loading a vehicle), you should re-run the vehicle's set_derived method, which will recalculate those arrays for you.

mc_eff_map is indeed the analog for motor efficiency (and mc_pwr_out_perc is the analog to fc_pwr_out_perc), what issue are you seeing there? I feel like calling set_derived as mentioned above would help with that also.

For BEVs the MPG value is hardcoded to output 0. You could calculate equivalent MPG for BEVs by doing something like sd.dist_mi.sum() / (sd.ess_dischg_kj / 3.6e3 / sd.props.kwh_per_gge). You may also want to consider whether to include charger losses in your result, depending on your application.

@bharatwrrr
Copy link
Author

@kylecarow Gotcha.
Yep, something similar to the formula you suggested is what i had in mind. Thanks for the clarification! I’d like to contribute functionality to compute MPGGE for BEVs directly in FASTSim, as it seems like a useful feature. Would you be open to reviewing a pull request for this? If there was a rationale of not including this functionality, then I'll leave it as is. I can start by building on the formula you mentioned. Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants