-
Notifications
You must be signed in to change notification settings - Fork 31
Add simple model for estimation of fuel consumption #7
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
Conversation
kdemmich
commented
Apr 22, 2025
- based on Direct Power Method as described in ITTC
- only considers added resistance due to wind
- can only operate at fixed working point of 75% SMCR and corresponding speed
- solve dimension problem - arccos argument-out-of-range error in ship.py
DeprecationWarnings
…n calculation of apparent wind variables
| if config.SHIP_TYPE == 'SAL': | ||
| raise NotImplementedError('Ship type SAL is not yet supported!') | ||
| if config.BOAT_TYPE == 'direct_power_method': | ||
| print('Using direct power method') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use logger instead of print.
|
|
||
| if config.ALGORITHM_TYPE == 'speedy_isobased': | ||
| ship = ConstantFuelBoat(config) | ||
| else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't use "else" and the user sets BOAT_TYPE to something else than speedy_isobased, the ship object will be overridden. This behavior is not intended, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Is fixed now.
WeatherRoutingTool/ship/ship.py
Outdated
| ship_params - ShipParams object containing ship parameters like power consumption and fuel rate | ||
| """ | ||
|
|
||
| ship_path: str # path to ship configuration file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ship_path is never set or used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
WeatherRoutingTool/ship/ship.py
Outdated
|
|
||
| def __init__(self, config): | ||
| super().__init__(config) | ||
| config_obj = ShipConfig(file_name=config.CONFIG_PATH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a user has specified the configuration via a dictionary, the ShipConfig will not be initialized correctly. Instead, an error will be thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
|
||
| for i_coord in range(0, n_coords): | ||
| wave_direction.append( | ||
| self.approx_weather(weather_data['VMDR'], lats[i_coord], lons[i_coord], time[i_coord])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is i_coord used to index lons, although i_coord ranges from 0 to len(lats)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arrays lats and lons have the same length by design as they store the latitude and longitude values at every routing step.
WeatherRoutingTool/ship/ship.py
Outdated
| estimates power & fuel consumption based on the so-called Direct Power Method | ||
| The following approximations are used: | ||
| - a fixed working point of 70% SMCR power and an average ship speed is assumed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it 75 %?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
WeatherRoutingTool/ship/ship.py
Outdated
| self.calculate_head_wind_coeff() | ||
|
|
||
| logger.info(form.get_log_step('The boat speed provided is assumed to be the speed that corresponds ' | ||
| 'to 70% SMCR power.')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it 75 %?