RunFeemsSim 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RunFeemsSim
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A library for running feems simulation
5
5
  Author-email: Kevin Koosup Yum <kevinkoosup.yum@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -298,6 +298,7 @@ class MachineryCalculation:
298
298
  fuel_specified_by: FuelSpecifiedBy = FuelSpecifiedBy.IMO,
299
299
  ignore_power_balance: bool = False,
300
300
  fuel_option: Optional[FuelOption] = None,
301
+ steam_demand_kg_per_h: Optional[np.ndarray] = None,
301
302
  ) -> Union[FEEMSResult, FEEMSResultForMachinerySystem]:
302
303
  """
303
304
  Calculate the machinery system output from a time series of the propulsion power and
@@ -313,6 +314,8 @@ class MachineryCalculation:
313
314
  ignore_power_balance(bool): If True, the power balance calculation will be ignored.
314
315
  fuel_option(FuelOption): The fuel option to be used in the simulation. If None, the
315
316
  default fuel option in the system will be used.
317
+ steam_demand_kg_per_h: Steam demand time series (kg/h). Must have the same length as
318
+ propulsion_power. If None and a boiler is attached, demand is treated as zero.
316
319
 
317
320
  Returns:
318
321
  The result of the calculation. FEEMSResult or FEEMSResultForMachinerySystem.
@@ -347,11 +350,23 @@ class MachineryCalculation:
347
350
  f"The length of the auxiliary power({len(auxiliary_power_kw)}) must be 1"
348
351
  f" or the same as the propulsion power ({len(propulsion_power)})"
349
352
  )
353
+ n_steps = len(propulsion_power)
354
+ if steam_demand_kg_per_h is not None:
355
+ if len(steam_demand_kg_per_h) != n_steps:
356
+ raise ValueError(
357
+ f"The length of steam_demand_kg_per_h ({len(steam_demand_kg_per_h)}) must match "
358
+ f"propulsion_power ({n_steps})."
359
+ )
350
360
 
351
361
  self._set_input_load_time_interval_from_propulsion_power_time_series(
352
362
  propulsion_power_time_series=propulsion_power,
353
363
  auxiliary_load_kw=auxiliary_power_kw,
354
364
  )
365
+ if self.system_feems.boiler is not None:
366
+ self.system_feems.boiler.steam_out_kg_per_h = (
367
+ steam_demand_kg_per_h if steam_demand_kg_per_h is not None
368
+ else np.zeros(n_steps)
369
+ )
355
370
  return self._run_simulation(
356
371
  fuel_specified_by=fuel_specified_by,
357
372
  ignore_power_balance=ignore_power_balance,
@@ -368,6 +383,7 @@ class MachineryCalculation:
368
383
  fuel_specified_by: FuelSpecifiedBy = FuelSpecifiedBy.IMO,
369
384
  ignore_power_balance: bool = False,
370
385
  fuel_option: Optional[FuelOption] = None,
386
+ steam_demand_kg_per_h: Optional[np.ndarray] = None,
371
387
  ) -> Union[FEEMSResult, FEEMSResultForMachinerySystem]:
372
388
  """
373
389
  Calculate the machinery system output from statistics of the propulsion power.
@@ -377,6 +393,8 @@ class MachineryCalculation:
377
393
  ignore_power_balance(bool): If True, the power balance calculation will be ignored.
378
394
  fuel_option(FuelOption): The fuel option to be used in the simulation. If None, the
379
395
  default fuel option in the system will be used.
396
+ steam_demand_kg_per_h: Steam demand time series (kg/h). Must have the same length as
397
+ the time series. If None and a boiler is attached, demand is treated as zero.
380
398
 
381
399
  Returns:
382
400
  The result of the simulation. FEEMSResult or FEEMSResultForMachinery system.
@@ -398,7 +416,18 @@ class MachineryCalculation:
398
416
  raise TypeError(
399
417
  "time_series must be a TimeSeriesResult or TimeSeriesResultForMultiplePropulsors."
400
418
  )
401
-
419
+ n_steps = len(df)
420
+ if steam_demand_kg_per_h is not None:
421
+ if len(steam_demand_kg_per_h) != n_steps:
422
+ raise ValueError(
423
+ f"The length of steam_demand_kg_per_h ({len(steam_demand_kg_per_h)}) must match "
424
+ f"the time series ({n_steps})."
425
+ )
426
+ if self.system_feems.boiler is not None:
427
+ self.system_feems.boiler.steam_out_kg_per_h = (
428
+ steam_demand_kg_per_h if steam_demand_kg_per_h is not None
429
+ else np.zeros(n_steps)
430
+ )
402
431
  return self._run_simulation(
403
432
  fuel_specified_by=fuel_specified_by,
404
433
  ignore_power_balance=ignore_power_balance,
@@ -414,6 +443,7 @@ class MachineryCalculation:
414
443
  fuel_specified_by: FuelSpecifiedBy = FuelSpecifiedBy.IMO,
415
444
  ignore_power_balance: bool = False,
416
445
  fuel_option: Optional[FuelOption] = None,
446
+ steam_demand_kg_per_h: Optional[np.ndarray] = None,
417
447
  ) -> Union[FEEMSResult, FEEMSResultForMachinerySystem]:
418
448
  """
419
449
  Calculate the machinery system output from statistics of the propulsion power.
@@ -428,19 +458,33 @@ class MachineryCalculation:
428
458
  ignore_power_balance(bool): If True, the power balance calculation will be ignored.
429
459
  fuel_option(FuelOption): The fuel option to be used in the simulation. If None, the
430
460
  default fuel option in the system will be used.
461
+ steam_demand_kg_per_h: Steam demand for each mode in kg/h. Must have the same length
462
+ as propulsion_power. If None and a boiler is attached, demand is treated as zero.
431
463
 
432
464
  Returns:
433
465
  The result of the simulation. FEEMSResult or FEEMSResultForMachinery system.
434
466
  """
467
+ n_steps = len(propulsion_power)
435
468
  if not np.isscalar(auxiliary_power_kw):
436
469
  assert (
437
- len(propulsion_power) == len(auxiliary_power_kw) or len(auxiliary_power_kw) == 1
470
+ n_steps == len(auxiliary_power_kw) or len(auxiliary_power_kw) == 1
438
471
  ), "The length of the auxiliary power must be 1 or the same as the propulsion power"
472
+ if steam_demand_kg_per_h is not None:
473
+ if len(steam_demand_kg_per_h) != n_steps:
474
+ raise ValueError(
475
+ f"The length of steam_demand_kg_per_h ({len(steam_demand_kg_per_h)}) must match "
476
+ f"propulsion_power ({n_steps})."
477
+ )
439
478
  self._set_input_load_time_interval_from_propulsion_power_time_series(
440
479
  propulsion_power_time_series=pd.Series(data=propulsion_power, index=frequency),
441
480
  auxiliary_load_kw=auxiliary_power_kw,
442
481
  time_is_given_as_interval=True,
443
482
  )
483
+ if self.system_feems.boiler is not None:
484
+ self.system_feems.boiler.steam_out_kg_per_h = (
485
+ steam_demand_kg_per_h if steam_demand_kg_per_h is not None
486
+ else np.zeros(n_steps)
487
+ )
444
488
  return self._run_simulation(
445
489
  fuel_specified_by=fuel_specified_by,
446
490
  ignore_power_balance=ignore_power_balance,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RunFeemsSim
3
- Version: 0.5.0
3
+ Version: 0.6.0
4
4
  Summary: A library for running feems simulation
5
5
  Author-email: Kevin Koosup Yum <kevinkoosup.yum@gmail.com>
6
6
  License-Expression: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "RunFeemsSim"
7
- version = "0.5.0"
7
+ version = "0.6.0"
8
8
  description = "A library for running feems simulation"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes
File without changes