contrailcirrus / pycontrails

Python library for modeling contrails and other aviation climate impacts
https://py.contrails.org/
Apache License 2.0
60 stars 19 forks source link

Changing fuel on fleet #85

Closed mlshapiro closed 1 year ago

mlshapiro commented 1 year ago

Discussed in https://github.com/contrailcirrus/pycontrails/discussions/84

Originally posted by **GunnarQuante** August 25, 2023 For some weeks I am trying to change the fuel used on a fleet/list of flights from JetA to a SAFBlend. I have a fleet of e.g., 100 flights and would like to run Cocip on them once with JetA and once with a 100% SAFBlend. When I loop through each flight in the fleet, change the fuel and run Cocip on each flight individually, the overall contrail EF changes. This is not the case if I change the fuel for the entire fleet. In this case, the overal contrail EF of the JetA run to the SAFBlend run is identical. To reduce computational time, I am looking for a way to run Cocip on the entire fleet: def CoCiP_by_fuels(met, rad, flights_in, fuel): # Use BADA3 for performance modelling bada_model = BADAFlight(bada_priority=3) params = { "process_emissions": True, "verbose_outputs": False, "humidity_scaling": ConstantHumidityScaling(rhi_adj=0.98), } cocip = Cocip(met=met, rad=rad, params=params, aircraft_performance=bada_model) Fleet = pycontrails.Fleet.from_seq(flights_in) Fleet.fuel = SAFBlend(100) print(Fleet.fuel.fuel_name) Fleet_out=cocip.eval(Fleet) print(Fleet_out.fuel.fuel_name) return Fleet_out Note that also the fuel_name changes from Fleet to Fleet_out. I suppose I am missing something here, but after quite some reading I still can't find a fix.
mlshapiro commented 1 year ago

Addressed in 0.47