├── .gitignore ├── ShipPowerModel ├── .Rbuildignore ├── .gitignore ├── tests │ ├── testthat.R │ └── testthat │ │ ├── testUnitConversions.r │ │ └── testPropellerLaw.r ├── data │ ├── shipMap.rda │ ├── TestShipsHM.rda │ ├── TestShipsKrist.rda │ ├── IMOGHG3_AuxLoadFactor.rda │ ├── IMOGHG3_BoilerLoadFactor.rda │ ├── Starcrest2016_AuxLoadFactor.rda │ └── Starcrest2016_BoilerLoadFactor.rda ├── docs │ ├── reference │ │ └── Rplot001.png │ ├── articles │ │ ├── Kristensen.Example_files │ │ │ ├── figure-html │ │ │ │ └── unnamed-chunk-20-1.png │ │ │ ├── header-attrs-2.6 │ │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ │ └── header-attrs.js │ │ ├── HoltropMennen.Example_files │ │ │ ├── figure-html │ │ │ │ └── unnamed-chunk-22-1.png │ │ │ ├── header-attrs-2.6 │ │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ │ └── header-attrs.js │ │ ├── Propeller.Law.Example_files │ │ │ ├── figure-html │ │ │ │ └── unnamed-chunk-4-1.png │ │ │ ├── header-attrs-2.6 │ │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ │ └── header-attrs.js │ │ ├── Admiralty.Formula.Example_files │ │ │ ├── figure-html │ │ │ │ └── unnamed-chunk-5-1.png │ │ │ ├── header-attrs-2.6 │ │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ │ └── header-attrs.js │ │ └── OverviewOfPowerModels_files │ │ │ ├── header-attrs-2.6 │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── pkgdown.yml │ ├── link.svg │ ├── bootstrap-toc.css │ └── docsearch.js ├── R │ ├── calcSpeedUnitConversion.r │ ├── calcDispUnitConversion.r │ ├── calchb.r │ ├── calclcb.r │ ├── calcShipM.r │ ├── calcAt.r │ ├── calcHullEff.r │ ├── calcAbt.r │ ├── calcPropNum.r │ ├── calcFroudeNum.r │ ├── calcTEU.r │ ├── calcCwp.r │ ├── calcActualDisp.r │ ├── calcHMImmersedTransomRes.r │ ├── calcCb.r │ ├── calcHMWettedSA.r │ ├── calcCf.r │ ├── calcHMBulbousBowRes.r │ ├── calcCbw.r │ ├── calcHMFormFactor.r │ ├── calclwl.r │ ├── calcKristTotalRes.r │ ├── calcPropDia.r │ ├── calcOpenWaterEff.r │ ├── calcHMCa.r │ ├── calcKristCa.r │ ├── calcHMAppendageRes.r │ ├── calcOperatingMode.r │ └── calcHMTotalRes.r ├── ShipPowerModel.Rproj ├── man │ ├── TestShipsHM.Rd │ ├── TestShipsKrist.Rd │ ├── calcSpeedUnitConversion.Rd │ ├── calcDispUnitConversion.Rd │ ├── calchb.Rd │ ├── calclcb.Rd │ ├── calcShipM.Rd │ ├── calcAt.Rd │ ├── calcHullEff.Rd │ ├── calcTEU.Rd │ ├── calcPropNum.Rd │ ├── calcAbt.Rd │ ├── shipMap.Rd │ ├── calcCwp.Rd │ ├── calcFroudeNum.Rd │ ├── calcActualDisp.Rd │ ├── calcCb.Rd │ ├── calcCbw.Rd │ ├── Starcrest2016_BoilerLoadFactor.Rd │ ├── calclwl.Rd │ ├── calcOperatingMode.Rd │ ├── calcCf.Rd │ ├── Starcrest2016_AuxLoadFactor.Rd │ ├── IMOGHG3_BoilerLoadFactor.Rd │ ├── calcPropDia.Rd │ ├── IMOGHG3_AuxLoadFactor.Rd │ ├── calcHMWettedSA.Rd │ ├── calcOpenWaterEff.Rd │ ├── calcHMFormFactor.Rd │ ├── calcHMImmersedTransomRes.Rd │ ├── calcHMBulbousBowRes.Rd │ ├── calcHMCa.Rd │ ├── calcHMAppendageRes.Rd │ ├── calcCp.Rd │ ├── calcKristCa.Rd │ └── calcPropPwr.Rd ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── README.md └── inst │ └── extdata │ └── Sample.Ships.csv ├── ShipEF ├── tests │ └── testthat.R ├── .gitignore ├── .Rbuildignore ├── data │ ├── AuxBSFC.rda │ ├── AuxNOxEF.rda │ ├── MainBSFC.rda │ ├── BoilerBSFC.rda │ ├── BoilerNOxEF.rda │ ├── LLAFCoeff.rda │ ├── MainNOxEF.rda │ ├── Aux_HC_CO_EF.rda │ ├── Main_HC_CO_EF.rda │ ├── AuxFuelMixTable.rda │ ├── Boiler_HC_CO_EF.rda │ ├── EF_PM_ST_GT_LNG.rda │ ├── MainFuelMixTable.rda │ ├── BoilerFuelMixTable.rda │ ├── CO2ConversionFactor.rda │ └── EFSulfurEQCoefficients.rda ├── docs │ ├── reference │ │ └── Rplot001.png │ ├── pkgdown.yml │ ├── articles │ │ └── OverviewOfShipEF_files │ │ │ ├── header-attrs-2.6 │ │ │ └── header-attrs.js │ │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── link.svg │ ├── bootstrap-toc.css │ └── docsearch.js ├── ShipEF.Rproj ├── NAMESPACE ├── DESCRIPTION ├── man │ ├── calcTestIMO.Rd │ ├── Boiler_HC_CO_EF.Rd │ ├── LLAFCoeff.Rd │ ├── Aux_HC_CO_EF.Rd │ ├── BoilerFuelMixTable.Rd │ ├── CO2ConversionFactor.Rd │ ├── AuxFuelMixTable.Rd │ ├── BoilerBSFC.Rd │ ├── MainFuelMixTable.Rd │ ├── BoilerNOxEF.Rd │ ├── AuxBSFC.Rd │ ├── EFSulfurEQCoefficients.Rd │ ├── calcLoadBSFC.Rd │ ├── AuxNOxEF.Rd │ ├── EF_PM_ST_GT_LNG.Rd │ ├── MainBSFC.Rd │ ├── calcEF_HC.Rd │ ├── calcEF_CO.Rd │ ├── Main_HC_CO_EF.Rd │ ├── ShipEF.Rd │ ├── calcShipCategory.Rd │ ├── MainNOxEF.Rd │ ├── calcTier.Rd │ └── calcEngineType.Rd ├── LICENSE ├── R │ ├── calcLoadBSFC.r │ ├── ShipEF.r │ ├── calcTestIMO.r │ ├── calcShipCategory.r │ ├── calcEF_CO.r │ ├── calcEF_HC.r │ └── calcTier.r └── README.md ├── CheatSheets ├── ShipEFCheatSheet.pdf └── ShipPowerModelCheatSheet.pdf ├── LICENSE └── readme.md /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /ShipPowerModel/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | -------------------------------------------------------------------------------- /ShipEF/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | 3 | test_check("ShipEF") 4 | -------------------------------------------------------------------------------- /ShipEF/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | inst/doc 5 | doc 6 | Meta 7 | -------------------------------------------------------------------------------- /ShipEF/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^.*\.Rhistory$ 4 | ^doc$ 5 | ^Meta$ 6 | -------------------------------------------------------------------------------- /ShipEF/data/AuxBSFC.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/AuxBSFC.rda -------------------------------------------------------------------------------- /ShipEF/data/AuxNOxEF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/AuxNOxEF.rda -------------------------------------------------------------------------------- /ShipEF/data/MainBSFC.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/MainBSFC.rda -------------------------------------------------------------------------------- /ShipPowerModel/.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | inst/doc 6 | doc 7 | Meta 8 | -------------------------------------------------------------------------------- /ShipEF/data/BoilerBSFC.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/BoilerBSFC.rda -------------------------------------------------------------------------------- /ShipEF/data/BoilerNOxEF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/BoilerNOxEF.rda -------------------------------------------------------------------------------- /ShipEF/data/LLAFCoeff.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/LLAFCoeff.rda -------------------------------------------------------------------------------- /ShipEF/data/MainNOxEF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/MainNOxEF.rda -------------------------------------------------------------------------------- /ShipEF/data/Aux_HC_CO_EF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/Aux_HC_CO_EF.rda -------------------------------------------------------------------------------- /ShipEF/data/Main_HC_CO_EF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/Main_HC_CO_EF.rda -------------------------------------------------------------------------------- /ShipPowerModel/tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(ShipPowerModel) 3 | 4 | test_check("ShipPowerModel") 5 | -------------------------------------------------------------------------------- /CheatSheets/ShipEFCheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/CheatSheets/ShipEFCheatSheet.pdf -------------------------------------------------------------------------------- /ShipEF/data/AuxFuelMixTable.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/AuxFuelMixTable.rda -------------------------------------------------------------------------------- /ShipEF/data/Boiler_HC_CO_EF.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/Boiler_HC_CO_EF.rda -------------------------------------------------------------------------------- /ShipEF/data/EF_PM_ST_GT_LNG.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/EF_PM_ST_GT_LNG.rda -------------------------------------------------------------------------------- /ShipEF/data/MainFuelMixTable.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/MainFuelMixTable.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/shipMap.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/shipMap.rda -------------------------------------------------------------------------------- /ShipEF/data/BoilerFuelMixTable.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/BoilerFuelMixTable.rda -------------------------------------------------------------------------------- /ShipEF/docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /ShipEF/data/CO2ConversionFactor.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/CO2ConversionFactor.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/TestShipsHM.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/TestShipsHM.rda -------------------------------------------------------------------------------- /ShipEF/data/EFSulfurEQCoefficients.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipEF/data/EFSulfurEQCoefficients.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/TestShipsKrist.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/TestShipsKrist.rda -------------------------------------------------------------------------------- /CheatSheets/ShipPowerModelCheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/CheatSheets/ShipPowerModelCheatSheet.pdf -------------------------------------------------------------------------------- /ShipPowerModel/docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /ShipPowerModel/data/IMOGHG3_AuxLoadFactor.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/IMOGHG3_AuxLoadFactor.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/IMOGHG3_BoilerLoadFactor.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/IMOGHG3_BoilerLoadFactor.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/Starcrest2016_AuxLoadFactor.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/Starcrest2016_AuxLoadFactor.rda -------------------------------------------------------------------------------- /ShipPowerModel/data/Starcrest2016_BoilerLoadFactor.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/data/Starcrest2016_BoilerLoadFactor.rda -------------------------------------------------------------------------------- /ShipEF/docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 2.11.4 2 | pkgdown: 1.6.1 3 | pkgdown_sha: ~ 4 | articles: 5 | OverviewOfShipEF: OverviewOfShipEF.html 6 | last_built: 2021-05-18T13:00Z 7 | 8 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Kristensen.Example_files/figure-html/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/docs/articles/Kristensen.Example_files/figure-html/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/HoltropMennen.Example_files/figure-html/unnamed-chunk-22-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/docs/articles/HoltropMennen.Example_files/figure-html/unnamed-chunk-22-1.png -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Propeller.Law.Example_files/figure-html/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/docs/articles/Propeller.Law.Example_files/figure-html/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Admiralty.Formula.Example_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/USEPA/Marine_Emissions_Tools/HEAD/ShipPowerModel/docs/articles/Admiralty.Formula.Example_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /ShipPowerModel/docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 2.11.4 2 | pkgdown: 1.6.1 3 | pkgdown_sha: ~ 4 | articles: 5 | Admiralty.Formula.Example: Admiralty.Formula.Example.html 6 | HoltropMennen.Example: HoltropMennen.Example.html 7 | Kristensen.Example: Kristensen.Example.html 8 | OverviewOfPowerModels: OverviewOfPowerModels.html 9 | Propeller.Law.Example: Propeller.Law.Example.html 10 | last_built: 2021-05-18T12:55Z 11 | 12 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcSpeedUnitConversion.r: -------------------------------------------------------------------------------- 1 | #'@title calcSpeedUnitConversion 2 | #' 3 | #'@description Convert speed in knots to m/s. 4 | #' 5 | #'@param shipSpeed Ship speed (vector of numericals, knots) 6 | #' 7 | #'@return speed (vector of numericals, m/s) 8 | #' 9 | #'@examples 10 | #'calcSpeedUnitConversion(seq(10,15,1)) 11 | #' 12 | #'@export 13 | 14 | calcSpeedUnitConversion<- function(shipSpeed){ 15 | 16 | speed<- shipSpeed*0.5144 17 | 18 | return(speed) 19 | } 20 | -------------------------------------------------------------------------------- /ShipEF/ShipEF.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /ShipEF/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(calcEF) 4 | export(calcEF_CO) 5 | export(calcEF_CO2) 6 | export(calcEF_HC) 7 | export(calcEF_NOx) 8 | export(calcEF_PM) 9 | export(calcEF_SO2) 10 | export(calcEngineType) 11 | export(calcLLAF) 12 | export(calcLoadBSFC) 13 | export(calcShipCategory) 14 | export(calcTestIMO) 15 | export(calcTier) 16 | import(data.table) 17 | importFrom(stats,spline) 18 | importFrom(stats,weighted.mean) 19 | importFrom(utils,data) 20 | importFrom(utils,tail) 21 | -------------------------------------------------------------------------------- /ShipPowerModel/ShipPowerModel.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace,vignette 22 | -------------------------------------------------------------------------------- /ShipPowerModel/man/TestShipsHM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{TestShipsHM} 5 | \alias{TestShipsHM} 6 | \title{Unit test data for Holtrop-Mennen Calculations} 7 | \format{ 8 | A data frame with 1 row and 34 variables 9 | } 10 | \usage{ 11 | data(TestShipsHM) 12 | } 13 | \description{ 14 | Unit test data for Holtrop-Mennen Calculations 15 | } 16 | \details{ 17 | This data is used for testing the Holtrop-Mennen power calculations 18 | } 19 | \keyword{test} 20 | \keyword{unit} 21 | -------------------------------------------------------------------------------- /ShipPowerModel/man/TestShipsKrist.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{TestShipsKrist} 5 | \alias{TestShipsKrist} 6 | \title{Unit test data for Kristensen Calculations} 7 | \format{ 8 | A data frame with 6 row and 29 variables 9 | } 10 | \usage{ 11 | data(TestShipsKrist) 12 | } 13 | \description{ 14 | Unit test data for Kristensen Calculations 15 | } 16 | \details{ 17 | This data is used for testing the Kristensen (SHIP-DESMO) power calculations 18 | } 19 | \keyword{test} 20 | \keyword{unit} 21 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcSpeedUnitConversion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcSpeedUnitConversion.r 3 | \name{calcSpeedUnitConversion} 4 | \alias{calcSpeedUnitConversion} 5 | \title{calcSpeedUnitConversion} 6 | \usage{ 7 | calcSpeedUnitConversion(shipSpeed) 8 | } 9 | \arguments{ 10 | \item{shipSpeed}{Ship speed (vector of numericals, knots)} 11 | } 12 | \value{ 13 | speed (vector of numericals, m/s) 14 | } 15 | \description{ 16 | Convert speed in knots to m/s. 17 | } 18 | \examples{ 19 | calcSpeedUnitConversion(seq(10,15,1)) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /ShipEF/docs/articles/OverviewOfShipEF_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipEF/docs/articles/OverviewOfShipEF_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/HoltropMennen.Example_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/HoltropMennen.Example_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Kristensen.Example_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Kristensen.Example_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/OverviewOfPowerModels_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/OverviewOfPowerModels_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Propeller.Law.Example_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Propeller.Law.Example_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Admiralty.Formula.Example_files/header-attrs-2.6/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/articles/Admiralty.Formula.Example_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcDispUnitConversion.r: -------------------------------------------------------------------------------- 1 | #'@title calcDispUnitConversion 2 | #' 3 | #'@description Convert displacement in tonnages to cubic meters. 4 | #' 5 | #'@param tonnageDisp Displacement (vector of numericals, tonnage) 6 | #'@param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 7 | #'supply either a vector of numericals, a single number, or rely on the default 8 | #' 9 | #'@return \code{disp} (vector of numericals, m^3) 10 | #' 11 | #'@examples 12 | #'calcDispUnitConversion(70000, 1.025) 13 | #' 14 | #'@export 15 | 16 | calcDispUnitConversion<- function(tonnageDisp, seawaterDensity=1.025){ 17 | 18 | disp<- tonnageDisp/seawaterDensity 19 | 20 | return(disp) 21 | } 22 | -------------------------------------------------------------------------------- /ShipEF/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ShipEF 2 | Version: 0.2 3 | Date: 5/18/2021 4 | Title: USEPA Ship Emission Factors 5 | Description: This package contains functions to assign marine vessel emission factors. 6 | Authors@R: c( 7 | person("Isabela", "Brown", role = c("aut")), 8 | person("Michael", "Aldridge", email = "aldridge.michael@epa.gov", role=c("aut", "cre")), 9 | person("Daniel", "Bizer-Cox", role = c("aut")) 10 | ) 11 | Maintainer: Michael Aldridge 12 | License: MIT + file LICENSE 13 | Depends: R (>= 2.10) 14 | LazyData: true 15 | Imports: data.table, 16 | utils, 17 | stats, 18 | plyr 19 | Suggests: testthat, 20 | knitr, 21 | rmarkdown 22 | RoxygenNote: 7.1.2 23 | VignetteBuilder: knitr 24 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcDispUnitConversion.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcDispUnitConversion.r 3 | \name{calcDispUnitConversion} 4 | \alias{calcDispUnitConversion} 5 | \title{calcDispUnitConversion} 6 | \usage{ 7 | calcDispUnitConversion(tonnageDisp, seawaterDensity = 1.025) 8 | } 9 | \arguments{ 10 | \item{tonnageDisp}{Displacement (vector of numericals, tonnage)} 11 | 12 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 13 | supply either a vector of numericals, a single number, or rely on the default} 14 | } 15 | \value{ 16 | \code{disp} (vector of numericals, m^3) 17 | } 18 | \description{ 19 | Convert displacement in tonnages to cubic meters. 20 | } 21 | \examples{ 22 | calcDispUnitConversion(70000, 1.025) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calchb.r: -------------------------------------------------------------------------------- 1 | #' @title calchb 2 | #' 3 | #' @description Estimate the center of bulb area above keel line (\code{hb}) (m) 4 | #' using the method in Rakke (2016). 5 | #' 6 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 7 | #' 8 | #' @return \code{hb} (vector of numericals, m) 9 | #' 10 | #' @references 11 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 12 | #'method." International Shipbuilding Progress 29. 13 | #' 14 | #'\href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 15 | #'Calculation from AIS." NTNU.} 16 | #' 17 | #' @examples 18 | #' calchb(c(13.57,11.49)) 19 | #' calchb(13.57) 20 | #' 21 | #' @export 22 | 23 | 24 | calchb <-function(maxDraft){ 25 | 26 | hb<-0.4*maxDraft 27 | 28 | return(hb) 29 | } 30 | -------------------------------------------------------------------------------- /ShipPowerModel/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ShipPowerModel 2 | Version: 0.2 3 | Date: 05/18/2021 4 | Title: USEPA Ship Power Model 5 | Description: This package contains functions to calculate ship propulsive power and auxiliary/boiler engine loads. 6 | Authors@R: c( 7 | person("Isabela", "Brown", email = "brown.isabela@epa.gov", role = c("aut")), 8 | person("Michael", "Aldridge", email = "aldridge.michael@epa.gov", role = c("aut","cre")), 9 | person("Daniel", "Bizer-Cox", role = c("aut")) 10 | ) 11 | Maintainer: Michael Aldridge 12 | License: MIT + file LICENSE 13 | LazyData: true 14 | Depends: R (>= 3.5.0) 15 | Imports: data.table 16 | Suggests: testthat, 17 | knitr, 18 | rmarkdown, 19 | ggplot2 20 | RoxygenNote: 7.1.2 21 | VignetteBuilder: knitr 22 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calchb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calchb.r 3 | \name{calchb} 4 | \alias{calchb} 5 | \title{calchb} 6 | \usage{ 7 | calchb(maxDraft) 8 | } 9 | \arguments{ 10 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 11 | } 12 | \value{ 13 | \code{hb} (vector of numericals, m) 14 | } 15 | \description{ 16 | Estimate the center of bulb area above keel line (\code{hb}) (m) 17 | using the method in Rakke (2016). 18 | } 19 | \examples{ 20 | calchb(c(13.57,11.49)) 21 | calchb(13.57) 22 | 23 | } 24 | \references{ 25 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 26 | method." International Shipbuilding Progress 29. 27 | 28 | \href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 29 | Calculation from AIS." NTNU.} 30 | } 31 | -------------------------------------------------------------------------------- /ShipEF/docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /ShipPowerModel/tests/testthat/testUnitConversions.r: -------------------------------------------------------------------------------- 1 | rm(list=ls()) 2 | library(testthat) 3 | library(ShipPowerModel) 4 | 5 | context("Test unit conversion functions") 6 | 7 | test_that("calcSpeedUnitConversion works", 8 | { 9 | expect_equal( calcSpeedUnitConversion(10), 10 | 5.144 11 | ) 12 | } 13 | ) 14 | 15 | test_that("calcDispUnitConversion works", 16 | { 17 | expect_equal(calcDispUnitConversion(1), 18 | 1/1.025) 19 | 20 | expect_equal(calcDispUnitConversion(tonnageDisp = c(1,2,3,4), 21 | seawaterDensity = c(1, 2,0.5,2) 22 | ), 23 | c(1,1,6,2) 24 | ) 25 | } 26 | ) 27 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calclcb.r: -------------------------------------------------------------------------------- 1 | #'@title calclcb 2 | #' 3 | #'@description Calculate longitudinal position of center of buoyancy 4 | #'(\code{lcb}). 5 | #' 6 | #'@param lwl Waterline length (vector of numericals, m) (see \code{\link{calclwl}}) 7 | #' 8 | #'@details 9 | #'The longitudinal position of center of buoyancy describes center of buoyancy 10 | #'forward of half of the waterline length (\code{lwl}) (decimal percentage of 11 | #'waterline length). 12 | #' 13 | #'@return \code{lcb} (vector of numericals) 14 | #' 15 | #'@references 16 | #'\href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 17 | #'Calculation from AIS." NTNU.} 18 | #' 19 | #'@seealso 20 | #'\code{\link{calclwl}} 21 | #' 22 | #'@examples 23 | #'calclcb(c(218.75,400,262)) 24 | #' 25 | #'@export 26 | 27 | 28 | calclcb<- function(lwl){ 29 | 30 | lcb<- -0.75*(lwl/2)/100 31 | 32 | return(lcb) 33 | } 34 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calclcb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calclcb.r 3 | \name{calclcb} 4 | \alias{calclcb} 5 | \title{calclcb} 6 | \usage{ 7 | calclcb(lwl) 8 | } 9 | \arguments{ 10 | \item{lwl}{Waterline length (vector of numericals, m) (see \code{\link{calclwl}})} 11 | } 12 | \value{ 13 | \code{lcb} (vector of numericals) 14 | } 15 | \description{ 16 | Calculate longitudinal position of center of buoyancy 17 | (\code{lcb}). 18 | } 19 | \details{ 20 | The longitudinal position of center of buoyancy describes center of buoyancy 21 | forward of half of the waterline length (\code{lwl}) (decimal percentage of 22 | waterline length). 23 | } 24 | \examples{ 25 | calclcb(c(218.75,400,262)) 26 | 27 | } 28 | \references{ 29 | \href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 30 | Calculation from AIS." NTNU.} 31 | } 32 | \seealso{ 33 | \code{\link{calclwl}} 34 | } 35 | -------------------------------------------------------------------------------- /ShipEF/man/calcTestIMO.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcTestIMO.r 3 | \name{calcTestIMO} 4 | \alias{calcTestIMO} 5 | \title{calcTestIMO} 6 | \usage{ 7 | calcTestIMO(IMO, correctFlag = "Correct", incorrectFlag = "Incorrect") 8 | } 9 | \arguments{ 10 | \item{IMO}{IMO number (vector of numericals or strings)} 11 | 12 | \item{correctFlag}{Output indicator for rows where the IMO Number is in the 13 | correct format} 14 | 15 | \item{incorrectFlag}{Output indicator for rows where the IMO Number is not in 16 | the correct format} 17 | } 18 | \value{ 19 | \code{IMO_number_flag}, a factorized vector containing either the value of 20 | \code{correctFlag} or \code{incorrectFlag}, depending on the correctness of 21 | the IMO number 22 | } 23 | \description{ 24 | Determines whether or not an IMO number is in the correct format. IMO numbers 25 | should have 7 digits with a check digit at the end. 26 | } 27 | \examples{ 28 | calcTestIMO(IMO=c(899046900,0,9394935)) 29 | 30 | } 31 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcShipM.r: -------------------------------------------------------------------------------- 1 | #' @title calcShipM 2 | #' 3 | #' @description Calculate the fineness/slenderness ratio (\code{M}) 4 | #' (dimensionless) of the ship. 5 | #' 6 | #' @param actualDisplacement Actual loaded displacement (vector of 7 | #' numericals, m^3) (see \code{\link{calcActualDisp}}) 8 | #' @param lwl Waterline length (vector of numericals, m) (see 9 | #' \code{\link{calclwl}}) 10 | #' 11 | #' @return \code{M} (vector of numericals, dimensionless) 12 | #' 13 | #' @references 14 | #'\href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 15 | #' Solutions. 2011. "Basic Principles of Propulsion."} 16 | #' 17 | #'@seealso 18 | #' \itemize{ 19 | #' \item \code{\link{calcActualDisp}} 20 | #' \item \code{\link{calclwl}} 21 | #' } 22 | #' 23 | #' @examples 24 | #' calcShipM(73663,218) 25 | #' calcShipM(c(73663,216726),c(218,400)) 26 | #' 27 | #' @export 28 | 29 | calcShipM <-function(actualDisplacement, lwl){ 30 | 31 | M <- lwl/(actualDisplacement^(1/3)) 32 | 33 | return(M) 34 | } 35 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcAt.r: -------------------------------------------------------------------------------- 1 | #' @title calcAt 2 | #' 3 | #' @description Estimate transom area (\code{At}) (m^2) using method in Rakke 4 | #' (2016). 5 | #' 6 | #' @param Cm Midship area coefficient (vector of numericals, dimensionless) 7 | #' (see \code{\link{calcCm}}) 8 | #' @param breadth Moulded breadth (vector of numericals, m) 9 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 10 | #' 11 | #' @return \code{At} 12 | #' 13 | #' @references 14 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 15 | #'method." International Shipbuilding Progress 29. 16 | #' 17 | #'\href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 18 | #'Calculation from AIS." NTNU} 19 | #' 20 | #' @seealso \code{\link{calcCm}} 21 | #' 22 | #' @examples 23 | #'calcAt(0.98, 32, 10) 24 | #'calcAt(c(0.98,0.99), c(32,45.5), c(10,15.5)) 25 | #' 26 | #' @export 27 | 28 | calcAt <-function(Cm, breadth, maxDraft){ 29 | 30 | At<- 0.051*Cm*breadth*maxDraft 31 | 32 | return(At) 33 | } 34 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcShipM.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcShipM.r 3 | \name{calcShipM} 4 | \alias{calcShipM} 5 | \title{calcShipM} 6 | \usage{ 7 | calcShipM(actualDisplacement, lwl) 8 | } 9 | \arguments{ 10 | \item{actualDisplacement}{Actual loaded displacement (vector of 11 | numericals, m^3) (see \code{\link{calcActualDisp}})} 12 | 13 | \item{lwl}{Waterline length (vector of numericals, m) (see 14 | \code{\link{calclwl}})} 15 | } 16 | \value{ 17 | \code{M} (vector of numericals, dimensionless) 18 | } 19 | \description{ 20 | Calculate the fineness/slenderness ratio (\code{M}) 21 | (dimensionless) of the ship. 22 | } 23 | \examples{ 24 | calcShipM(73663,218) 25 | calcShipM(c(73663,216726),c(218,400)) 26 | 27 | } 28 | \references{ 29 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 30 | Solutions. 2011. "Basic Principles of Propulsion."} 31 | } 32 | \seealso{ 33 | \itemize{ 34 | \item \code{\link{calcActualDisp}} 35 | \item \code{\link{calclwl}} 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcAt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcAt.r 3 | \name{calcAt} 4 | \alias{calcAt} 5 | \title{calcAt} 6 | \usage{ 7 | calcAt(Cm, breadth, maxDraft) 8 | } 9 | \arguments{ 10 | \item{Cm}{Midship area coefficient (vector of numericals, dimensionless) 11 | (see \code{\link{calcCm}})} 12 | 13 | \item{breadth}{Moulded breadth (vector of numericals, m)} 14 | 15 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 16 | } 17 | \value{ 18 | \code{At} 19 | } 20 | \description{ 21 | Estimate transom area (\code{At}) (m^2) using method in Rakke 22 | (2016). 23 | } 24 | \examples{ 25 | calcAt(0.98, 32, 10) 26 | calcAt(c(0.98,0.99), c(32,45.5), c(10,15.5)) 27 | 28 | } 29 | \references{ 30 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 31 | method." International Shipbuilding Progress 29. 32 | 33 | \href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship Emissions 34 | Calculation from AIS." NTNU} 35 | } 36 | \seealso{ 37 | \code{\link{calcCm}} 38 | } 39 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHullEff.r: -------------------------------------------------------------------------------- 1 | #' @title calcHullEff 2 | #' 3 | #' @description Calculate the hull efficiency (\code{hullEff}) (dimensionless) 4 | #' for a specified vessel. 5 | #' 6 | #' @param thrustFactor Thrust deduction coefficient (vector of numericals, dimensionless) 7 | #' (see \code{\link{calcHMThrustFactor}} and \code{\link{calcKristThrustFactor}}) 8 | #' @param wakeFraction Wake fraction coefficient (vector of numericals, dimensionless) 9 | #' (see \code{\link{calcHMWakeFraction}} and \code{\link{calcKristWakeFrac}}) 10 | #' 11 | #'@seealso \itemize{ 12 | #'\item \code{\link{calcHMThrustFactor}} 13 | #'\item \code{\link{calcKristThrustFactor}} 14 | #'\item \code{\link{calcHMWakeFraction}} 15 | #'\item \code{\link{calcKristWakeFrac}}} 16 | #' 17 | #' @return \code{hullEff} (vector of numericals, dimensionless) 18 | #' 19 | #' @examples 20 | #' calcHullEff(c(0.19,0.17), c(0.32,0.29)) 21 | #' 22 | #' @export 23 | 24 | calcHullEff <- function(thrustFactor, wakeFraction ){ 25 | 26 | hullEff<- (1-thrustFactor)/(1-wakeFraction) 27 | 28 | 29 | return(hullEff) 30 | } 31 | -------------------------------------------------------------------------------- /ShipEF/man/Boiler_HC_CO_EF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{Boiler_HC_CO_EF} 5 | \alias{Boiler_HC_CO_EF} 6 | \title{CO and HC emissions factors (g/kWh) for boiler engines.} 7 | \format{ 8 | A data frame with 1 row and 4 variables: 9 | \describe{ 10 | \item{engineType}{boiler engine type signified by "Boiler"} 11 | \item{co}{CO C3 marine vessel boiler engine emission factors (g/kWh)} 12 | \item{hc}{Hydrocarbon C3 marine vessel boiler engine emission factors (g/kWh)} 13 | \item{Source}{Character string describing source of specific emission factor for each engine type} 14 | } 15 | } 16 | \usage{ 17 | data(Boiler_HC_CO_EF) 18 | } 19 | \description{ 20 | CO and HC emissions factors (g/kWh) for boiler engines. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO.r} \code{calcEF_HC.r} 24 | } 25 | \examples{ 26 | assign("EF",get(utils::data(Boiler_HC_CO_EF))) 27 | 28 | } 29 | \references{ 30 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 31 | } 32 | \keyword{datasets} 33 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHullEff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHullEff.r 3 | \name{calcHullEff} 4 | \alias{calcHullEff} 5 | \title{calcHullEff} 6 | \usage{ 7 | calcHullEff(thrustFactor, wakeFraction) 8 | } 9 | \arguments{ 10 | \item{thrustFactor}{Thrust deduction coefficient (vector of numericals, dimensionless) 11 | (see \code{\link{calcHMThrustFactor}} and \code{\link{calcKristThrustFactor}})} 12 | 13 | \item{wakeFraction}{Wake fraction coefficient (vector of numericals, dimensionless) 14 | (see \code{\link{calcHMWakeFraction}} and \code{\link{calcKristWakeFrac}})} 15 | } 16 | \value{ 17 | \code{hullEff} (vector of numericals, dimensionless) 18 | } 19 | \description{ 20 | Calculate the hull efficiency (\code{hullEff}) (dimensionless) 21 | for a specified vessel. 22 | } 23 | \examples{ 24 | calcHullEff(c(0.19,0.17), c(0.32,0.29)) 25 | 26 | } 27 | \seealso{ 28 | \itemize{ 29 | \item \code{\link{calcHMThrustFactor}} 30 | \item \code{\link{calcKristThrustFactor}} 31 | \item \code{\link{calcHMWakeFraction}} 32 | \item \code{\link{calcKristWakeFrac}}} 33 | } 34 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcTEU.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcTEU.r 3 | \name{calcTEU} 4 | \alias{calcTEU} 5 | \title{calcTEU} 6 | \usage{ 7 | calcTEU(shipType, dwt) 8 | } 9 | \arguments{ 10 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}}), 11 | determined by Stat 5 code, \itemize{ 12 | \item"container.ship" 13 | \item"bulk.carrier" 14 | \item"tanker" 15 | \item"general.cargo" 16 | \item"vehicle.carrier" 17 | \item"reefer" 18 | \item"ro.ro" 19 | \item"passenger" 20 | \item"tug" 21 | \item"misc" 22 | }} 23 | 24 | \item{dwt}{Ship maximum deadweight tonnage (vector of numericals, tonnage)} 25 | } 26 | \value{ 27 | TEU (vector of numericals) 28 | } 29 | \description{ 30 | Estimate vessel size in twenty-foot equivalent units (TEUs) from 31 | deadweight tonnage (\code{dwt}) for container ships. 32 | } 33 | \examples{ 34 | calcTEU(c("bulk.carrier","container.ship"), c(70000,191144)) 35 | 36 | } 37 | \references{ 38 | \href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 39 | "Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 40 | } 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 U.S. Environmental Protection Agency 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ShipEF/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 U.S. Environmental Protection Agency 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ShipPowerModel/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 U.S. Environmental Protection Agency 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcPropNum.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcPropNum.r 3 | \name{calcPropNum} 4 | \alias{calcPropNum} 5 | \title{calcPropNum} 6 | \usage{ 7 | calcPropNum( 8 | shipType, 9 | paxTugShipTypes = c("cruise.ed", "passenger", "ferry.pax", "ferry.ro.pax", "cruise", 10 | "yacht", "tug", "service.tug") 11 | ) 12 | } 13 | \arguments{ 14 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}})} 15 | 16 | \item{paxTugShipTypes}{Ship types specified in input \code{shipTypes} to 17 | be modeled as passenger and tug vessels. (vector of strings)} 18 | } 19 | \value{ 20 | \code{nProp} (vector of numericals) 21 | } 22 | \description{ 23 | Calculate number of propellers (\code{nProp}) by ship type 24 | trends. 25 | } 26 | \details{ 27 | Based on a sample of 2,700 ships from Clarksons. 28 | 29 | This method this requires ship types to be grouped. Use the 30 | \code{paxTugShipTypes} grouping parameter to provide these ship type 31 | groupings. Any ship types not included in these groupings will be considered 32 | as miscellaneous vessels. 33 | } 34 | \examples{ 35 | calcPropNum(c("container.ship","bulk.carrier","tug")) 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ShipEF/man/LLAFCoeff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{LLAFCoeff} 5 | \alias{LLAFCoeff} 6 | \title{Coefficients required to calculate low load adjustment per pollutant when main engine load is below 20 percent its total installed power.} 7 | \format{ 8 | A data frame with 7 rows and 4 variables: 9 | \describe{ 10 | \item{pollutant}{Pollutant for which emissions are being calculated at low loads.} 11 | \item{a}{Coefficient required to calculate low load adjustment for each pollutant.} 12 | \item{x}{Coefficient required to calculate low load adjustment for each pollutant.} 13 | \item{b}{Coefficient required to calculate low load adjustment for each pollutant.} 14 | } 15 | } 16 | \usage{ 17 | data(LLAFCoeff) 18 | } 19 | \description{ 20 | Coefficients required to calculate low load adjustment per pollutant when main engine load is below 20 percent its total installed power. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF.r} 24 | } 25 | \examples{ 26 | data(LLAFCoeff) 27 | } 28 | \references{ 29 | EPA. Regulatory Impact Analysis: Control of Emissions of Air Pollution from Category 3 Marine Deisel Engines, 2009. 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcAbt.r: -------------------------------------------------------------------------------- 1 | #'@title calcAbt 2 | #' 3 | #'@description Estimate transverse bulb area (\code{Abt}) (m^2) using method in 4 | #'Rakke (2016). 5 | #' 6 | #'@param Cm Midship area coefficient (dimensionless) (see \code{\link{calcCm}}) 7 | #'@param breadth Moulded breadth (m) 8 | #'@param actualDraft Actual draft (m) 9 | #' 10 | #'@details 11 | #'Transverse sectional area of the bulb at the position where the still-water 12 | #'surface intersects the stem (m^2) using actual draft. Actual draft is 13 | #'typically obtained from sources such as AIS messages or ship records. 14 | #' 15 | #'@return \code{Abt} (vector of numericals, m^2) 16 | #' 17 | #'@references 18 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 19 | #'method." International Shipbuilding Progress 29. p. 166-170 20 | #' 21 | #'\href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship 22 | #'Emissions Calculation from AIS." NTNU} 23 | #' 24 | #'@seealso \code{\link{calcCm}} 25 | #' 26 | #'@examples 27 | #'calcAbt(0.98, 32, 10) 28 | #'calcAbt(c(0.98,0.99), c(32,45.5), c(10,15.5)) 29 | #' 30 | #'@export 31 | 32 | calcAbt <-function(Cm, breadth, actualDraft){ 33 | 34 | Abt<-0.08*Cm*breadth*actualDraft 35 | 36 | return(Abt) 37 | } 38 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcAbt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcAbt.r 3 | \name{calcAbt} 4 | \alias{calcAbt} 5 | \title{calcAbt} 6 | \usage{ 7 | calcAbt(Cm, breadth, actualDraft) 8 | } 9 | \arguments{ 10 | \item{Cm}{Midship area coefficient (dimensionless) (see \code{\link{calcCm}})} 11 | 12 | \item{breadth}{Moulded breadth (m)} 13 | 14 | \item{actualDraft}{Actual draft (m)} 15 | } 16 | \value{ 17 | \code{Abt} (vector of numericals, m^2) 18 | } 19 | \description{ 20 | Estimate transverse bulb area (\code{Abt}) (m^2) using method in 21 | Rakke (2016). 22 | } 23 | \details{ 24 | Transverse sectional area of the bulb at the position where the still-water 25 | surface intersects the stem (m^2) using actual draft. Actual draft is 26 | typically obtained from sources such as AIS messages or ship records. 27 | } 28 | \examples{ 29 | calcAbt(0.98, 32, 10) 30 | calcAbt(c(0.98,0.99), c(32,45.5), c(10,15.5)) 31 | 32 | } 33 | \references{ 34 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 35 | method." International Shipbuilding Progress 29. p. 166-170 36 | 37 | \href{http://hdl.handle.net/11250/2410741}{Rakke, S. G. 2016. "Ship 38 | Emissions Calculation from AIS." NTNU} 39 | } 40 | \seealso{ 41 | \code{\link{calcCm}} 42 | } 43 | -------------------------------------------------------------------------------- /ShipPowerModel/man/shipMap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{shipMap} 5 | \alias{shipMap} 6 | \title{Map between individual Clarkson's Vessel_Type and generalizable ship types used in IMO GHG 3 (imoShipType) and Starcrest (starcrestShipType) inventories.} 7 | \format{ 8 | A data frame with 341 rows and 3 variables: 9 | \describe{ 10 | \item{Vessel_Type}{Specific Clarkson's Vessel_Type. } 11 | \item{imoShipType}{Generalizable ship types alligning with IMO GHG 3 auxiliary and boiler loads.} 12 | \item{starcrestShipType}{Generalizable ship types alligning with starcrest 2016 auxiliary and boiler loads.} 13 | } 14 | } 15 | \usage{ 16 | data(shipMap) 17 | } 18 | \description{ 19 | Map between individual Clarkson's Vessel_Type and generalizable ship types used in IMO GHG 3 (imoShipType) and Starcrest (starcrestShipType) inventories. 20 | } 21 | \details{ 22 | This is used in \code{calcShipType.r} 23 | } 24 | \examples{ 25 | data(shipMap) 26 | } 27 | \references{ 28 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 29 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 30 | } 31 | \keyword{datasets} 32 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcPropNum.r: -------------------------------------------------------------------------------- 1 | #' @title calcPropNum 2 | #' 3 | #' @description Calculate number of propellers (\code{nProp}) by ship type 4 | #' trends. 5 | #' 6 | #'@param shipType Ship type (vector of strings, see \code{\link{calcShipType}}) 7 | #' @param paxTugShipTypes Ship types specified in input \code{shipTypes} to 8 | #' be modeled as passenger and tug vessels. (vector of strings) 9 | #' 10 | #' @details 11 | #' Based on a sample of 2,700 ships from Clarksons. 12 | #' 13 | #' This method this requires ship types to be grouped. Use the 14 | #' \code{paxTugShipTypes} grouping parameter to provide these ship type 15 | #' groupings. Any ship types not included in these groupings will be considered 16 | #' as miscellaneous vessels. 17 | #' 18 | #' @return \code{nProp} (vector of numericals) 19 | #' 20 | #' @examples 21 | #' calcPropNum(c("container.ship","bulk.carrier","tug")) 22 | #' 23 | #' @export 24 | 25 | calcPropNum <-function(shipType, paxTugShipTypes=c( 26 | "cruise.ed","passenger","ferry.pax","ferry.ro.pax","cruise","yacht","tug","service.tug")){ 27 | #2. Determine number of propellers 28 | 29 | nprop<-ifelse(#case 30 | (shipType %in% paxTugShipTypes), 31 | #if true return: 32 | 2, 33 | #otherwise return: 34 | 1 35 | )#end ifelse 36 | return(nprop) 37 | } 38 | -------------------------------------------------------------------------------- /ShipEF/man/Aux_HC_CO_EF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{Aux_HC_CO_EF} 5 | \alias{Aux_HC_CO_EF} 6 | \title{CO and HC emissions factors (g/kWh) for auxiliary engines, by engine type.} 7 | \format{ 8 | A data frame with 3 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{auxiliary engine type, HSD=High Speed Diesel,MSD=Medium Speed Diesel,LNG=Liquid Natural Gas} 11 | \item{co}{CO C3 marine vessel auxiliary engine emission factors (g/kWh)} 12 | \item{hc}{Hydrocarbon C3 marine vessel auxiliary engine emission factors (g/kWh)} 13 | \item{Source}{Character string describing source of specific emission factor for each engine type} 14 | } 15 | } 16 | \usage{ 17 | data(Aux_HC_CO_EF) 18 | } 19 | \description{ 20 | CO and HC emissions factors (g/kWh) for auxiliary engines, by engine type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO.r} \code{calcEF_HC.r} 24 | } 25 | \examples{ 26 | assign("EF",get(utils::data(Aux_HC_CO_EF))) 27 | 28 | } 29 | \references{ 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 32 | } 33 | \keyword{datasets} 34 | -------------------------------------------------------------------------------- /ShipEF/man/BoilerFuelMixTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{BoilerFuelMixTable} 5 | \alias{BoilerFuelMixTable} 6 | \title{Fuel Mix Table for boilers, by fuel type, engine type, and location.} 7 | \format{ 8 | A data frame with 6 rows and 4 variables: 9 | \describe{ 10 | \item{Location}{Vessel location indicating fuel use patterns and fuel sulfur level per region. ECA indicates North American Emission Control Area} 11 | \item{engineType}{Boiler engine type, "Boiler"} 12 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil"} 13 | \item{Proportion}{Indicates the proportion of vessels per engine type (from 0 to 1) which use each possible fuel within each region. Used to to calculate weighted average emission factors when vessel specific fuel information is not available. } 14 | } 15 | } 16 | \usage{ 17 | data(BoilerFuelMixTable) 18 | } 19 | \description{ 20 | Fuel Mix Table for boilers, by fuel type, engine type, and location. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r}\code{calcEF_NOx.r}\code{calcEF_PM.r}\code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("fuelMixTable",get(utils::data(BoilerFuelMixTable))) 27 | 28 | } 29 | \keyword{datasets} 30 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcCwp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcCwp.r 3 | \name{calcCwp} 4 | \alias{calcCwp} 5 | \title{calcCwp} 6 | \usage{ 7 | calcCwp(Cbw, CwpEquationType) 8 | } 9 | \arguments{ 10 | \item{Cbw}{Waterline block coefficient (vector of numericals, 11 | dimensionless) (see \code{\link{calcCbw}})} 12 | 13 | \item{CwpEquationType}{Indicates equation type: 14 | \itemize{\item"kristensen"\item"schneekluth"} 15 | This argument is not vectorized, as it takes only a single string} 16 | } 17 | \value{ 18 | \code{Cwp} (vector of numericals, dimensionless) 19 | } 20 | \description{ 21 | Calculates the water plane area coefficient (\code{Cwp}) 22 | (dimensionless) using one of two methods (Kristensen or Schneekluth). 23 | } 24 | \details{ 25 | Kristensen: 26 | \deqn{Cwp = 0.55+0.45Cbw} 27 | 28 | Schneekluth: 29 | \deqn{Cwp = \frac{1+2Cbw}{3}}{Cwp = (1+2Cbw)/3} 30 | } 31 | \examples{ 32 | calcCwp(c(0.81,0.65),"kristensen") 33 | 34 | } 35 | \references{ 36 | Kristensen, H. O. and Lutzen, M. 2012. "Prediction of Resistance and Propulsion 37 | Power of Ships. Clean Shipping Currents, 1 (6). 38 | 39 | Schneekluth, H. and Bertram, V. 1998. "Ship Design for Efficiency and Economy." 40 | 2nd ed. Oxford, Boston: Butterworth-Heinemann. 41 | } 42 | \seealso{ 43 | \code{\link{calcCbw}} 44 | } 45 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcFroudeNum.r: -------------------------------------------------------------------------------- 1 | #' @title calcFroudeNum 2 | #' 3 | #' @description Calculate the Froude number (\code{froudeNum}) (dimensionless). 4 | #' 5 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 6 | #' \code{\link{calcSpeedUnitConversion}}) 7 | #' @param lwl Waterline length (vector of numericals, m) (see 8 | #' \code{\link{calclwl}}) 9 | #' 10 | #' @details 11 | #' The Froude number is a dimensionless coefficient that relates a vessel's speed 12 | #' and length to a relative resistance. The equation for the Froude number is: 13 | #' \deqn{Fn=\frac{V}{\sqrt{g*Lwl}}}{Fn=V/sqrt(g*lwl)} 14 | #' Where V is the ship's speed, g is the gravitational constant (9.81 m/s^2), 15 | #' and \code{lwl} is the waterline length (m) of the vessel. 16 | #' 17 | #' @return \code{froudeNum} (vector of numericals, dimensionless) 18 | #' 19 | #' @references 20 | #' \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 21 | #' Solutions. 2011. "Basic Principles of Propulsion."} 22 | #' 23 | #' @seealso \itemize{ 24 | #' \item \code{\link{calcSpeedUnitConversion}} 25 | #' \item \code{\link{calclwl}} 26 | #' } 27 | #' 28 | #' @examples 29 | #' calcFroudeNum(seq(1,5,1),214) 30 | #' 31 | #' @export 32 | 33 | calcFroudeNum <- function(shipSpeed, lwl){ 34 | 35 | froudeNum<-(shipSpeed)/((9.81*lwl)^0.5) 36 | 37 | return(froudeNum) 38 | } 39 | -------------------------------------------------------------------------------- /ShipPowerModel/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(calcAbt) 4 | export(calcActualDisp) 5 | export(calcAdmPwr) 6 | export(calcAt) 7 | export(calcAuxBoilerLoad) 8 | export(calcCb) 9 | export(calcCbw) 10 | export(calcCf) 11 | export(calcCm) 12 | export(calcCp) 13 | export(calcCwp) 14 | export(calcDispUnitConversion) 15 | export(calcFroudeNum) 16 | export(calcHMAppendageRes) 17 | export(calcHMBulbousBowRes) 18 | export(calcHMCa) 19 | export(calcHMFormFactor) 20 | export(calcHMImmersedTransomRes) 21 | export(calcHMPwr) 22 | export(calcHMThrustFactor) 23 | export(calcHMTotalRes) 24 | export(calcHMWakeFraction) 25 | export(calcHMWaveMakingRes) 26 | export(calcHMWettedSA) 27 | export(calcHullEff) 28 | export(calcKristCa) 29 | export(calcKristCaa) 30 | export(calcKristCr) 31 | export(calcKristPwr) 32 | export(calcKristThrustFactor) 33 | export(calcKristTotalRes) 34 | export(calcKristWakeFrac) 35 | export(calcKristWettedSA) 36 | export(calcOpenWaterEff) 37 | export(calcOperatingMode) 38 | export(calcPropDia) 39 | export(calcPropNum) 40 | export(calcPropPwr) 41 | export(calcResistanceShipPwr) 42 | export(calcShipM) 43 | export(calcShipType) 44 | export(calcSpeedUnitConversion) 45 | export(calcSubType) 46 | export(calcTEU) 47 | export(calchb) 48 | export(calclcb) 49 | export(calclwl) 50 | import(data.table) 51 | importFrom(utils,data) 52 | importFrom(utils,tail) 53 | -------------------------------------------------------------------------------- /ShipEF/man/CO2ConversionFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{CO2ConversionFactor} 5 | \alias{CO2ConversionFactor} 6 | \title{Conversion factors to produce CO2 emission factors from BSFC values by fuel type.} 7 | \format{ 8 | A data frame with 3 rows and 3 variables: 9 | \describe{ 10 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 11 | \item{conversionFactor}{Conversion factors to convert BSFC values to CO2 emission factors.} 12 | \item{Source}{Character string describing source of each CO2 conversion factor by fuel type.} 13 | } 14 | } 15 | \usage{ 16 | data(CO2ConversionFactor) 17 | } 18 | \description{ 19 | Conversion factors to produce CO2 emission factors from BSFC values by fuel type. 20 | } 21 | \details{ 22 | This data is used in \code{calcEF_CO2.r} 23 | } 24 | \examples{ 25 | data(CO2ConversionFactor) 26 | 27 | } 28 | \references{ 29 | Marine Environmental Protection Committee. 2012 Guidelines on the Method of Calculation of the Attained Energy Efficiency Design Index (EEDI) for New Ships (MEPC 63/28 Annex 8), March 2012. 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | } 32 | \keyword{datasets} 33 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcTEU.r: -------------------------------------------------------------------------------- 1 | #'@title calcTEU 2 | #' 3 | #' @description Estimate vessel size in twenty-foot equivalent units (TEUs) from 4 | #' deadweight tonnage (\code{dwt}) for container ships. 5 | #' 6 | #'@param shipType Ship type (vector of strings, see \code{\link{calcShipType}}), 7 | #'determined by Stat 5 code, \itemize{ 8 | #' \item"container.ship" 9 | #' \item"bulk.carrier" 10 | #' \item"tanker" 11 | #' \item"general.cargo" 12 | #' \item"vehicle.carrier" 13 | #' \item"reefer" 14 | #' \item"ro.ro" 15 | #' \item"passenger" 16 | #' \item"tug" 17 | #' \item"misc" 18 | #'} 19 | #' @param dwt Ship maximum deadweight tonnage (vector of numericals, tonnage) 20 | #' 21 | #' @return TEU (vector of numericals) 22 | #' 23 | #' @references 24 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 25 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 26 | #' 27 | #' @examples 28 | #' calcTEU(c("bulk.carrier","container.ship"), c(70000,191144)) 29 | #' 30 | #' @export 31 | 32 | calcTEU<- function(shipType, dwt){ 33 | TEU<-ifelse(shipType=="container.ship", 34 | ifelse( #case 1 Feeder 35 | dwt <= 35000,((dwt/15.19)^(1/0.9814)), 36 | ifelse(#case 2 Panamax 37 | dwt <= 60000,((dwt/28.81)^(1/0.902)), 38 | ((dwt/37)^(1/0.875)) 39 | ) 40 | ),0 41 | ) 42 | return(TEU) 43 | } 44 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcFroudeNum.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcFroudeNum.r 3 | \name{calcFroudeNum} 4 | \alias{calcFroudeNum} 5 | \title{calcFroudeNum} 6 | \usage{ 7 | calcFroudeNum(shipSpeed, lwl) 8 | } 9 | \arguments{ 10 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 11 | \code{\link{calcSpeedUnitConversion}})} 12 | 13 | \item{lwl}{Waterline length (vector of numericals, m) (see 14 | \code{\link{calclwl}})} 15 | } 16 | \value{ 17 | \code{froudeNum} (vector of numericals, dimensionless) 18 | } 19 | \description{ 20 | Calculate the Froude number (\code{froudeNum}) (dimensionless). 21 | } 22 | \details{ 23 | The Froude number is a dimensionless coefficient that relates a vessel's speed 24 | and length to a relative resistance. The equation for the Froude number is: 25 | \deqn{Fn=\frac{V}{\sqrt{g*Lwl}}}{Fn=V/sqrt(g*lwl)} 26 | Where V is the ship's speed, g is the gravitational constant (9.81 m/s^2), 27 | and \code{lwl} is the waterline length (m) of the vessel. 28 | } 29 | \examples{ 30 | calcFroudeNum(seq(1,5,1),214) 31 | 32 | } 33 | \references{ 34 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 35 | Solutions. 2011. "Basic Principles of Propulsion."} 36 | } 37 | \seealso{ 38 | \itemize{ 39 | \item \code{\link{calcSpeedUnitConversion}} 40 | \item \code{\link{calclwl}} 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcCwp.r: -------------------------------------------------------------------------------- 1 | #' @title calcCwp 2 | #' 3 | #' @description Calculates the water plane area coefficient (\code{Cwp}) 4 | #' (dimensionless) using one of two methods (Kristensen or Schneekluth). 5 | #' 6 | #' @param Cbw Waterline block coefficient (vector of numericals, 7 | #' dimensionless) (see \code{\link{calcCbw}}) 8 | #' @param CwpEquationType Indicates equation type: 9 | #' \itemize{\item"kristensen"\item"schneekluth"} 10 | #' This argument is not vectorized, as it takes only a single string 11 | #' 12 | #' @details 13 | #'Kristensen: 14 | #'\deqn{Cwp = 0.55+0.45Cbw} 15 | #' 16 | #'Schneekluth: 17 | #'\deqn{Cwp = \frac{1+2Cbw}{3}}{Cwp = (1+2Cbw)/3} 18 | #' 19 | #' @return \code{Cwp} (vector of numericals, dimensionless) 20 | #' 21 | #' @references 22 | #'Kristensen, H. O. and Lutzen, M. 2012. "Prediction of Resistance and Propulsion 23 | #'Power of Ships. Clean Shipping Currents, 1 (6). 24 | #' 25 | #'Schneekluth, H. and Bertram, V. 1998. "Ship Design for Efficiency and Economy." 26 | #'2nd ed. Oxford, Boston: Butterworth-Heinemann. 27 | #' 28 | #' @seealso \code{\link{calcCbw}} 29 | #' 30 | #' @examples 31 | #' calcCwp(c(0.81,0.65),"kristensen") 32 | #' 33 | #' @export 34 | 35 | calcCwp <- function(Cbw, CwpEquationType){ 36 | 37 | if(grepl("kristensen", tolower(CwpEquationType))){ 38 | Cwp<-0.55+0.45*Cbw 39 | }else{ 40 | Cwp<-(1+2*Cbw)/3 41 | } 42 | 43 | 44 | return(Cwp) 45 | 46 | } 47 | -------------------------------------------------------------------------------- /ShipEF/man/AuxFuelMixTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{AuxFuelMixTable} 5 | \alias{AuxFuelMixTable} 6 | \title{Fuel Mix Table for auxiliary engines, by fuel type, engine type, and location.} 7 | \format{ 8 | A data frame with 15 rows and 4 variables: 9 | \describe{ 10 | \item{Location}{Vessel location indicating fuel use patterns and fuel sulfur level per region. ECA indicates North American Emission Control Area} 11 | \item{engineType}{Auxiliary engine type, "HSD"="High Speed Diesel","MSD"="Medium Speed Diesel","LNG"="Liquid Natural Gas"} 12 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 13 | \item{Proportion}{Indicates the proportion of vessels per engine type (from 0 to 1) which use each possible fuel within each region. Used to to calculate weighted average emission factors when vessel specific fuel information is not available. } 14 | } 15 | } 16 | \usage{ 17 | data(AuxFuelMixTable) 18 | } 19 | \description{ 20 | Fuel Mix Table for auxiliary engines, by fuel type, engine type, and location. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r}\code{calcEF_NOx.r}\code{calcEF_PM.r}\code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("fuelMixTable",get(utils::data(AuxFuelMixTable))) 27 | 28 | } 29 | \keyword{datasets} 30 | -------------------------------------------------------------------------------- /ShipEF/man/BoilerBSFC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{BoilerBSFC} 5 | \alias{BoilerBSFC} 6 | \title{Brake specific fuel consumption (BSFC) (g/kWh) for boiler engines, by fuel type.} 7 | \format{ 8 | A data frame with 13 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{boiler engine type,signified as "Boiler"} 11 | \item{fuelType}{fuel type used by boiler engine: RM/HFO=Residual Marine/Heavy Fuel Oil,MGO/MDO=Marine Gas Oil/Marine Diesel Oil} 12 | \item{BSFC}{Brake specific fuel consumption rate for boiler engines (g/kWh)} 13 | \item{Source}{Character string describing source of each bsfc rate for each engine and fuel type} 14 | } 15 | } 16 | \usage{ 17 | data(BoilerBSFC) 18 | } 19 | \description{ 20 | Brake specific fuel consumption (BSFC) (g/kWh) for boiler engines, by fuel type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r} \code{calcEF_PM.r} \code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("EFBSFC",get(utils::data(BoilerBSFC))) 27 | 28 | } 29 | \references{ 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | IVL, David Cooper, and Tomas Gustafsson. Methodology for Calculating Emissions from Ships. 1. Update of Emission Factors, n.d., 47. 32 | Wartsila (2014). Solutions for marine and oil and gas markets. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipEF/man/MainFuelMixTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{MainFuelMixTable} 5 | \alias{MainFuelMixTable} 6 | \title{Fuel Mix Table for main propulsive engines, by fuel type, engine type, and location.} 7 | \format{ 8 | A data frame with 39 rows and 4 variables: 9 | \describe{ 10 | \item{Location}{Vessel location indicating fuel use patterns and fuel sulfur level per region. ECA indicates North American Emission Control Area} 11 | \item{engineType}{Main engine type, "HSD"="High Speed Diesel","MSD"="Medium Speed Diesel","LNG"="Liquid Natural Gas"} 12 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 13 | \item{Proportion}{Indicates the proportion of vessels per engine type (from 0 to 1) which use each possible fuel within each region. Used to to calculate weighted average emission factors when vessel specific fuel information is not available. } 14 | } 15 | } 16 | \usage{ 17 | data(MainFuelMixTable) 18 | } 19 | \description{ 20 | Fuel Mix Table for main propulsive engines, by fuel type, engine type, and location. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r}\code{calcEF_NOx.r}\code{calcEF_PM.r}\code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("fuelMixTable",get(utils::data(MainFuelMixTable))) 27 | 28 | } 29 | \keyword{datasets} 30 | -------------------------------------------------------------------------------- /ShipEF/man/BoilerNOxEF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{BoilerNOxEF} 5 | \alias{BoilerNOxEF} 6 | \title{NOx emission factors (g/kWh) for boilers, by fuel type, engine type, and engine tier.} 7 | \format{ 8 | A data frame with 2 rows and 5 variables: 9 | \describe{ 10 | \item{engineType}{boiler engine type, "Boiler"} 11 | \item{fuelType}{fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil"} 12 | \item{tier}{Engine regulatory tier (per IMO regulations). Defined by \code{calcTier.r}} 13 | \item{nox}{NOx emission factors (g/kWh) per engine type, fuel type and tier} 14 | \item{Source}{Character string describing source of each NOx emission factor for each engine, fuel type and tier.} 15 | } 16 | } 17 | \usage{ 18 | data(BoilerNOxEF) 19 | } 20 | \description{ 21 | NOx emission factors (g/kWh) for boilers, by fuel type, engine type, and engine tier. 22 | } 23 | \details{ 24 | This data is used in \code{calcEF_NOx.r} 25 | } 26 | \examples{ 27 | assign("EF",get(utils::data(BoilerNOxEF))) 28 | 29 | } 30 | \references{ 31 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 32 | Starcrest Consulting Group,LLC.2014 Multi-Facility Emissions Inventory of Cargo Handling Equipment, Heavy-Duty Diesel Vehicles, Railroad Locomotives, and Commercial Marine Vessels. Starcrest Consulting Group,LLC, February 2016. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipEF/man/AuxBSFC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{AuxBSFC} 5 | \alias{AuxBSFC} 6 | \title{Brake specific fuel consumption (BSFC) (g/kWh) for auxiliary engines, by engine and fuel type.} 7 | \format{ 8 | A data frame with 4 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{auxiliary engine type, HSD=High Speed Diesel,MSD=Medium Speed Diesel,LNG=Liquid Natural Gas} 11 | \item{fuelType}{fuel type used by vessel: RM/HFO=Residual Marine/Heavy Fuel Oil,MGO/MDO=Marine Gas Oil/Marine Diesel Oil,LNG=Liquid Natural Gas} 12 | \item{BSFC}{Brake specific fuel consumption rate for auxiliary engines (g/kWh)} 13 | \item{Source}{Character string describing source of each bsfc rate for each engine and fuel type} 14 | } 15 | } 16 | \usage{ 17 | data(AuxBSFC) 18 | } 19 | \description{ 20 | Brake specific fuel consumption (BSFC) (g/kWh) for auxiliary engines, by engine and fuel type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r} \code{calcEF_PM.r} \code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("EF",get(utils::data(AuxBSFC))) 27 | 28 | } 29 | \references{ 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | IVL, David Cooper, and Tomas Gustafsson. Methodology for Calculating Emissions from Ships. 1. Update of Emission Factors. n.d., 47. 32 | Wartsila (2014). Solutions for marine and oil and gas markets. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipEF/man/EFSulfurEQCoefficients.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{EFSulfurEQCoefficients} 5 | \alias{EFSulfurEQCoefficients} 6 | \title{Coefficients required to calculate PM emission factors (g/kWh) per fuel type for diesel engines.} 7 | \format{ 8 | A data frame with 2 rows and 5 variables: 9 | \describe{ 10 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil"} 11 | \item{MWR}{Molecular weight ratio of sulfate PM to sulfur (224/32=7).} 12 | \item{FSC}{Percantage of sulfur in fuel that is converted to direct sulfate PM.} 13 | \item{Snom}{Nominal fuel sulfur level.} 14 | \item{PMnom}{Base PM emission rate for a fuel sulfur level of 0\%.} 15 | \item{Source}{Character string describing source of each CO2 conversion factor by fuel type.} 16 | } 17 | } 18 | \usage{ 19 | data(EFSulfurEQCoefficients) 20 | } 21 | \description{ 22 | Coefficients required to calculate PM emission factors (g/kWh) per fuel type for diesel engines. 23 | } 24 | \details{ 25 | This data is used in \code{calcEF_PM.r} 26 | } 27 | \examples{ 28 | data(EFSulfurEQCoefficients) 29 | } 30 | \references{ 31 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 32 | EPA. Regulatory Impact Analysis: Control of Emissions of Air Pollution from Category 3 Marine Deisel Engines, 2009. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipEF/man/calcLoadBSFC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcLoadBSFC.r 3 | \name{calcLoadBSFC} 4 | \alias{calcLoadBSFC} 5 | \title{calcLoadBSFC} 6 | \usage{ 7 | calcLoadBSFC(loadFactor = NULL, BSFC_Baseline) 8 | } 9 | \arguments{ 10 | \item{loadFactor}{Fraction of total installed propulsive power representing 11 | the instantaneous or average propulsive power (unitless) (vector of 12 | numericals) (see ShipPowerModel library). If \code{NA} is supplied, the 13 | baseline BSFC value is returned (i.e., the resulting emission factor will be 14 | independent of engine load).} 15 | 16 | \item{BSFC_Baseline}{Baseline BSFC value (g/kWh) (vector of numericals)} 17 | } 18 | \value{ 19 | \code{BSFC} (g/kWh) (vector of numericals) 20 | } 21 | \description{ 22 | Calculates Brake Specific Fuel Consumption (BSFC) or Specific Oil 23 | Fuel Consumption (SFOC) using a parabolic relationship with the main engine 24 | load factor. 25 | } 26 | \examples{ 27 | calcLoadBSFC(c(NA, 0.5, 0.7),c(185,195,300)) 28 | 29 | } 30 | \references{ 31 | International Maritime Organization. 2014. "Third IMO GHG study 2014 - Final 32 | report." London: International Maritime Organization. 33 | 34 | \href{https://doi.org/10.5194/acp-12-2641-2012}{Jalkanen, J.-P., Johansson 35 | L., Kukkonen, J., Brink, A., Kalli, J., and Stipa , T. 2012. "Extension of an 36 | assessment model of ship traffic exhaust emissions for particulate matter and 37 | carbon monoxide. Atmospheric Chemistry and Physics 12, no. 5.} 38 | } 39 | -------------------------------------------------------------------------------- /ShipEF/man/AuxNOxEF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{AuxNOxEF} 5 | \alias{AuxNOxEF} 6 | \title{NOx emission factors (g/kWh) for auxiliary engines, by fuel type, engine type, and engine tier.} 7 | \format{ 8 | A data frame with 17 rows and 5 variables: 9 | \describe{ 10 | \item{engineType}{auxiliary engine type, "HSD"="High Speed Diesel","MSD"="Medium Speed Diesel","LNG"="Liquid Natural Gas"} 11 | \item{fuelType}{fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 12 | \item{tier}{Engine regulatory tier (per IMO regulations). Defined by \code{calcTier.r}} 13 | \item{nox}{NOx emission factors (g/kWh) per engine type, fuel type and tier} 14 | \item{Source}{Character string describing source of each NOx emission factor for each engine, fuel type and tier.} 15 | } 16 | } 17 | \usage{ 18 | data(AuxNOxEF) 19 | } 20 | \description{ 21 | NOx emission factors (g/kWh) for auxiliary engines, by fuel type, engine type, and engine tier. 22 | } 23 | \details{ 24 | This data is used in \code{calcEF_NOx.r} 25 | } 26 | \examples{ 27 | assign("EF",get(utils::data(AuxNOxEF))) 28 | 29 | } 30 | \references{ 31 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 32 | Starcrest Consulting Group, LLC. San Pedro Bay Ports Emissions Inventory Methodology Report Version 2, 2021. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipEF/man/EF_PM_ST_GT_LNG.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{EF_PM_ST_GT_LNG} 5 | \alias{EF_PM_ST_GT_LNG} 6 | \title{PM10 emission factors (g/kWh) for non diesel engines per fuel type and engine type.} 7 | \format{ 8 | A data frame with 7 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{Non-diesel engine type: "ST"="Steam Turbine","GT"="Gas Turbine","GT-ED"="Gas Turbine Electic Diesel","LNG"="Liquid Natural Gas"} 11 | \item{fuelType}{Fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 12 | \item{pm10EF}{PM10 emission factors (g/kWh) per engine type and fuel type.} 13 | \item{Source}{Character string describing source of each PM emission factors by fuel and engine type.} 14 | } 15 | } 16 | \usage{ 17 | data(EF_PM_ST_GT_LNG) 18 | } 19 | \description{ 20 | PM10 emission factors (g/kWh) for non diesel engines per fuel type and engine type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_PM.r} 24 | } 25 | \examples{ 26 | data(EF_PM_ST_GT_LNG) 27 | } 28 | \references{ 29 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 30 | IVL, David Cooper, and Tomas Gustafsson. Methodology for Calculating Emissions from Ships. 1. Update of Emission Factors, n.d., 47. 31 | Kristensen, Hans Otto. Energy Demand and Exhaust Gas Emissions of Marine Engines, 2012, 30. 32 | } 33 | \keyword{datasets} 34 | -------------------------------------------------------------------------------- /ShipEF/R/calcLoadBSFC.r: -------------------------------------------------------------------------------- 1 | #' @title calcLoadBSFC 2 | #' 3 | #' @description Calculates Brake Specific Fuel Consumption (BSFC) or Specific Oil 4 | #' Fuel Consumption (SFOC) using a parabolic relationship with the main engine 5 | #' load factor. 6 | #' 7 | #' @param loadFactor Fraction of total installed propulsive power representing 8 | #' the instantaneous or average propulsive power (unitless) (vector of 9 | #' numericals) (see ShipPowerModel library). If \code{NA} is supplied, the 10 | #' baseline BSFC value is returned (i.e., the resulting emission factor will be 11 | #' independent of engine load). 12 | #' @param BSFC_Baseline Baseline BSFC value (g/kWh) (vector of numericals) 13 | #' 14 | #' @return \code{BSFC} (g/kWh) (vector of numericals) 15 | #' 16 | #' @references 17 | #'International Maritime Organization. 2014. "Third IMO GHG study 2014 - Final 18 | #'report." London: International Maritime Organization. 19 | #' 20 | #' \href{https://doi.org/10.5194/acp-12-2641-2012}{Jalkanen, J.-P., Johansson 21 | #' L., Kukkonen, J., Brink, A., Kalli, J., and Stipa , T. 2012. "Extension of an 22 | #' assessment model of ship traffic exhaust emissions for particulate matter and 23 | #' carbon monoxide. Atmospheric Chemistry and Physics 12, no. 5.} 24 | #' 25 | #' @examples 26 | #' calcLoadBSFC(c(NA, 0.5, 0.7),c(185,195,300)) 27 | #' 28 | #' @export 29 | 30 | calcLoadBSFC<- function(loadFactor=NULL, BSFC_Baseline){ 31 | BSFC<-ifelse(is.na(loadFactor), 32 | BSFC_Baseline, 33 | BSFC_Baseline*(0.455*((loadFactor)^2)-0.71*loadFactor+1.28) 34 | ) 35 | return(BSFC) 36 | } 37 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcActualDisp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcActualDisp.r 3 | \name{calcActualDisp} 4 | \alias{calcActualDisp} 5 | \title{calcActualDisp} 6 | \usage{ 7 | calcActualDisp(Cb, Cbw, actualDraft, maxDraft, maxDisplacement) 8 | } 9 | \arguments{ 10 | \item{Cb}{Maximum block coefficient (vector of numericals, dimensionless) (see \code{\link{calcCb}})} 11 | 12 | \item{Cbw}{Waterline block coefficient (vector of numericals, dimensionless) (see \code{\link{calcCbw}})} 13 | 14 | \item{actualDraft}{Actual draft (vector of numericals, m)} 15 | 16 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 17 | 18 | \item{maxDisplacement}{Maximum ship displacement (vector of numericals, m^3)} 19 | } 20 | \value{ 21 | \code{actualDisplacement} (vector of numericals, m^3) 22 | } 23 | \description{ 24 | Estimate actual loaded displacement (\code{actualDisplacement}) 25 | (m^3) using a vessel's actual draft. 26 | } 27 | \details{ 28 | Loaded displacement is estimated using actual draft. Actual draft is 29 | typically obtained from sources such as AIS messages or ship records. 30 | Uses Riddlesworth method (MAN, 2011). 31 | } 32 | \examples{ 33 | calcActualDisp(c(0.82,0.66), c(0.81,0.65), c(12.5,11.1), c(13.6,11.5), c(80097,52382)) 34 | calcActualDisp(0.82, 0.81, 12.5, 13.6, 80097) 35 | 36 | } 37 | \references{ 38 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 39 | Solutions. 2011. "Basic Principles of Propulsion." pg. 9.} 40 | } 41 | \seealso{ 42 | \code{\link{calcCb}}, \code{\link{calcCbw}} 43 | } 44 | -------------------------------------------------------------------------------- /ShipEF/man/MainBSFC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{MainBSFC} 5 | \alias{MainBSFC} 6 | \title{Brake specific fuel consumption (BSFC) (g/kWh) for main engines, by engine and fuel type.} 7 | \format{ 8 | A data frame with 13 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{main engine type, SSD=Slow Speed Diesel,MSD=Medium Speed Diesel,LNG=Liquid Natural Gas,ST=Steam turbine,GT=Gas turbine,MSD-ED=Medium Speed Electric Diesel,GT-ED=Gas Turbine Electric Diesel} 11 | \item{fuelType}{fuel type used by vessel: RM/HFO=Residual Marine/Heavy Fuel Oil,MGO/MDO=Marine Gas Oil/Marine Diesel Oil,LNG=Liquid Natural Gas} 12 | \item{BSFC}{Brake specific fuel consumption rate for main engines (g/kWh)} 13 | \item{Source}{Character string describing source of each bsfc rate for each engine and fuel type} 14 | } 15 | } 16 | \usage{ 17 | data(MainBSFC) 18 | } 19 | \description{ 20 | Brake specific fuel consumption (BSFC) (g/kWh) for main engines, by engine and fuel type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO2.r} \code{calcEF_PM.r} \code{calcEF_SO2.r} 24 | } 25 | \examples{ 26 | assign("EFBSFC",get(utils::data(MainBSFC))) 27 | 28 | } 29 | \references{ 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | IVL, David Cooper, and Tomas Gustafsson. Methodology for Calculating Emissions from Ships. 1. Update of Emission Factors, n.d., 47. 32 | Wartsila (2014). Solutions for marine and oil and gas markets. 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcActualDisp.r: -------------------------------------------------------------------------------- 1 | #' @title calcActualDisp 2 | #' 3 | #' @description Estimate actual loaded displacement (\code{actualDisplacement}) 4 | #' (m^3) using a vessel's actual draft. 5 | #' 6 | #' @param Cb Maximum block coefficient (vector of numericals, dimensionless) (see \code{\link{calcCb}}) 7 | #' @param Cbw Waterline block coefficient (vector of numericals, dimensionless) (see \code{\link{calcCbw}}) 8 | #' @param actualDraft Actual draft (vector of numericals, m) 9 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 10 | #' @param maxDisplacement Maximum ship displacement (vector of numericals, m^3) 11 | #' 12 | #' @details 13 | #' Loaded displacement is estimated using actual draft. Actual draft is 14 | #' typically obtained from sources such as AIS messages or ship records. 15 | #' Uses Riddlesworth method (MAN, 2011). 16 | #' 17 | #' @return \code{actualDisplacement} (vector of numericals, m^3) 18 | #' 19 | #' @references 20 | #' \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 21 | #' Solutions. 2011. "Basic Principles of Propulsion." pg. 9.} 22 | #' 23 | #' @seealso \code{\link{calcCb}}, \code{\link{calcCbw}} 24 | #' 25 | #' @examples 26 | #' calcActualDisp(c(0.82,0.66), c(0.81,0.65), c(12.5,11.1), c(13.6,11.5), c(80097,52382)) 27 | #' calcActualDisp(0.82, 0.81, 12.5, 13.6, 80097) 28 | #' 29 | #' @export 30 | 31 | calcActualDisp <- function(Cb, Cbw, actualDraft, maxDraft, maxDisplacement){ 32 | 33 | actualDisplacement<- ((pmin(0.99, 34 | Cb 35 | ))/Cbw)*(actualDraft/maxDraft)*maxDisplacement 36 | return(actualDisplacement) 37 | 38 | } 39 | -------------------------------------------------------------------------------- /ShipEF/man/calcEF_HC.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcEF_HC.r 3 | \name{calcEF_HC} 4 | \alias{calcEF_HC} 5 | \title{calcEF_HC} 6 | \usage{ 7 | calcEF_HC(engineType, main_aux_boiler = "main") 8 | } 9 | \arguments{ 10 | \item{engineType}{Engine type (string or vector of strings) (see 11 | \code{\link{calcEngineType}}). Valid values are: \itemize{ 12 | \item "SSD" 13 | \item "MSD" 14 | \item "MSD-ED" 15 | \item "GT" 16 | \item "GT-ED" 17 | \item "ST" 18 | \item "LNG" 19 | \item "HSD" (auxiliary only) 20 | \item "Boiler" (boiler only) 21 | }} 22 | 23 | \item{main_aux_boiler}{Is this calculation for a propulsive (main), auxiliary 24 | (aux), or boiler engine? Options: \itemize{ 25 | \item "main" (Default) 26 | \item "aux" 27 | \item "boiler" 28 | }} 29 | } 30 | \value{ 31 | \code{EF_HC} (g/kWh) (vector of numericals) 32 | } 33 | \description{ 34 | Calculates the appropriate hydrocarbon (HC) emission factor (g/kWh) for 35 | the given parameters. 36 | } 37 | \details{ 38 | For more information about calculating HC emission factors, see Section 3.5.4 39 | of the Port Emissions Inventory Guidance. 40 | } 41 | \examples{ 42 | calcEF_HC(c("SSD","MSD","MSD-ED")) 43 | calcEF_HC(c("HSD","MSD","LNG"),main_aux_boiler="aux") 44 | calcEF_HC(c("Boiler"), main_aux_boiler="boiler") 45 | 46 | } 47 | \references{ 48 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 49 | "Ports Emissions Inventory Guidance: Methodologies for Estimating 50 | Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 51 | Office of Transportation and Air Quality. US Environmental Protection Agency.} 52 | } 53 | -------------------------------------------------------------------------------- /ShipPowerModel/tests/testthat/testPropellerLaw.r: -------------------------------------------------------------------------------- 1 | 2 | context("Test Ship Power Calculation for propeller law") 3 | 4 | test_that("calcPropPwr works for shipSpeed == serviceSpeed",{ 5 | expect_equal( calcPropPwr(shipSpeed=10, refSpeed=10, totalInstalledPwr=100, n=3, serviceMargin=0), 6 | 100*0.94^3 7 | ) 8 | 9 | }) 10 | 11 | test_that("calcPropPwr works for shipSpeed == maxSpeed",{ 12 | expect_equal( calcPropPwr(shipSpeed=10, refSpeed=10, totalInstalledPwr=100, n=3, serviceMargin=0, refSpeedType="maxSpeed"), 13 | 100 14 | ) 15 | 16 | }) 17 | 18 | test_that("serviceMargin has the intended effect",{ 19 | expect_equal( calcPropPwr(shipSpeed=9, refSpeed=10, totalInstalledPwr=100, n=3, serviceMargin=15, refSpeedType="maxSpeed"), 20 | 100*(0.9^3)*1.15 21 | ) 22 | 23 | }) 24 | 25 | 26 | test_that("maximum power output is 100% load",{ 27 | expect_equal( calcPropPwr(shipSpeed=20, refSpeed=10, totalInstalledPwr=100, n=3, serviceMargin=15), 28 | 100 29 | ) 30 | 31 | }) 32 | 33 | 34 | test_that("minimum non-zero power is 2% load",{ 35 | expect_equal( calcPropPwr(shipSpeed=0.2, refSpeed=10, totalInstalledPwr=100, n=3, serviceMargin=0), 36 | 2 37 | ) 38 | 39 | }) 40 | 41 | 42 | 43 | test_that("changing speed generates the correct power",{ 44 | shipSpeed <- 5 45 | refSpeed <- 10 46 | totalInstalledPwr <- 100 47 | n <- 3 48 | serviceMargin <- 0 49 | 50 | expect_equal( calcPropPwr(totalInstalledPwr, shipSpeed, refSpeed, serviceMargin, n), 51 | totalInstalledPwr*(0.94*shipSpeed/refSpeed)^n 52 | ) 53 | 54 | }) 55 | -------------------------------------------------------------------------------- /ShipEF/man/calcEF_CO.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcEF_CO.r 3 | \name{calcEF_CO} 4 | \alias{calcEF_CO} 5 | \title{calcEF_CO} 6 | \usage{ 7 | calcEF_CO(engineType, main_aux_boiler = "main") 8 | } 9 | \arguments{ 10 | \item{engineType}{Engine type (string or vector of strings) (see 11 | \code{\link{calcEngineType}}). Valid values are: \itemize{ 12 | \item "SSD" 13 | \item "MSD" 14 | \item "MSD-ED" 15 | \item "GT" 16 | \item "GT-ED" 17 | \item "ST" 18 | \item "LNG" 19 | \item "HSD" (auxiliary only) 20 | \item "Boiler" (boiler only) 21 | }} 22 | 23 | \item{main_aux_boiler}{Is this calculation for a propulsive (main), auxiliary 24 | (aux), or boiler engine? Options: \itemize{ 25 | \item "main" (Default) 26 | \item "aux" 27 | \item "boiler" 28 | }} 29 | } 30 | \value{ 31 | \code{EF_CO} (g/kWh) (vector of numericals) 32 | } 33 | \description{ 34 | Calculates the appropriate carbon monoxide (CO) emission factor (g/kWh) for 35 | the given parameters. 36 | } 37 | \details{ 38 | For more information about calculating CO emission factors, see Section 3.5.4 39 | of the Port Emissions Inventory Guidance. 40 | } 41 | \examples{ 42 | calcEF_CO(c("SSD","MSD","MSD-ED"), main_aux_boiler="main") 43 | calcEF_CO(c("HSD","MSD","LNG"), main_aux_boiler="aux") 44 | calcEF_CO(c("Boiler"), main_aux_boiler="boiler") 45 | 46 | } 47 | \references{ 48 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 49 | "Ports Emissions Inventory Guidance: Methodologies for Estimating 50 | Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 51 | Office of Transportation and Air Quality. US Environmental Protection Agency.} 52 | } 53 | -------------------------------------------------------------------------------- /ShipEF/R/ShipEF.r: -------------------------------------------------------------------------------- 1 | #' ShipEF: A package containing functions to assign marine vessel emission 2 | #' factors 3 | #' 4 | #' The ShipEF package by the U.S. Environmental Protection Agency provides 5 | #' functions for assigning emission factors to commercial marine vessels (CMV). 6 | #' For various pollutants, emission factors depend on vessel characteristics, 7 | #' vessel operating modes, and/or vessel location. This package can be used in 8 | #' conjunction with ship power estimates (see the \code{ShipPowerModel} package) 9 | #' and ship activity data to estimate CMV air emissions. 10 | #' 11 | #' @section Primary ShipEF functions: 12 | #' Each pollutant included in this package has its own function to determine 13 | #' the appropriate emissions factor. There is also a low load adjustment factor, 14 | #' which applies to the emission factors for each pollutant in certain operating 15 | #' conditions. 16 | #' \itemize{ 17 | #' \item \code{\link{calcEF_CO}} - Carbon monoxide emissions factor 18 | #' \item \code{\link{calcEF_CO2}} - Carbon dioxide emissions factor 19 | #' \item \code{\link{calcEF_HC}} - Hydrocarbons emissions factor 20 | #' \item \code{\link{calcEF_NOx}} - Oxides of nitrogen emissions factor 21 | #' \item \code{\link{calcEF_PM}} - Particulate matter emissions factor 22 | #' \item \code{\link{calcEF_SO2}} - Sulfur dioxide emissions factor 23 | #' \item \code{\link{calcLLAF}} - Low load adjustment factor 24 | #' \item \code{\link{calcEF}} - Calculates emission factors for all pollutants 25 | #' and applies the LLAF 26 | #' } 27 | #' 28 | #' @section Vignettes: 29 | #' An example of how to use this package can be found in the following vignette: 30 | #' \code{vignette("OverviewOfShipEF", package="ShipEF")} 31 | #' 32 | #' @docType package 33 | #' @name ShipEF 34 | NULL 35 | -------------------------------------------------------------------------------- /ShipEF/man/Main_HC_CO_EF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{Main_HC_CO_EF} 5 | \alias{Main_HC_CO_EF} 6 | \title{CO and HC emissions factors (g/kWh) for main propulsive engines, by engine type.} 7 | \format{ 8 | A data frame with 7 rows and 4 variables: 9 | \describe{ 10 | \item{engineType}{main engine type, SSD=Slow Speed Diesel,MSD=Medium Speed Diesel,LNG=Liquid Natural Gas,ST=Steam turbine,GT=Gas turbine,MSD-ED=Medium Speed Electric Diesel,GT-ED=Gas Turbine Electric Diesel} 11 | \item{co}{CO C3 marine vessel main engine emission factors (g/kWh)} 12 | \item{hc}{Hydrocarbon C3 marine vessel main engine emission factors (g/kWh)} 13 | \item{Source}{Character string describing source of specific emission factor for each engine type} 14 | } 15 | } 16 | \usage{ 17 | data(Main_HC_CO_EF) 18 | } 19 | \description{ 20 | CO and HC emissions factors (g/kWh) for main propulsive engines, by engine type. 21 | } 22 | \details{ 23 | This data is used in \code{calcEF_CO.r} \code{calcEF_HC.r} 24 | } 25 | \examples{ 26 | assign("EF",get(utils::data(Main_HC_CO_EF))) 27 | 28 | } 29 | \references{ 30 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 31 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 32 | EPA. Regulatory Impact Analysis: Control of Emissions of Air Pollution from Category 3 Marine Deisel Engines, 2009. 33 | Whall, C, D Cooper, K Archer, L Twigger, N Thurston, D Ockwell, A McIntyre, and A Ritchie. Quantification of Emissions from Ships Associated with Ship Movements between Ports in the European Community (Part 2). Cheshire: Entec UK Limited, 2002. 34 | } 35 | \keyword{datasets} 36 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMImmersedTransomRes.r: -------------------------------------------------------------------------------- 1 | #' @title calcHMImmersedTransomRes 2 | #' 3 | #' @description 4 | #' Calculate additional pressure resistance due to immersed transom (\code{Rtr}) 5 | #' (kN). 6 | #' 7 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 8 | #' \code{\link{calcSpeedUnitConversion}}) 9 | #' @param breadth Moulded breadth (vector of numericals, m) 10 | #' @param Cwp Water plane area coefficient (vector of numericals, see 11 | #' \code{\link{calcCwp}}) 12 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 13 | #' @param At Transom area (vector of numericals, m^2) (see \code{\link{calcAt}}) 14 | #' @param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 15 | #' supply either a vector of numericals, a single number, or rely on the default 16 | #' 17 | #' @return \code{Rtr} (vector of numericals, kN) 18 | #' 19 | #' @references 20 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 21 | #'method." International Shipbuilding Progress 29. 22 | #' 23 | #'@seealso \itemize{ 24 | #'\item \code{\link{calcSpeedUnitConversion}} 25 | #'\item \code{\link{calcCwp}} 26 | #'\item \code{\link{calcAt}} } 27 | #' 28 | #' @family Holtrop-Mennen Calculations 29 | #' @family Resistance Calculations 30 | #' 31 | #' @examples 32 | #' calcHMImmersedTransomRes(seq(1,5,1),32.25,0.91,13.57,22.2,seawaterDensity=1.025) 33 | #' 34 | #' @export 35 | 36 | calcHMImmersedTransomRes<-function(shipSpeed,breadth,Cwp,maxDraft,At,seawaterDensity=1.025){ 37 | 38 | 39 | Rtr<- 40 | ifelse(shipSpeed/sqrt(2*9.81*At/(breadth+breadth*Cwp))<5,#case 1 41 | 0.5*seawaterDensity*(shipSpeed^2)*At*(0.2*(1-0.2*( 42 | shipSpeed/sqrt(2*9.81*At/(breadth+breadth*Cwp)) 43 | ) 44 | )) 45 | ,#case 2 46 | 0) 47 | 48 | return(Rtr) 49 | } 50 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcCb.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcCb.r 3 | \name{calcCb} 4 | \alias{calcCb} 5 | \title{calcCb} 6 | \usage{ 7 | calcCb(maxDisplacement, lwl, breadth, maxDraft) 8 | } 9 | \arguments{ 10 | \item{maxDisplacement}{Maximum ship displacement (vector of numericals, m^3)} 11 | 12 | \item{lwl}{Waterline length (vector of numericals, m) (see \code{\link{calclwl}})} 13 | 14 | \item{breadth}{Moulded breadth (vector of numericals, m)} 15 | 16 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 17 | } 18 | \value{ 19 | \code{Cb} (vector of numericals, dimensionless) 20 | } 21 | \description{ 22 | Calculates the maximum block coefficient (\code{Cb}) 23 | (dimensionless) based on a ship's maximum displacement and and maximum draft. 24 | } 25 | \details{ 26 | The block coefficient is the ratio of the vessel's displacement and its 27 | volume, defined by its waterline length (\code{lwl}), breadth, and draft: 28 | \deqn{Cb=\frac{displacement}{lwl*breadth*draft}}{Cb=displacement/(lwl*breadth*draft)} 29 | 30 | This function returns the maximum block coefficient (\code{Cb}), which is the 31 | ratio of the vessel's maximum displacement and it's maximum volume, defined by 32 | its waterline length (\code{lwl}), breadth, and maximum draft: 33 | \deqn{Cb=\frac{maxDisplacement}{lwl*breadth*maxDraft}}{Cb=maxDisplacement/(lwl*breadth*maxDraft)} 34 | } 35 | \examples{ 36 | calcCb(c(80097.00,52382.04), c(218.75,209.25), c(32.25,32.2), c(13.6,11.5)) 37 | 38 | } 39 | \references{ 40 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 41 | Solutions. 2011. "Basic Principles of Propulsion."} 42 | } 43 | \seealso{ 44 | \itemize{ 45 | \item \code{\link{calclwl}} 46 | \item \code{\link{calcCbw}} 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcCb.r: -------------------------------------------------------------------------------- 1 | #'@title calcCb 2 | #' 3 | #'@description Calculates the maximum block coefficient (\code{Cb}) 4 | #'(dimensionless) based on a ship's maximum displacement and and maximum draft. 5 | #' 6 | #'@param maxDisplacement Maximum ship displacement (vector of numericals, m^3) 7 | #'@param lwl Waterline length (vector of numericals, m) (see \code{\link{calclwl}}) 8 | #'@param breadth Moulded breadth (vector of numericals, m) 9 | #'@param maxDraft Maximum summer load line draft (vector of numericals, m) 10 | #' 11 | #'@details 12 | #'The block coefficient is the ratio of the vessel's displacement and its 13 | #'volume, defined by its waterline length (\code{lwl}), breadth, and draft: 14 | #'\deqn{Cb=\frac{displacement}{lwl*breadth*draft}}{Cb=displacement/(lwl*breadth*draft)} 15 | #' 16 | #'This function returns the maximum block coefficient (\code{Cb}), which is the 17 | #'ratio of the vessel's maximum displacement and it's maximum volume, defined by 18 | #'its waterline length (\code{lwl}), breadth, and maximum draft: 19 | #'\deqn{Cb=\frac{maxDisplacement}{lwl*breadth*maxDraft}}{Cb=maxDisplacement/(lwl*breadth*maxDraft)} 20 | #' 21 | #'@return \code{Cb} (vector of numericals, dimensionless) 22 | #' 23 | #'@references 24 | #'\href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 25 | #' Solutions. 2011. "Basic Principles of Propulsion."} 26 | #' 27 | #'@seealso \itemize{ 28 | #'\item \code{\link{calclwl}} 29 | #'\item \code{\link{calcCbw}} 30 | #'} 31 | #' 32 | #'@examples 33 | #'calcCb(c(80097.00,52382.04), c(218.75,209.25), c(32.25,32.2), c(13.6,11.5)) 34 | #' 35 | #'@export 36 | 37 | 38 | calcCb<- function(maxDisplacement, lwl, breadth, maxDraft){ 39 | 40 | Cb <- pmin(1, 41 | maxDisplacement/(lwl*breadth*maxDraft) 42 | ) 43 | return(Cb) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMWettedSA.r: -------------------------------------------------------------------------------- 1 | #' @title calcHMWettedSA 2 | #' 3 | #' @description Calculate hull wetted surface area (\code{wettedSA}) (m^2) 4 | #' using the Holtrop & Mennen method. 5 | #' 6 | #'@param lwl Waterline length (vector of numericals, m) (see 7 | #'\code{\link{calclwl}}) 8 | #'@param breadth Moulded breadth (vector of numericals, m) 9 | #'@param actualDraft Actual draft (vector of numericals, m) 10 | #'@param Cm Midship section coefficient (vector of numericals, dimensionless) 11 | #'(see \code{\link{calcCm}}) 12 | #'@param Cbw Waterline block coefficient (vector of numericals, dimensionless) 13 | #'(see \code{\link{calcCbw}}) 14 | #'@param Cwp Water plane area coefficient (vector of numericals, see 15 | #'\code{\link{calcCwp}}) 16 | #'@param Abt Traverse bulb area (vector of numericals, m^2) (see 17 | #'\code{\link{calcAbt}}) 18 | #' 19 | #'@details 20 | #'Actual draft is typically obtained from sources such as AIS messages or ship 21 | #'records. 22 | #' 23 | #' @return \code{wettedSA} (vector of numericals, m^2) 24 | #' 25 | #' @references 26 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 27 | #'method." International Shipbuilding Progress 29. 28 | #' 29 | #'@seealso \itemize{ 30 | #'\item \code{\link{calclwl}} 31 | #'\item \code{\link{calcCm}} 32 | #'\item \code{\link{calcCbw}} 33 | #'\item \code{\link{calcCwp}} 34 | #'\item \code{\link{calcAbt}}} 35 | #' 36 | #' @family Holtrop-Mennen Calculations 37 | #' 38 | #' @examples 39 | #'calcHMWettedSA(218.75,12.48,32.25,0.99,0.81,0.91,32.02) 40 | #' 41 | #' @export 42 | 43 | calcHMWettedSA<- function(lwl,actualDraft,breadth,Cm,Cbw,Cwp,Abt){ 44 | 45 | wettedSA<-lwl*(2*actualDraft+breadth)*(Cm^0.5)* 46 | (0.453+0.4425*Cbw-0.2862*Cm-0.003467*(breadth/actualDraft)+ 47 | 0.3696*Cwp)+2.38*(Abt/Cbw) 48 | 49 | return(wettedSA) 50 | } 51 | -------------------------------------------------------------------------------- /ShipEF/man/ShipEF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ShipEF.r 3 | \docType{package} 4 | \name{ShipEF} 5 | \alias{ShipEF} 6 | \title{ShipEF: A package containing functions to assign marine vessel emission 7 | factors} 8 | \description{ 9 | The ShipEF package by the U.S. Environmental Protection Agency provides 10 | functions for assigning emission factors to commercial marine vessels (CMV). 11 | For various pollutants, emission factors depend on vessel characteristics, 12 | vessel operating modes, and/or vessel location. This package can be used in 13 | conjunction with ship power estimates (see the \code{ShipPowerModel} package) 14 | and ship activity data to estimate CMV air emissions. 15 | } 16 | \section{Primary ShipEF functions}{ 17 | 18 | Each pollutant included in this package has its own function to determine 19 | the appropriate emissions factor. There is also a low load adjustment factor, 20 | which applies to the emission factors for each pollutant in certain operating 21 | conditions. 22 | \itemize{ 23 | \item \code{\link{calcEF_CO}} - Carbon monoxide emissions factor 24 | \item \code{\link{calcEF_CO2}} - Carbon dioxide emissions factor 25 | \item \code{\link{calcEF_HC}} - Hydrocarbons emissions factor 26 | \item \code{\link{calcEF_NOx}} - Oxides of nitrogen emissions factor 27 | \item \code{\link{calcEF_PM}} - Particulate matter emissions factor 28 | \item \code{\link{calcEF_SO2}} - Sulfur dioxide emissions factor 29 | \item \code{\link{calcLLAF}} - Low load adjustment factor 30 | \item \code{\link{calcEF}} - Calculates emission factors for all pollutants 31 | and applies the LLAF 32 | } 33 | } 34 | 35 | \section{Vignettes}{ 36 | 37 | An example of how to use this package can be found in the following vignette: 38 | \code{vignette("OverviewOfShipEF", package="ShipEF")} 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ShipEF/R/calcTestIMO.r: -------------------------------------------------------------------------------- 1 | #' @title calcTestIMO 2 | #' 3 | #' @description 4 | #' Determines whether or not an IMO number is in the correct format. IMO numbers 5 | #' should have 7 digits with a check digit at the end. 6 | #' 7 | #' @param IMO IMO number (vector of numericals or strings) 8 | #' @param correctFlag Output indicator for rows where the IMO Number is in the 9 | #' correct format 10 | #' @param incorrectFlag Output indicator for rows where the IMO Number is not in 11 | #' the correct format 12 | #' 13 | #' @return 14 | #' \code{IMO_number_flag}, a factorized vector containing either the value of 15 | #' \code{correctFlag} or \code{incorrectFlag}, depending on the correctness of 16 | #' the IMO number 17 | #' 18 | #' @examples 19 | #' calcTestIMO(IMO=c(899046900,0,9394935)) 20 | #' 21 | #' @export 22 | 23 | calcTestIMO<-function(IMO,correctFlag="Correct",incorrectFlag="Incorrect"){ 24 | 25 | #Correct Flag 26 | IMO_NUMBER_flag<-rep(correctFlag,length(IMO)) 27 | 28 | #Test Right Legth: 29 | IMO<-as.character(IMO) 30 | imolist<-strsplit(unique(IMO), split="") 31 | rightLength<-which(lapply(imolist, length)==7) 32 | imolist<-imolist[rightLength] 33 | rm(rightLength) 34 | 35 | 36 | #For those of right length, test check digit: 37 | 38 | imolist<-lapply(imolist, as.numeric) 39 | 40 | checkDigit<-lapply(imolist, function(x) sapply(strsplit( 41 | as.character((x[1]*7)+(x[2]*6)+(x[3]*5)+(x[4]*4)+(x[5]*3)+(x[6]*2)), 42 | split=""), tail, 1)) 43 | 44 | test<-unlist(lapply(checkDigit, as.numeric))==unlist(lapply(imolist, function(x) x[7])) 45 | 46 | rm(checkDigit) 47 | imolist<-imolist[which(test==TRUE)] 48 | 49 | imolist<- lapply(imolist, function(x)paste(x, collapse="")) 50 | 51 | #Incorrect Flag: 52 | IMO_NUMBER_flag[which(!IMO%in%imolist)]<-incorrectFlag 53 | 54 | IMO_NUMBER_flag<-as.factor(IMO_NUMBER_flag) 55 | return(IMO_NUMBER_flag) 56 | 57 | } 58 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcCf.r: -------------------------------------------------------------------------------- 1 | #' @title calcCf 2 | #' 3 | #' @description Calculates the frictional resistance coefficient (\code{Cf}) 4 | #' (dimensionless). 5 | #' 6 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 7 | #' \code{\link{calcSpeedUnitConversion}}) 8 | #' @param lwl Waterline length (vector of numericals, m) (see 9 | #' \code{\link{calclwl}}) 10 | #' @param seawaterTemp Sea water temperature. Default = 15 (degrees Celsius). 11 | #' Can supply either a vector of numericals, a single number, or rely on the 12 | #' default 13 | #' @param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 14 | #' supply either a vector of numericals, a single number, or rely on the default 15 | #' 16 | #' @details 17 | #' Calculates frictional resistance coefficient using the International Tank 18 | #' Towing Committee (ITTC) 1957 method where: 19 | #' \deqn{Cf = \frac{0.075}{(log(V*Lwl/visc)-2)^2}}{Cf = 0.075/((log(V*Lwl/visc)-2)^2)} 20 | #' 21 | #' @return \code{Cf} (vector of numericals, dimensionless) 22 | #' 23 | #' @references 24 | #'Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 25 | #'Power of Ships." 26 | #' 27 | #'@seealso \itemize{ 28 | #'\item \code{\link{calcSpeedUnitConversion}} 29 | #'\item \code{\link{calclwl}} 30 | #'} 31 | #' 32 | #' @family Resistance Calculations 33 | #' 34 | #' @examples 35 | #' calcCf(seq(1,5,1), 218.75, 15, 1.025) 36 | #' 37 | #' @export 38 | 39 | 40 | calcCf <- function(shipSpeed, lwl, seawaterTemp=15, seawaterDensity=1.025){ 41 | 42 | Cf<-0.075/((log10( 43 | (shipSpeed*lwl)/ 44 | (((43.4233-31.38*seawaterDensity)* 45 | ((seawaterTemp+20)^(1.72*seawaterDensity-2.202))+ 46 | 4.7478-5.779*seawaterDensity)*(10^(-6))) 47 | 48 | ) 49 | -2)^(2)) 50 | 51 | 52 | return(Cf) 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcCbw.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcCbw.r 3 | \name{calcCbw} 4 | \alias{calcCbw} 5 | \title{calcCbw} 6 | \usage{ 7 | calcCbw(Cb, actualDraft, maxDraft) 8 | } 9 | \arguments{ 10 | \item{Cb}{Maximum block coefficient (vector of numericals, dimensionless) 11 | (see \code{\link{calcCb}})} 12 | 13 | \item{actualDraft}{Actual draft (vector of numericals, m)} 14 | 15 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 16 | } 17 | \value{ 18 | \code{Cbw} (vector of numericals, dimensionless) 19 | } 20 | \description{ 21 | Calculates the waterline block coefficient (\code{Cbw}) 22 | (dimensionless) using actual draft. 23 | } 24 | \details{ 25 | The block coefficient is the ratio of the vessel's displacement and its 26 | volume, defined by its waterline length (\code{lwl}), breadth, and draft: 27 | \deqn{Cb=\frac{displacement}{lwl*breadth*draft}}{Cb=displacement/(lwl*breadth*draft)} 28 | 29 | This function returns the waterline block coefficient (\code{Cbw}), which 30 | represents a loaded condition estimation using actual draft using the 31 | Riddlesworth method. Actual draft is typically obtained from sources such as 32 | AIS messages or ship records. 33 | 34 | NOTE: Technically, no block coefficient can be greater than 1. Even a 35 | waterline block coefficient of 1 itself is extremely improbable and can cause 36 | numerical errors elsewhere in the model. Therefore, the upper bound of the 37 | waterline block coefficient is fixed at 0.99 in this function. 38 | } 39 | \examples{ 40 | calcCbw(c(0.82,0.66),c(12.48,11.09),c(13.57,11.49)) 41 | calcCbw(0.82,12.48,13.57) 42 | 43 | } 44 | \references{ 45 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 46 | Solutions. 2011. "Basic Principles of Propulsion."} 47 | } 48 | \seealso{ 49 | \code{\link{calcCb}} 50 | } 51 | -------------------------------------------------------------------------------- /ShipPowerModel/man/Starcrest2016_BoilerLoadFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{Starcrest2016_BoilerLoadFactor} 5 | \alias{Starcrest2016_BoilerLoadFactor} 6 | \title{Boiler engine loads (kW) per operating mode, ship type and sub type using Starcrest 2016 methodology.} 7 | \format{ 8 | A data frame with 34 rows and 9 variables: 9 | \describe{ 10 | \item{shipType}{Generalizable ship type. Define by \code{calcShipType.r}} 11 | \item{sizeMin}{Minimum size value for each subtype and their given size unit.} 12 | \item{sizeMax}{Maximum size value for each subtype and their given size unit.} 13 | \item{sizeUnits}{Size units used to define subtype size ranges.} 14 | \item{subType}{Sub type of each ship type which are defined by size ranges.} 15 | \item{Transit}{Boiler engine loads (kW) assigned to each vessel by subtype when transiting. Transiting defined by \code{calcOperatingMode.r}} 16 | \item{Maneuvering}{Boiler engine loads(kW) assigned to each vessel by subtype when Maneuvering. Maneuvering defined by \code{calcOperatingMode.r}} 17 | \item{Berth}{Boiler engine loads (kW) assigned to each vessel by subtype when berth. Berthing defined by \code{calcOperatingMode.r}} 18 | \item{Anchorage}{Boiler engine loads (kW) assigned to each vessel by subtype when anchoring. Anchorage defined by \code{calcOperatingMode.r}} 19 | } 20 | } 21 | \usage{ 22 | data(Starcrest2016_BoilerLoadFactor) 23 | } 24 | \description{ 25 | Boiler engine loads (kW) per operating mode, ship type and sub type using Starcrest 2016 methodology. 26 | } 27 | \details{ 28 | This data is used in \code{calcAuxBoilerLoad.r} 29 | } 30 | \examples{ 31 | assign("Loads",get(utils::data(Starcrest2016_BoilerLoadFactor))) 32 | } 33 | \references{ 34 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /ShipEF/README.md: -------------------------------------------------------------------------------- 1 | # US EPA ShipEF 2 | 3 | ShipEF is an R package that contains functions to assign marine vessel emission factors. 4 | 5 | This package can be used in conjunction with [ship power estimates](../ShipPowerModel) and ship activity data to estimate CMV air emissions. 6 | 7 | ## Getting Started 8 | 9 | These instructions should get ShipEF installed and running within your installation of R. See the vignettes and library documentation for how to use this package. 10 | 11 | ### Prerequisites 12 | 13 | Building and installing this package and its documentation requires R version 3.5 or greater and the following packages: 14 | 15 | * devtools 16 | * data.table 17 | * testthat 18 | * knitr 19 | * rmarkdown 20 | * ggplot2 21 | 22 | ### Installation 23 | 24 | You can install this package directly from github using the following command: 25 | 26 | ``` 27 | devtools::install_github(repo = "USEPA/Marine_Emissions_Tools", 28 | subdir = "ShipEF", 29 | build_vignettes = TRUE 30 | ) 31 | ``` 32 | 33 | ### Documentation 34 | 35 | After installation, documentation for this package can be accessed by typing `?ShipEF` in the R console. 36 | 37 | ## EPA Disclaimer 38 | 39 | The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. 40 | -------------------------------------------------------------------------------- /ShipEF/man/calcShipCategory.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcShipCategory.r 3 | \name{calcShipCategory} 4 | \alias{calcShipCategory} 5 | \title{calcShipCategory} 6 | \usage{ 7 | calcShipCategory(mainEngineBore, mainEngineStroke) 8 | } 9 | \arguments{ 10 | \item{mainEngineBore}{Diameter of the main engine cylinder (mm) (vector of 11 | numericals)} 12 | 13 | \item{mainEngineStroke}{Main engine stroke length, the distance travelled by 14 | the piston in each cycle (mm) (vector of numericals)} 15 | } 16 | \value{ 17 | \code{shipCategory} (vector of ints). Valid values are: \itemize{ 18 | \item 1 19 | \item 2 20 | \item 3 21 | } 22 | } 23 | \description{ 24 | Assigns EPA regulatory ship category from engine displacement 25 | } 26 | \details{ 27 | For more information, see Section 3.3.2.1 of the Port Emissions Inventory 28 | Guidance. 29 | } 30 | \examples{ 31 | calcShipCategory(400, 240) 32 | 33 | } 34 | \references{ 35 | \href{https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=P1005ZGH.TXT}{EPA. 2009. 36 | "Regulatory impact analysis: Control of emissions air pollution from category 37 | 3 marine diesel engines." Ann Arbor, MI: Office of Transportation and Air 38 | Quality. US Environmental Protection Agency.} 39 | 40 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi/?Dockey=P10024CN.PDF}{EPA. 2008. 41 | "Regulatory impact analysis: Control of emissions of air pollution from 42 | locomotive engines and marine compression ignition engines less than 30 liters 43 | per cylinder." Ann Arbor, MI: Office of Transportation and Air 44 | Quality. US Environmental Protection Agency.} 45 | 46 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 47 | "Port Emissions Inventory Guidance: Methodologies for Estimating 48 | Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 49 | Office of Transportation and Air Quality. US Environmental Protection Agency.} 50 | } 51 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calclwl.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calclwl.r 3 | \name{calclwl} 4 | \alias{calclwl} 5 | \title{calclwl} 6 | \usage{ 7 | calclwl( 8 | shipType, 9 | lbp, 10 | tankerBulkCarrierGCargoShipTypes = c("tanker", "general.cargo", "chemical.tanker", 11 | "liquified.gas.tanker", "oil.tanker", "other.tanker", "bulk.carrier"), 12 | roroPaxShipTypes = c("ro.ro", "passenger", "ferry.pax", "ferry.ro.pax", "cruise", 13 | "yacht", "cruise.ed") 14 | ) 15 | } 16 | \arguments{ 17 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}}). 18 | Must align with 19 | \code{tankerBulkCarrierGCargoShipTypes} and \code{roroPaxShipTypes} groupings} 20 | 21 | \item{lbp}{Length between perpendiculars (vector of numericals, m)} 22 | 23 | \item{tankerBulkCarrierGCargoShipTypes}{Ship types specified in input 24 | \code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 25 | vessels (vector of strings)} 26 | 27 | \item{roroPaxShipTypes}{Ship types specified in input \code{shipTypes} to be 28 | modeled as RORO and passenger ships (vector of strings)} 29 | } 30 | \value{ 31 | \code{lwl} (vector of numericals, m) 32 | } 33 | \description{ 34 | Estimate waterline length (\code{lwl}) (m) from length between 35 | perpendiculars (\code{lbp}) (m). 36 | } 37 | \details{ 38 | This method this requires ship types to be grouped. Use the 39 | \code{tankerBulkCarrierGCargoShipTypes} and \code{roroPaxShipTypes} grouping 40 | parameters to provide these ship type groupings. Any ship types not included 41 | in these groupings will be considered as miscellaneous vessels. 42 | } 43 | \examples{ 44 | calclwl(c("bulk.carrier","container.ship","cruise"), c(214.5,396,140)) 45 | 46 | } 47 | \references{ 48 | \href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 49 | "Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 50 | } 51 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMBulbousBowRes.r: -------------------------------------------------------------------------------- 1 | #'@title calcHMBulbousBowRes 2 | #' 3 | #'@description Calculate bulbous bow resistance (\code{Rb}) (kN) from the 4 | #'Holtrop & Mennen method. 5 | #' 6 | #'@param maxDraft Maximum summer load line draft (vector of numericals, m) 7 | #'@param forwardDraft Forward draft (deviation from actual draft indicates trim) 8 | #' (vector of numericals, m) 9 | #'@param shipSpeed Ship actual speed (vector of numericals, m/s) (see 10 | #' \code{\link{calcSpeedUnitConversion}}) 11 | #'@param Abt Traverse bulb area (vector of numericals, m^2) (see 12 | #' \code{\link{calcAbt}}) 13 | #'@param hb Center of bulb area above keel line (vector of numericals, m) 14 | #' (see \code{\link{calchb}}) 15 | #'@param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 16 | #' supply either a vector of numericals, a single number, or rely on the default 17 | #' 18 | #'@return \code{Rb} (vector of numericals, kN) 19 | #' 20 | #'@references 21 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 22 | #'method." International Shipbuilding Progress 29. 23 | #' 24 | #'@seealso \itemize{ 25 | #'\item \code{\link{calcSpeedUnitConversion}} 26 | #'\item \code{\link{calcAbt}} 27 | #'\item \code{\link{calchb}} 28 | #'} 29 | #' 30 | #'@family Holtrop-Mennen Calculations 31 | #'@family Resistance Calculations 32 | #' 33 | #'@examples 34 | #' calcHMBulbousBowRes(seq(1,5,1),13.57,13.57,25.09,5.43,seawaterDensity=1.025) 35 | #' 36 | #'@export 37 | 38 | calcHMBulbousBowRes<-function(shipSpeed,maxDraft,forwardDraft, 39 | Abt,hb,seawaterDensity=1.025){ 40 | Rb<- 41 | 0.11*exp(-3*(( 42 | (0.56*sqrt(Abt)/(forwardDraft-1.5*hb)) 43 | )^-2))*(( 44 | (shipSpeed)/sqrt(9.81*(forwardDraft-hb-0.25*sqrt(Abt))+0.15*((shipSpeed)^2)) 45 | )^3)*(Abt^1.5)*seawaterDensity*9.81/(1+(( 46 | (shipSpeed)/sqrt(9.81*(forwardDraft-hb-0.25*sqrt(Abt))+0.15*((shipSpeed)^2)) 47 | )^2)) 48 | 49 | 50 | return(Rb) 51 | } 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcOperatingMode.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcOperatingMode.r 3 | \name{calcOperatingMode} 4 | \alias{calcOperatingMode} 5 | \title{calcOperatingMode} 6 | \usage{ 7 | calcOperatingMode(shipSpeed, loadFactor, berthArea, anchorageArea) 8 | } 9 | \arguments{ 10 | \item{shipSpeed}{Vessel speed (vector of numericals, knots)} 11 | 12 | \item{loadFactor}{Fractional percentage (between 0 and 1) of main engine 13 | required to propel vessel at given speed (vector of numericals) (see 14 | ShipPowerModel library)} 15 | 16 | \item{berthArea}{Vector of named berth areas (NA if not at berth) or vector 17 | of booleans (TRUE if at berth, FALSE if not)} 18 | 19 | \item{anchorageArea}{Vector of named anchorage areas (NA if not at anchorage) 20 | or vector of booleans (TRUE if at berth, FALSE if not)} 21 | } 22 | \value{ 23 | \code{opMode} (vector of strings). Valid values are: \itemize{ 24 | \item "Berth" 25 | \item "Anchorage" 26 | \item "Maneuvering" 27 | \item "Transit" 28 | } 29 | } 30 | \description{ 31 | Assigns an operating mode designation according to ship speed and engine load 32 | fraction. 33 | } 34 | \details{ 35 | Calculated as a simplification of the methods described in Section 3.8.5 of 36 | the Port Emissions Inventory Guidance. 37 | } 38 | \examples{ 39 | calcOperatingMode(shipSpeed = c(0, 2.5, 14, 20), 40 | loadFactor = c(0.01, 0.0, 0.15, 0.75), 41 | berthArea = c(TRUE, FALSE, FALSE, FALSE), 42 | anchorageArea = c(FALSE, TRUE, FALSE, FALSE) 43 | ) 44 | 45 | } 46 | \references{ 47 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 48 | "Port Emissions Inventory Guidance: Methodologies for Estimating 49 | Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 50 | Office of Transportation and Air Quality. US Environmental Protection Agency.} 51 | } 52 | \seealso{ 53 | ShipPowerModel library 54 | } 55 | -------------------------------------------------------------------------------- /ShipEF/man/MainNOxEF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{MainNOxEF} 5 | \alias{MainNOxEF} 6 | \title{NOx emission factors (g/kWh) for main engines, by fuel type, engine type, and engine tier.} 7 | \format{ 8 | A data frame with 31 rows and 5 variables: 9 | \describe{ 10 | \item{engineType}{main engine type, "HSD"="High Speed Diesel","MSD"="Medium Speed Diesel","LNG"="Liquid Natural Gas"} 11 | \item{fuelType}{fuel type used by vessel: "RM/HFO"="Residual Marine/Heavy Fuel Oil","MGO/MDO"="Marine Gas Oil/Marine Diesel Oil","LNG="Liquid Natural Gas"} 12 | \item{tier}{Engine regulatory tier (per IMO regulations). Defined by \code{calcTier.r}} 13 | \item{nox}{NOx emission factors (g/kWh) per engine type, fuel type and tier} 14 | \item{Source}{Character string describing source of each NOx emission factor for each engine, fuel type and tier.} 15 | } 16 | } 17 | \usage{ 18 | data(MainNOxEF) 19 | } 20 | \description{ 21 | NOx emission factors (g/kWh) for main engines, by fuel type, engine type, and engine tier. 22 | } 23 | \details{ 24 | This data is used in \code{calcEF_NOx.r} 25 | } 26 | \examples{ 27 | assign("EF",get(utils::data(MainNOxEF))) 28 | 29 | } 30 | \references{ 31 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 32 | International Maritime Organization. Second IMO GHG Study. 4 Albert Embankment, London SE1 7SR: International Maritime Organization, 2009. 33 | Starcrest Consulting Group, LLC. San Pedro Bay Ports Emissions Inventory Methodology Report Version 2, 2021. 34 | EPA. Regulatory Impact Analysis: Control of Emissions of Air Pollution from Category 3 Marine Deisel Engines, 2009. 35 | Whall, C, D Cooper, K Archer, L Twigger, N Thurston, D Ockwell, A McIntyre, and A Ritchie. Quantification of Emissions from Ships Associated with Ship Movements between Ports in the European Community (Part 2). Cheshire: Entec UK Limited, 2002. 36 | } 37 | \keyword{datasets} 38 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcCf.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcCf.r 3 | \name{calcCf} 4 | \alias{calcCf} 5 | \title{calcCf} 6 | \usage{ 7 | calcCf(shipSpeed, lwl, seawaterTemp = 15, seawaterDensity = 1.025) 8 | } 9 | \arguments{ 10 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 11 | \code{\link{calcSpeedUnitConversion}})} 12 | 13 | \item{lwl}{Waterline length (vector of numericals, m) (see 14 | \code{\link{calclwl}})} 15 | 16 | \item{seawaterTemp}{Sea water temperature. Default = 15 (degrees Celsius). 17 | Can supply either a vector of numericals, a single number, or rely on the 18 | default} 19 | 20 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 21 | supply either a vector of numericals, a single number, or rely on the default} 22 | } 23 | \value{ 24 | \code{Cf} (vector of numericals, dimensionless) 25 | } 26 | \description{ 27 | Calculates the frictional resistance coefficient (\code{Cf}) 28 | (dimensionless). 29 | } 30 | \details{ 31 | Calculates frictional resistance coefficient using the International Tank 32 | Towing Committee (ITTC) 1957 method where: 33 | \deqn{Cf = \frac{0.075}{(log(V*Lwl/visc)-2)^2}}{Cf = 0.075/((log(V*Lwl/visc)-2)^2)} 34 | } 35 | \examples{ 36 | calcCf(seq(1,5,1), 218.75, 15, 1.025) 37 | 38 | } 39 | \references{ 40 | Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 41 | Power of Ships." 42 | } 43 | \seealso{ 44 | \itemize{ 45 | \item \code{\link{calcSpeedUnitConversion}} 46 | \item \code{\link{calclwl}} 47 | } 48 | 49 | Other Resistance Calculations: 50 | \code{\link{calcHMAppendageRes}()}, 51 | \code{\link{calcHMBulbousBowRes}()}, 52 | \code{\link{calcHMCa}()}, 53 | \code{\link{calcHMImmersedTransomRes}()}, 54 | \code{\link{calcHMTotalRes}()}, 55 | \code{\link{calcHMWaveMakingRes}()}, 56 | \code{\link{calcKristCaa}()}, 57 | \code{\link{calcKristCa}()}, 58 | \code{\link{calcKristCr}()}, 59 | \code{\link{calcKristTotalRes}()} 60 | } 61 | \concept{Resistance Calculations} 62 | -------------------------------------------------------------------------------- /ShipPowerModel/man/Starcrest2016_AuxLoadFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{Starcrest2016_AuxLoadFactor} 5 | \alias{Starcrest2016_AuxLoadFactor} 6 | \title{Auxiliary engine loads per operating mode, ship type and sub type using Starcrest 2016 methodology. Also used to define sub types.} 7 | \format{ 8 | A data frame with 34 rows and 9 variables: 9 | \describe{ 10 | \item{shipType}{Generalizable ship type. Define by \code{calcShipType.r} using method="starcrest"} 11 | \item{sizeMin}{Minimum size value for each subtype and their given size unit. Used to define subtype.} 12 | \item{sizeMax}{Maximum size value for each subtype and their given size unit. Used to define subtype.} 13 | \item{sizeUnits}{Size units used to define subtype size ranges.} 14 | \item{subType}{Sub type of each ship type which are defined by size ranges.} 15 | \item{Transit}{Auxiliary engine loads (kW) assigned to each vessel by subtype when transiting. Transiting defined by \code{calcOperatingMode.r}} 16 | \item{Maneuvering}{Auxiliary engine loads (kW) assigned to each vessel by subtype when Maneuvering. Maneuvering defined by \code{calcOperatingMode.r}} 17 | \item{Berth}{Auxiliary engine loads (kW) assigned to each vessel by subtype when berth. Berthing defined by \code{calcOperatingMode.r}} 18 | \item{Anchorage}{Auxiliary engine loads (kW) assigned to each vessel by subtype when anchoring. Anchorage defined by \code{calcOperatingMode.r}} 19 | } 20 | } 21 | \usage{ 22 | data(Starcrest2016_AuxLoadFactor) 23 | } 24 | \description{ 25 | Auxiliary engine loads per operating mode, ship type and sub type using Starcrest 2016 methodology. Also used to define sub types. 26 | } 27 | \details{ 28 | This data is used in \code{calcAuxBoilerLoad.r} \code{calcSubType.r} 29 | } 30 | \examples{ 31 | assign("Loads",get(utils::data(Starcrest2016_AuxLoadFactor))) 32 | } 33 | \references{ 34 | Starcrest Consulting Group,LLC.Port of Los Angeles Inventory of Air Emissions-2016, 2017. 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /ShipPowerModel/man/IMOGHG3_BoilerLoadFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{IMOGHG3_BoilerLoadFactor} 5 | \alias{IMOGHG3_BoilerLoadFactor} 6 | \title{Boiler engine loads (kW) per operating mode, ship type and sub type using IMO GHG 3 methodology.} 7 | \format{ 8 | A data frame with 56 rows and 9 variables: 9 | \describe{ 10 | \item{shipType}{Generalizable ship type. Define by \code{calcShipType.r}} 11 | \item{sizeMin}{Minimum size value for each subtype and their given size unit.} 12 | \item{sizeMax}{Maximum size value for each subtype and their given size unit.} 13 | \item{sizeUnits}{Size units used to define subtype size ranges.} 14 | \item{subType}{Sub type of each ship type which are defined by size ranges.} 15 | \item{Transit}{Boiler engine loads (kW) assigned to each vessel by subtype when transiting. Transiting defined by \code{calcOperatingMode.r}} 16 | \item{Maneuvering}{Boiler engine loads(kW) assigned to each vessel by subtype when Maneuvering. Maneuvering defined by \code{calcOperatingMode.r}} 17 | \item{Berth}{Boiler engine loads (kW) assigned to each vessel by subtype when berth. Berthing defined by \code{calcOperatingMode.r}} 18 | \item{Anchorage}{Boiler engine loads (kW) assigned to each vessel by subtype when anchoring. Anchorage defined by \code{calcOperatingMode.r}} 19 | } 20 | } 21 | \usage{ 22 | data(IMOGHG3_BoilerLoadFactor) 23 | } 24 | \description{ 25 | Boiler engine loads (kW) per operating mode, ship type and sub type using IMO GHG 3 methodology. 26 | } 27 | \details{ 28 | IMO GHG 3 uses Starcrest 2014 auxiliary loads from multiple vessel boarding programs(VBP) around the US in addition to FMI international auxiliary load data. 29 | 30 | This data is used in \code{calcAuxBoilerLoad.r} 31 | } 32 | \examples{ 33 | assign("Loads",get(utils::data(IMOGHG3_BoilerLoadFactor))) 34 | } 35 | \references{ 36 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 37 | } 38 | \keyword{datasets} 39 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcPropDia.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcPropDia.r 3 | \name{calcPropDia} 4 | \alias{calcPropDia} 5 | \title{calcPropDia} 6 | \usage{ 7 | calcPropDia( 8 | shipType, 9 | maxDraft, 10 | tankerBulkCarrierGCargoShipTypes = c("general.cargo", "tanker", "chemical.tanker", 11 | "liquified.gas.tanker", "oil.tanker", "other.tanker", "bulk.carrier"), 12 | containerShipTypes = c("container.ship") 13 | ) 14 | } 15 | \arguments{ 16 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}}). 17 | Must align with \code{tankerBulkCarrierGCargoShipTypes} and 18 | \code{containerShipTypes} groupings} 19 | 20 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 21 | 22 | \item{tankerBulkCarrierGCargoShipTypes}{Ship types specified in input 23 | \code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 24 | vessels (vector of strings)} 25 | 26 | \item{containerShipTypes}{Ship types specified in input \code{shipTypes} to 27 | be modeled as container ships (vector of strings)} 28 | } 29 | \value{ 30 | \code{propDiam} (vector of numericals, m) 31 | } 32 | \description{ 33 | Calculate propeller diameter (\code{propDiam}) (m). 34 | } 35 | \details{ 36 | This method this requires ship types to be grouped. Use the 37 | \code{tankerBulkCarrierGCargoShipTypes} and \code{containerShipTypes} grouping 38 | parameters to provide these ship type groupings. Any ship types not included 39 | in these groupings will be considered as miscellaneous vessels. 40 | } 41 | \examples{ 42 | calcPropDia(c("bulk.carrier","container.ship"), c(13.6,15.6)) 43 | calcPropDia(c("other.tanker","container.ship"), c(13.6,15.6), 44 | tankerBulkCarrierGCargoShipTypes=c("other.tanker","bulk.carrier")) 45 | 46 | } 47 | \references{ 48 | Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 49 | Power of Ships." 50 | 51 | \href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 52 | "Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 53 | } 54 | -------------------------------------------------------------------------------- /ShipEF/docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /ShipEF/man/calcTier.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcTier.r 3 | \name{calcTier} 4 | \alias{calcTier} 5 | \title{calcTier} 6 | \usage{ 7 | calcTier(engineType, keelLaidYear, shipCategory) 8 | } 9 | \arguments{ 10 | \item{engineType}{Engine type (vector of strings) (see 11 | \code{\link{calcEngineType}}). Valid values are: \itemize{ 12 | \item "SSD" 13 | \item "MSD" 14 | \item "MSD-ED" 15 | \item "GT" 16 | \item "GT-ED" 17 | \item "ST" 18 | \item "LNG" 19 | }} 20 | 21 | \item{keelLaidYear}{Keel-laid year (vector of ints). If not available, 22 | interpolate from build date} 23 | 24 | \item{shipCategory}{Ship category (vector of ints) (see 25 | \code{\link{calcShipCategory}}). Valid values are: 26 | \itemize{ 27 | \item 1 28 | \item 2 29 | \item 3 30 | }} 31 | } 32 | \value{ 33 | \code{tier}, a factorized vector with possible levels of: \itemize{ 34 | \item "None" (used for C1/C2 vessels) 35 | \item "Tier 0" 36 | \item "Tier 1" 37 | \item "Tier 2" 38 | \item "Tier 3" 39 | } 40 | } 41 | \description{ 42 | Estimate engine NOx tier from the vessel's keel-laid year for C3 vessels. 43 | } 44 | \details{ 45 | This function is designed to determine the engine NOx tier for C3 vessels. 46 | Therefore, it will return "None" for C1 or C2 vessels. 47 | 48 | "Tier 0" is returned for steam turbine, gas turbine, and LNG engines, as well 49 | as for diesel engines that were keel-laid prior to Tier 1 taking effect 50 | (2000). 51 | 52 | "Tier 1", "Tier 2", and "Tier 3" refer to Tier I, Tier II, and Tier III, 53 | respectively. 54 | } 55 | \examples{ 56 | calcTier(c("MSD","GT","LNG","SSD"),c(1985, 2011, 2001,2004),c(3,3,3,2)) 57 | 58 | } 59 | \references{ 60 | \href{https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=P1005ZGH.TXT}{EPA. 2009. 61 | "Regulatory impact analysis: Control of emissions air pollution from category 62 | 3 marine diesel engines." Ann Arbor, MI: Office of Transportation and Air 63 | Quality. US Environmental Protection Agency. Pg 3-118:119} 64 | } 65 | \seealso{ 66 | \itemize{ 67 | \item \code{\link{calcEngineType}} 68 | \item \code{\link{calcShipCategory}} 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcCbw.r: -------------------------------------------------------------------------------- 1 | #' @title calcCbw 2 | #' 3 | #' @description Calculates the waterline block coefficient (\code{Cbw}) 4 | #' (dimensionless) using actual draft. 5 | #' 6 | #' @param Cb Maximum block coefficient (vector of numericals, dimensionless) 7 | #' (see \code{\link{calcCb}}) 8 | #' @param actualDraft Actual draft (vector of numericals, m) 9 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 10 | #' 11 | #' @details 12 | #' The block coefficient is the ratio of the vessel's displacement and its 13 | #' volume, defined by its waterline length (\code{lwl}), breadth, and draft: 14 | #' \deqn{Cb=\frac{displacement}{lwl*breadth*draft}}{Cb=displacement/(lwl*breadth*draft)} 15 | #' 16 | #' This function returns the waterline block coefficient (\code{Cbw}), which 17 | #' represents a loaded condition estimation using actual draft using the 18 | #' Riddlesworth method. Actual draft is typically obtained from sources such as 19 | #' AIS messages or ship records. 20 | #' 21 | #' NOTE: Technically, no block coefficient can be greater than 1. Even a 22 | #' waterline block coefficient of 1 itself is extremely improbable and can cause 23 | #' numerical errors elsewhere in the model. Therefore, the upper bound of the 24 | #' waterline block coefficient is fixed at 0.99 in this function. 25 | #' 26 | #' @return \code{Cbw} (vector of numericals, dimensionless) 27 | #' 28 | #' @references 29 | #'\href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 30 | #' Solutions. 2011. "Basic Principles of Propulsion."} 31 | #' 32 | #' @seealso \code{\link{calcCb}} 33 | #' 34 | #' @examples 35 | #' calcCbw(c(0.82,0.66),c(12.48,11.09),c(13.57,11.49)) 36 | #' calcCbw(0.82,12.48,13.57) 37 | #' 38 | #' @export 39 | 40 | calcCbw <- function(Cb,actualDraft,maxDraft){ 41 | 42 | 43 | #ensure that: actualDraft < maxDraft 44 | actualDraft<-pmin(actualDraft, 45 | maxDraft) 46 | 47 | Cbw<- pmin(0.99, 48 | 1-(1-pmin(0.99, 49 | Cb 50 | ) 51 | )*((maxDraft/actualDraft)^(1/3)) 52 | ) 53 | return(Cbw) 54 | } 55 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMFormFactor.r: -------------------------------------------------------------------------------- 1 | #'@title calcHMFormFactor 2 | #' 3 | #'@description Calculate form factor (1+k_1) from the Holtrop & Mennen method. 4 | #' 5 | #'@param maxDraft Maximum summer load line draft (vector of numericals, m) 6 | #'@param lwl Waterline length (vector of numericals, m) (see \code{\link{calclwl}}) 7 | #'@param breadth Moulded breadth (vector of numericals, m) 8 | #'@param maxDisplacement Maximum ship displacement (vector of numericals, m^3) 9 | #'@param Cp Prismatic coefficient (vector of numericals, dimensionless) (see 10 | #' \code{\link{calcCp}}) 11 | #'@param Cstern Afterbody form coefficient: 12 | #'\itemize{\item V-shaped Hull = -10 13 | #' \item U-Shaped Hull = 10 14 | #' \item Normal Hull = 0 (default) } 15 | #' Can supply either a vector of numericals, a single number, or rely on the default 16 | #'@param lcb Longitudinal position of center of buoyancy (vector of numericals, 17 | #' see \code{\link{calclcb}}) 18 | #' 19 | #'@return \code{formFactor} (vector of numericals) 20 | #' 21 | #'@references 22 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 23 | #'method." International Shipbuilding Progress 29. 24 | #' 25 | #'Holtrop, J. and Mennen, G. G. J. 1984. "A Statistical Re-Analysis of Resistance 26 | #'and Propulsion Data'. 27 | #' 28 | #'@seealso \itemize{ 29 | #'\item \code{\link{calclwl}} 30 | #'\item \code{\link{calcCp}} 31 | #'\item \code{\link{calclcb}} } 32 | #' 33 | #'@family Holtrop-Mennen Calculations 34 | #' 35 | #'@examples 36 | #' calcHMFormFactor(c(13.57,11.49),c(218.75, 209.25),c(32.25,32.20),c(80097,52382.04),c(0.81,0.67)) 37 | #' calcHMFormFactor(13.57,218.75,32.25,80097,0.81) 38 | #' 39 | #'@export 40 | 41 | calcHMFormFactor<-function(maxDraft,lwl,breadth,maxDisplacement,Cp,Cstern=0,lcb=0){ 42 | 43 | formFactor<- 44 | 0.93+0.487118* 45 | #c14 46 | (1+0.011*Cstern)* 47 | ((breadth/lwl)^1.06806)* 48 | ((maxDraft/lwl)^0.46106)* 49 | ( #L/Lr 50 | (1/(1-Cp+(0.06*Cp*-lcb)/(4*Cp-1)) 51 | )^0.121563)* 52 | ((lwl^3/maxDisplacement)^0.36486)*((1-Cp)^-0.604247) 53 | 54 | return(formFactor) 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /ShipPowerModel/README.md: -------------------------------------------------------------------------------- 1 | # US EPA ShipPowerModel 2 | 3 | ShipPowerModel is an R package that contains functions for modeling the propulsive power of commercial marine vessels (CMV). It contains four different power models: 4 | 5 | * Propeller law load factor model 6 | * Admiralty formula load factor model 7 | * Holtrop-Mennen resistance model 8 | * Kristensen resistance model 9 | 10 | This package can be used in conjunction with vessel information and [emission factors](../ShipEF) to estimate CMV air emissions. 11 | 12 | ## Getting Started 13 | 14 | These instructions should get ShipPowerModel installed and running within your installation of R. See the vignettes and library documentation for how to use this package. 15 | 16 | ### Prerequisites 17 | 18 | Building and installing this package and its documentation requires R version 3.5 or greater and the following packages: 19 | 20 | * devtools 21 | * data.table 22 | * testthat 23 | * knitr 24 | * rmarkdown 25 | * ggplot2 26 | 27 | ### Installation 28 | 29 | You can install this package directly from github using the following command: 30 | 31 | ``` 32 | devtools::install_github(repo = "USEPA/Marine_Emissions_Tools", 33 | subdir = "ShipPowerModel", 34 | build_vignettes = TRUE 35 | ) 36 | ``` 37 | 38 | ### Documentation 39 | 40 | After installation, documentation for this package can be accessed by typing `?ShipPowerModel` in the R console. 41 | 42 | ## EPA Disclaimer 43 | 44 | The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. 45 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calclwl.r: -------------------------------------------------------------------------------- 1 | #'@title calclwl 2 | #' 3 | #'@description Estimate waterline length (\code{lwl}) (m) from length between 4 | #'perpendiculars (\code{lbp}) (m). 5 | #' 6 | #'@param lbp Length between perpendiculars (vector of numericals, m) 7 | #'@param shipType Ship type (vector of strings, see \code{\link{calcShipType}}). 8 | #' Must align with 9 | #'\code{tankerBulkCarrierGCargoShipTypes} and \code{roroPaxShipTypes} groupings 10 | #'@param tankerBulkCarrierGCargoShipTypes Ship types specified in input 11 | #' \code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 12 | #' vessels (vector of strings) 13 | #'@param roroPaxShipTypes Ship types specified in input \code{shipTypes} to be 14 | #'modeled as RORO and passenger ships (vector of strings) 15 | #' 16 | #'@details 17 | #'This method this requires ship types to be grouped. Use the 18 | #' \code{tankerBulkCarrierGCargoShipTypes} and \code{roroPaxShipTypes} grouping 19 | #' parameters to provide these ship type groupings. Any ship types not included 20 | #' in these groupings will be considered as miscellaneous vessels. 21 | #' 22 | #'@return \code{lwl} (vector of numericals, m) 23 | #' 24 | #'@references 25 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 26 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 27 | #' 28 | #'@examples 29 | #'calclwl(c("bulk.carrier","container.ship","cruise"), c(214.5,396,140)) 30 | #' 31 | #'@export 32 | 33 | calclwl<-function(shipType, lbp, 34 | tankerBulkCarrierGCargoShipTypes=c("tanker","general.cargo","chemical.tanker","liquified.gas.tanker","oil.tanker","other.tanker","bulk.carrier"), 35 | roroPaxShipTypes=c("ro.ro","passenger","ferry.pax","ferry.ro.pax","cruise","yacht","cruise.ed") 36 | ){ 37 | lwl<- ifelse(shipType %in% tankerBulkCarrierGCargoShipTypes,#case 1 38 | 1.02*lbp, 39 | ifelse(shipType%in%roroPaxShipTypes,#case 2 40 | 1.035*lbp, 41 | 1.01*lbp #not in tanker, bulk carrier, general cargo, or passenger 42 | )#end case1 43 | )#end case2 44 | 45 | return(lwl) 46 | } 47 | -------------------------------------------------------------------------------- /ShipPowerModel/man/IMOGHG3_AuxLoadFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.r 3 | \docType{data} 4 | \name{IMOGHG3_AuxLoadFactor} 5 | \alias{IMOGHG3_AuxLoadFactor} 6 | \title{Auxiliary engine loads per operating mode, ship type and sub type using IMO GHG 3 methodology. Also used to define sub types.} 7 | \format{ 8 | A data frame with 56 rows and 9 variables: 9 | \describe{ 10 | \item{shipType}{Generalizable ship type. Define by \code{calcShipType.r}} 11 | \item{sizeMin}{Minimum size value for each subtype and their given size unit. Used to define subtype.} 12 | \item{sizeMax}{Maximum size value for each subtype and their given size unit. Used to define subtype.} 13 | \item{sizeUnits}{Size units used to define subtype size ranges.} 14 | \item{subType}{Sub type of each ship type which are defined by size ranges.} 15 | \item{Transit}{Auxiliary engine loads (kW) assigned to each vessel by subtype when transiting. Transiting defined by \code{calcOperatingMode.r}} 16 | \item{Maneuvering}{Auxiliary engine loads (kW) assigned to each vessel by subtype when Maneuvering. Maneuvering defined by \code{calcOperatingMode.r}} 17 | \item{Berth}{Auxiliary engine loads (kW) assigned to each vessel by subtype when berth. Berthing defined by \code{calcOperatingMode.r}} 18 | \item{Anchorage}{Auxiliary engine loads (kW) assigned to each vessel by subtype when anchoring. Anchorage defined by \code{calcOperatingMode.r}} 19 | } 20 | } 21 | \usage{ 22 | data(IMOGHG3_AuxLoadFactor) 23 | } 24 | \description{ 25 | Auxiliary engine loads per operating mode, ship type and sub type using IMO GHG 3 methodology. Also used to define sub types. 26 | } 27 | \details{ 28 | IMO GHG 3 uses Starcrest 2014 auxiliary loads from multiple vessel boarding programs(VBP) around the US in addition to FMI international auxiliary load data. 29 | 30 | This data is used in \code{calcAuxBoilerLoad.r} \code{calcSubType.r} 31 | } 32 | \examples{ 33 | assign("Loads",get(utils::data(IMOGHG3_AuxLoadFactor))) 34 | } 35 | \references{ 36 | International Maritime Organization.Third IMO GHG Study 2014 - Final Report. London: International Maritime Organization, 2014. 37 | } 38 | \keyword{datasets} 39 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMWettedSA.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMWettedSA.r 3 | \name{calcHMWettedSA} 4 | \alias{calcHMWettedSA} 5 | \title{calcHMWettedSA} 6 | \usage{ 7 | calcHMWettedSA(lwl, actualDraft, breadth, Cm, Cbw, Cwp, Abt) 8 | } 9 | \arguments{ 10 | \item{lwl}{Waterline length (vector of numericals, m) (see 11 | \code{\link{calclwl}})} 12 | 13 | \item{actualDraft}{Actual draft (vector of numericals, m)} 14 | 15 | \item{breadth}{Moulded breadth (vector of numericals, m)} 16 | 17 | \item{Cm}{Midship section coefficient (vector of numericals, dimensionless) 18 | (see \code{\link{calcCm}})} 19 | 20 | \item{Cbw}{Waterline block coefficient (vector of numericals, dimensionless) 21 | (see \code{\link{calcCbw}})} 22 | 23 | \item{Cwp}{Water plane area coefficient (vector of numericals, see 24 | \code{\link{calcCwp}})} 25 | 26 | \item{Abt}{Traverse bulb area (vector of numericals, m^2) (see 27 | \code{\link{calcAbt}})} 28 | } 29 | \value{ 30 | \code{wettedSA} (vector of numericals, m^2) 31 | } 32 | \description{ 33 | Calculate hull wetted surface area (\code{wettedSA}) (m^2) 34 | using the Holtrop & Mennen method. 35 | } 36 | \details{ 37 | Actual draft is typically obtained from sources such as AIS messages or ship 38 | records. 39 | } 40 | \examples{ 41 | calcHMWettedSA(218.75,12.48,32.25,0.99,0.81,0.91,32.02) 42 | 43 | } 44 | \references{ 45 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 46 | method." International Shipbuilding Progress 29. 47 | } 48 | \seealso{ 49 | \itemize{ 50 | \item \code{\link{calclwl}} 51 | \item \code{\link{calcCm}} 52 | \item \code{\link{calcCbw}} 53 | \item \code{\link{calcCwp}} 54 | \item \code{\link{calcAbt}}} 55 | 56 | Other Holtrop-Mennen Calculations: 57 | \code{\link{calcHMAppendageRes}()}, 58 | \code{\link{calcHMBulbousBowRes}()}, 59 | \code{\link{calcHMCa}()}, 60 | \code{\link{calcHMFormFactor}()}, 61 | \code{\link{calcHMImmersedTransomRes}()}, 62 | \code{\link{calcHMPwr}()}, 63 | \code{\link{calcHMThrustFactor}()}, 64 | \code{\link{calcHMTotalRes}()}, 65 | \code{\link{calcHMWakeFraction}()}, 66 | \code{\link{calcHMWaveMakingRes}()} 67 | } 68 | \concept{Holtrop-Mennen Calculations} 69 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcOpenWaterEff.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcOpenWaterEff.r 3 | \name{calcOpenWaterEff} 4 | \alias{calcOpenWaterEff} 5 | \title{calcOpenWaterEff} 6 | \usage{ 7 | calcOpenWaterEff( 8 | Rtot, 9 | thrustFactor, 10 | nProp, 11 | wakeFraction, 12 | propDiam, 13 | shipSpeed, 14 | seawaterDensity = 1.025 15 | ) 16 | } 17 | \arguments{ 18 | \item{Rtot}{Total ship resistance (vector of numericals, kN) (see 19 | \code{\link{calcKristTotalRes}} or \code{\link{calcHMTotalRes}})} 20 | 21 | \item{thrustFactor}{Thrust deduction factor (vector of numericals, 22 | dimensionless) (see \code{\link{calcKristThrustFactor}} or 23 | \code{\link{calcHMThrustFactor}})} 24 | 25 | \item{nProp}{Number of propellers (vector of numericals, see 26 | \code{\link{calcPropNum}})} 27 | 28 | \item{wakeFraction}{Wake fraction coefficient (vector of numericals, 29 | dimensionless) (see \code{\link{calcKristWakeFrac}} or 30 | \code{\link{calcHMWakeFraction}})} 31 | 32 | \item{propDiam}{Propeller diameter (vector of numericals, m) (see 33 | \code{\link{calcPropDia}})} 34 | 35 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 36 | \code{\link{calcSpeedUnitConversion}})} 37 | 38 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 39 | supply either a vector of numericals, a single number, or rely on the default} 40 | } 41 | \value{ 42 | \code{openWaterEff} (vector of numericals, dimensionless) 43 | } 44 | \description{ 45 | Calculate the open water efficiency (\code{openWaterEff}) 46 | (dimensionless) using the Kristensen method with Harvald regressions. 47 | } 48 | \examples{ 49 | calcOpenWaterEff(398.487,0.1894947,1,0.3199536,6.7,0,seawaterDensity=1.025) 50 | 51 | } 52 | \references{ 53 | \href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 54 | "Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 55 | } 56 | \seealso{ 57 | \itemize{ 58 | \item \code{\link{calcKristTotalRes}} 59 | \item \code{\link{calcHMTotalRes}} 60 | \item \code{\link{calcKristThrustFactor}} 61 | \item \code{\link{calcHMThrustFactor}} 62 | \item \code{\link{calcPropNum}} 63 | \item \code{\link{calcKristWakeFrac}} 64 | \item \code{\link{calcHMWakeFraction}} 65 | \item \code{\link{calcPropDia}} 66 | \item \code{\link{calcSpeedUnitConversion}}} 67 | } 68 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Marine Emissions Tools Beta 2 2 | 3 | EPA's Marine Emissions Tools are designed to model emissions from Category 3 commercial marine vessels (CMV) given specific vessel information and operating conditions. This toolset contains two R packages: 4 | * [ShipEF](./ShipEF), which contains functions to assign marine vessel emission factors 5 | * [ShipPowerModel](./ShipPowerModel), which contains functions to calculate ship propulsive power and auxiliary/boiler engine loads 6 | 7 | See the individual package readme files for installation instructions. For information on how to use these packages, see the package documentation, vignettes, and the [cheat sheets](./CheatSheets). 8 | 9 | ## About this Beta Version 10 | ShipEF and ShipPowerModel are currently in beta. A previous version of these R packages was used to develop the CMV inventories for the 2017 [National Emissions Inventoy](https://www.epa.gov/air-emissions-inventories/national-emissions-inventory-nei) (NEI). This beta version will form the basis for the CMV inventories for the 2020 NEI. Future versions of this toolset may include other features, such as capabilities for modeling Category 1 and 2 vessels. 11 | 12 | Even though ShipEF and ShipPowerModel are currently in beta, these tools are consistent with the [EPA Port Emissions Inventory Guidance](https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf), and therefore they may be used for voluntary and research purposes, as well as to develop inventories to meet regulatory requirements. For more information on how or why to develop a mobile source port-related air pollution emissions inventory, see the Port Emissions Inventory Guidance. 13 | 14 | ## EPA Disclaimer 15 | 16 | The United States Environmental Protection Agency (EPA) GitHub project code is provided on an "as is" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government. 17 | -------------------------------------------------------------------------------- /ShipEF/R/calcShipCategory.r: -------------------------------------------------------------------------------- 1 | #' @title calcShipCategory 2 | #' 3 | #' @description 4 | #' Assigns EPA regulatory ship category from engine displacement 5 | #' 6 | #' @param mainEngineBore Diameter of the main engine cylinder (mm) (vector of 7 | #' numericals) 8 | #' @param mainEngineStroke Main engine stroke length, the distance travelled by 9 | #' the piston in each cycle (mm) (vector of numericals) 10 | #' 11 | #'@details 12 | #'For more information, see Section 3.3.2.1 of the Port Emissions Inventory 13 | #'Guidance. 14 | #' 15 | #' @return \code{shipCategory} (vector of ints). Valid values are: \itemize{ 16 | #' \item 1 17 | #' \item 2 18 | #' \item 3 19 | #' } 20 | #' 21 | #' @references 22 | #'\href{https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=P1005ZGH.TXT}{EPA. 2009. 23 | #'"Regulatory impact analysis: Control of emissions air pollution from category 24 | #'3 marine diesel engines." Ann Arbor, MI: Office of Transportation and Air 25 | #'Quality. US Environmental Protection Agency.} 26 | #' 27 | #'\href{https://nepis.epa.gov/Exe/ZyPDF.cgi/?Dockey=P10024CN.PDF}{EPA. 2008. 28 | #'"Regulatory impact analysis: Control of emissions of air pollution from 29 | #'locomotive engines and marine compression ignition engines less than 30 liters 30 | #'per cylinder." Ann Arbor, MI: Office of Transportation and Air 31 | #'Quality. US Environmental Protection Agency.} 32 | #' 33 | #' \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 34 | #' "Port Emissions Inventory Guidance: Methodologies for Estimating 35 | #' Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 36 | #' Office of Transportation and Air Quality. US Environmental Protection Agency.} 37 | #' 38 | #' @examples 39 | #' calcShipCategory(400, 240) 40 | #' 41 | #' @export 42 | 43 | 44 | calcShipCategory<- function(mainEngineBore, mainEngineStroke){ 45 | 46 | # Calculate displacement in L/cyl 47 | main.engine.displacement <- ((pi / 4) * (mainEngineBore/10) ^ 2 * 48 | (mainEngineStroke / 10)) / 1000 49 | 50 | # Categorize Ships (C1/C2/C3) 51 | shipCategory <- ifelse(main.engine.displacement>= 30, 3, 52 | ifelse(main.engine.displacement >= 7, 2, 53 | ifelse(main.engine.displacement > 0 , 1, 54 | NA))) 55 | return(shipCategory) 56 | } 57 | -------------------------------------------------------------------------------- /ShipEF/R/calcEF_CO.r: -------------------------------------------------------------------------------- 1 | #'@title calcEF_CO 2 | #' 3 | #'@description 4 | #'Calculates the appropriate carbon monoxide (CO) emission factor (g/kWh) for 5 | #'the given parameters. 6 | #' 7 | #'@param engineType Engine type (string or vector of strings) (see 8 | #'\code{\link{calcEngineType}}). Valid values are: \itemize{ 9 | #'\item "SSD" 10 | #'\item "MSD" 11 | #'\item "MSD-ED" 12 | #'\item "GT" 13 | #'\item "GT-ED" 14 | #'\item "ST" 15 | #'\item "LNG" 16 | #'\item "HSD" (auxiliary only) 17 | #'\item "Boiler" (boiler only) 18 | #'} 19 | #'@param main_aux_boiler Is this calculation for a propulsive (main), auxiliary 20 | #'(aux), or boiler engine? Options: \itemize{ 21 | #' \item "main" (Default) 22 | #' \item "aux" 23 | #' \item "boiler" 24 | #'} 25 | #' 26 | #'@details 27 | #'For more information about calculating CO emission factors, see Section 3.5.4 28 | #'of the Port Emissions Inventory Guidance. 29 | #' 30 | #'@return \code{EF_CO} (g/kWh) (vector of numericals) 31 | #' 32 | #'@references 33 | #' \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 34 | #' "Ports Emissions Inventory Guidance: Methodologies for Estimating 35 | #' Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 36 | #' Office of Transportation and Air Quality. US Environmental Protection Agency.} 37 | #' 38 | #' @examples 39 | #' calcEF_CO(c("SSD","MSD","MSD-ED"), main_aux_boiler="main") 40 | #' calcEF_CO(c("HSD","MSD","LNG"), main_aux_boiler="aux") 41 | #' calcEF_CO(c("Boiler"), main_aux_boiler="boiler") 42 | #' 43 | #'@import data.table 44 | #'@importFrom utils data 45 | #'@importFrom utils tail 46 | #'@export 47 | 48 | 49 | calcEF_CO<-function(engineType,main_aux_boiler="main"){ 50 | 51 | #bind variables to make devtools::check() happy 52 | Main_HC_CO_EF<-Aux_HC_CO_EF<-Boiler_HC_CO_EF<-NULL 53 | 54 | #Read In Emission Factor DataFrames 55 | if(main_aux_boiler=="main"){ 56 | EF<-ShipEF::Main_HC_CO_EF 57 | }else if(main_aux_boiler=="aux"){ 58 | EF<-ShipEF::Aux_HC_CO_EF 59 | }else if(main_aux_boiler=="boiler"){ 60 | EF<-ShipEF::Boiler_HC_CO_EF 61 | } 62 | 63 | #================================================================= 64 | if(main_aux_boiler=="boiler"){engineType<-rep("Boiler",length(engineType))} 65 | 66 | df<-data.table::as.data.table(engineType) 67 | co<-EF[,c("engineType","co")][df,on=c("engineType")][,c("co")] 68 | 69 | return(co) 70 | } 71 | -------------------------------------------------------------------------------- /ShipEF/docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcKristTotalRes.r: -------------------------------------------------------------------------------- 1 | #' @title calcKristTotalRes 2 | #' 3 | #' @description Calculate total ship resistance (\code{Rtot}) (kN) using the 4 | #' Kristensen method. 5 | #' 6 | #' @param wettedSA Wetted hull surface area (vector of numericals, m^2) (see 7 | #' \code{\link{calcKristWettedSA}}) 8 | #' @param Cf Frictional resistance coefficient (vector of numericals, 9 | #' dimensionless) (see \code{\link{calcCf}}) 10 | #' @param Cr Residual resistance coefficient (vector of numericals, 11 | #' dimensionless) (see \code{\link{calcKristCr}}) 12 | #' @param Ca Incremental hull (roughness) resistance coefficient (vector of 13 | #' numericals, dimensionless) (see \code{\link{calcKristCa}}) 14 | #' @param Caa Air resistance coefficient (vector of numericals, dimensionless) 15 | #' (see \code{\link{calcKristCaa}}) 16 | #' @param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 17 | #' supply either a vector of numericals, a single number, or rely on the default 18 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 19 | #' \code{\link{calcSpeedUnitConversion}}) 20 | #' @param serviceMargin A service margin to account for weather and sea effects: 21 | #' \itemize{\item Coastal operations = 10 \item At-sea operations = 15} Can 22 | #' supply either a vector of numericals, a single number, or rely on the default 23 | #' 24 | #' @details 25 | #' Note that service margin is included here as a resistance term. 26 | #' 27 | #' @return \code{Rtot} (vector of numericals, kN) 28 | #' 29 | #' @references 30 | #'Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 31 | #'Power of Ships." 32 | #' 33 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 34 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 35 | #' 36 | #'@seealso \itemize{ 37 | #'\item \code{\link{calcCf}} 38 | #'\item \code{\link{calcSpeedUnitConversion}} 39 | #'} 40 | #' 41 | #' @family Kristensen Calculations 42 | #' @family Resistance Calculations 43 | #' 44 | #' @examples 45 | #' calcKristTotalRes(10714.62,0.0015,0.00043,6.46e-05,5e-05,1.025,10.8,15) 46 | #' 47 | #' @export 48 | 49 | calcKristTotalRes<- function(wettedSA,Cf,Cr,Ca,Caa,seawaterDensity,shipSpeed, 50 | serviceMargin){ 51 | 52 | Rtot<- wettedSA*(Cf+Cr+Ca+Caa)*seawaterDensity*(shipSpeed^2)*0.5*(1+serviceMargin/100) 53 | return(Rtot) 54 | } 55 | -------------------------------------------------------------------------------- /ShipEF/R/calcEF_HC.r: -------------------------------------------------------------------------------- 1 | #'@title calcEF_HC 2 | #' 3 | #'@description 4 | #'Calculates the appropriate hydrocarbon (HC) emission factor (g/kWh) for 5 | #'the given parameters. 6 | #' 7 | #'@param engineType Engine type (string or vector of strings) (see 8 | #'\code{\link{calcEngineType}}). Valid values are: \itemize{ 9 | #'\item "SSD" 10 | #'\item "MSD" 11 | #'\item "MSD-ED" 12 | #'\item "GT" 13 | #'\item "GT-ED" 14 | #'\item "ST" 15 | #'\item "LNG" 16 | #'\item "HSD" (auxiliary only) 17 | #'\item "Boiler" (boiler only) 18 | #'} 19 | #'@param main_aux_boiler Is this calculation for a propulsive (main), auxiliary 20 | #'(aux), or boiler engine? Options: \itemize{ 21 | #' \item "main" (Default) 22 | #' \item "aux" 23 | #' \item "boiler" 24 | #'} 25 | #' 26 | #'@details 27 | #'For more information about calculating HC emission factors, see Section 3.5.4 28 | #'of the Port Emissions Inventory Guidance. 29 | #' 30 | #'@return \code{EF_HC} (g/kWh) (vector of numericals) 31 | #' 32 | #'@references 33 | #' \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 34 | #' "Ports Emissions Inventory Guidance: Methodologies for Estimating 35 | #' Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 36 | #' Office of Transportation and Air Quality. US Environmental Protection Agency.} 37 | #' 38 | #'@examples 39 | #'calcEF_HC(c("SSD","MSD","MSD-ED")) 40 | #'calcEF_HC(c("HSD","MSD","LNG"),main_aux_boiler="aux") 41 | #'calcEF_HC(c("Boiler"), main_aux_boiler="boiler") 42 | #' 43 | #' @import data.table 44 | #' @importFrom utils data 45 | #' @importFrom utils tail 46 | #'@export 47 | 48 | calcEF_HC<-function(engineType, 49 | main_aux_boiler="main" 50 | ) 51 | { 52 | #bind variables to make devtools::check() happy 53 | Main_HC_CO_EF<-Aux_HC_CO_EF<-Boiler_HC_CO_EF<-NULL 54 | 55 | #Read In Emission Factor DataFrames 56 | if(main_aux_boiler=="main"){ 57 | EF<-ShipEF::Main_HC_CO_EF 58 | }else if(main_aux_boiler=="aux"){ 59 | EF<-ShipEF::Aux_HC_CO_EF 60 | }else if(main_aux_boiler=="boiler"){ 61 | EF<-ShipEF::Boiler_HC_CO_EF 62 | } 63 | #================================================================= 64 | if(main_aux_boiler=="boiler"){engineType<-rep("Boiler",length(engineType))} 65 | 66 | df<-data.table::as.data.table(engineType) 67 | hc<-EF[,c("engineType","hc")][df,on=c("engineType")][,c("hc")] 68 | 69 | return(hc) 70 | } 71 | -------------------------------------------------------------------------------- /ShipPowerModel/docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMFormFactor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMFormFactor.r 3 | \name{calcHMFormFactor} 4 | \alias{calcHMFormFactor} 5 | \title{calcHMFormFactor} 6 | \usage{ 7 | calcHMFormFactor( 8 | maxDraft, 9 | lwl, 10 | breadth, 11 | maxDisplacement, 12 | Cp, 13 | Cstern = 0, 14 | lcb = 0 15 | ) 16 | } 17 | \arguments{ 18 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 19 | 20 | \item{lwl}{Waterline length (vector of numericals, m) (see \code{\link{calclwl}})} 21 | 22 | \item{breadth}{Moulded breadth (vector of numericals, m)} 23 | 24 | \item{maxDisplacement}{Maximum ship displacement (vector of numericals, m^3)} 25 | 26 | \item{Cp}{Prismatic coefficient (vector of numericals, dimensionless) (see 27 | \code{\link{calcCp}})} 28 | 29 | \item{Cstern}{Afterbody form coefficient: 30 | \itemize{\item V-shaped Hull = -10 31 | \item U-Shaped Hull = 10 32 | \item Normal Hull = 0 (default) } 33 | Can supply either a vector of numericals, a single number, or rely on the default} 34 | 35 | \item{lcb}{Longitudinal position of center of buoyancy (vector of numericals, 36 | see \code{\link{calclcb}})} 37 | } 38 | \value{ 39 | \code{formFactor} (vector of numericals) 40 | } 41 | \description{ 42 | Calculate form factor (1+k_1) from the Holtrop & Mennen method. 43 | } 44 | \examples{ 45 | calcHMFormFactor(c(13.57,11.49),c(218.75, 209.25),c(32.25,32.20),c(80097,52382.04),c(0.81,0.67)) 46 | calcHMFormFactor(13.57,218.75,32.25,80097,0.81) 47 | 48 | } 49 | \references{ 50 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 51 | method." International Shipbuilding Progress 29. 52 | 53 | Holtrop, J. and Mennen, G. G. J. 1984. "A Statistical Re-Analysis of Resistance 54 | and Propulsion Data'. 55 | } 56 | \seealso{ 57 | \itemize{ 58 | \item \code{\link{calclwl}} 59 | \item \code{\link{calcCp}} 60 | \item \code{\link{calclcb}} } 61 | 62 | Other Holtrop-Mennen Calculations: 63 | \code{\link{calcHMAppendageRes}()}, 64 | \code{\link{calcHMBulbousBowRes}()}, 65 | \code{\link{calcHMCa}()}, 66 | \code{\link{calcHMImmersedTransomRes}()}, 67 | \code{\link{calcHMPwr}()}, 68 | \code{\link{calcHMThrustFactor}()}, 69 | \code{\link{calcHMTotalRes}()}, 70 | \code{\link{calcHMWakeFraction}()}, 71 | \code{\link{calcHMWaveMakingRes}()}, 72 | \code{\link{calcHMWettedSA}()} 73 | } 74 | \concept{Holtrop-Mennen Calculations} 75 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcPropDia.r: -------------------------------------------------------------------------------- 1 | #' @title calcPropDia 2 | #' 3 | #' @description Calculate propeller diameter (\code{propDiam}) (m). 4 | #' 5 | #'@param shipType Ship type (vector of strings, see \code{\link{calcShipType}}). 6 | #' Must align with \code{tankerBulkCarrierGCargoShipTypes} and 7 | #' \code{containerShipTypes} groupings 8 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 9 | #' @param tankerBulkCarrierGCargoShipTypes Ship types specified in input 10 | #' \code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 11 | #' vessels (vector of strings) 12 | #' @param containerShipTypes Ship types specified in input \code{shipTypes} to 13 | #' be modeled as container ships (vector of strings) 14 | #' 15 | #'@details 16 | #'This method this requires ship types to be grouped. Use the 17 | #' \code{tankerBulkCarrierGCargoShipTypes} and \code{containerShipTypes} grouping 18 | #' parameters to provide these ship type groupings. Any ship types not included 19 | #' in these groupings will be considered as miscellaneous vessels. 20 | #' 21 | #' @return \code{propDiam} (vector of numericals, m) 22 | #' 23 | #' @references 24 | #'Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 25 | #'Power of Ships." 26 | #' 27 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 28 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 29 | #' 30 | #' @examples 31 | #' calcPropDia(c("bulk.carrier","container.ship"), c(13.6,15.6)) 32 | #' calcPropDia(c("other.tanker","container.ship"), c(13.6,15.6), 33 | #' tankerBulkCarrierGCargoShipTypes=c("other.tanker","bulk.carrier")) 34 | #' 35 | #' @export 36 | 37 | calcPropDia <-function(shipType, maxDraft, 38 | tankerBulkCarrierGCargoShipTypes=c("general.cargo","tanker","chemical.tanker","liquified.gas.tanker","oil.tanker","other.tanker","bulk.carrier"), 39 | containerShipTypes=c("container.ship") 40 | ){ 41 | 42 | 43 | propDiam<-ifelse( #case 1 44 | shipType %in% tankerBulkCarrierGCargoShipTypes, 45 | #if true return: 46 | 0.395*maxDraft+1.3, 47 | #otherwise: 48 | ifelse( #case 2 49 | shipType%in%containerShipTypes, 50 | #if true return: 51 | 0.623*maxDraft-0.16, 52 | #otherwise: (RoRo etc...) 53 | 0.713*maxDraft-0.08 54 | )#end case 2 55 | )#end case 1 56 | 57 | return(propDiam) 58 | } 59 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcOpenWaterEff.r: -------------------------------------------------------------------------------- 1 | #' @title calcOpenWaterEff 2 | #' 3 | #' @description Calculate the open water efficiency (\code{openWaterEff}) 4 | #' (dimensionless) using the Kristensen method with Harvald regressions. 5 | #' 6 | #' @param Rtot Total ship resistance (vector of numericals, kN) (see 7 | #' \code{\link{calcKristTotalRes}} or \code{\link{calcHMTotalRes}}) 8 | #' @param thrustFactor Thrust deduction factor (vector of numericals, 9 | #' dimensionless) (see \code{\link{calcKristThrustFactor}} or 10 | #' \code{\link{calcHMThrustFactor}}) 11 | #' @param nProp Number of propellers (vector of numericals, see 12 | #' \code{\link{calcPropNum}}) 13 | #' @param wakeFraction Wake fraction coefficient (vector of numericals, 14 | #' dimensionless) (see \code{\link{calcKristWakeFrac}} or 15 | #' \code{\link{calcHMWakeFraction}}) 16 | #' @param propDiam Propeller diameter (vector of numericals, m) (see 17 | #' \code{\link{calcPropDia}}) 18 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 19 | #' \code{\link{calcSpeedUnitConversion}}) 20 | #' @param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 21 | #' supply either a vector of numericals, a single number, or rely on the default 22 | #' 23 | #' @return \code{openWaterEff} (vector of numericals, dimensionless) 24 | #' 25 | #'@references 26 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 27 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 28 | #' 29 | #'@seealso \itemize{ 30 | #'\item \code{\link{calcKristTotalRes}} 31 | #'\item \code{\link{calcHMTotalRes}} 32 | #'\item \code{\link{calcKristThrustFactor}} 33 | #'\item \code{\link{calcHMThrustFactor}} 34 | #'\item \code{\link{calcPropNum}} 35 | #'\item \code{\link{calcKristWakeFrac}} 36 | #'\item \code{\link{calcHMWakeFraction}} 37 | #'\item \code{\link{calcPropDia}} 38 | #'\item \code{\link{calcSpeedUnitConversion}}} 39 | #' 40 | #' @examples 41 | #' calcOpenWaterEff(398.487,0.1894947,1,0.3199536,6.7,0,seawaterDensity=1.025) 42 | #' 43 | #' @export 44 | 45 | 46 | 47 | calcOpenWaterEff<-function(Rtot,thrustFactor,nProp,wakeFraction,propDiam,shipSpeed,seawaterDensity=1.025){ 48 | 49 | 50 | cth<- (8/pi)*Rtot/(1-thrustFactor)/nProp/seawaterDensity/((1-wakeFraction)*shipSpeed*propDiam)^2 51 | 52 | 53 | openWaterEff<- ifelse(shipSpeed==0, 54 | 0, 55 | ((2/(1+sqrt((cth)+1)))*pmax(0.65, 0.81-0.014*(cth))) 56 | ) 57 | 58 | return(openWaterEff) 59 | 60 | } 61 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMCa.r: -------------------------------------------------------------------------------- 1 | #' @title calcHMCa 2 | #' 3 | #'@description Calculate incremental hull (roughness) resistance coefficient 4 | #'(\code{Ca}) (dimensionless), which describes the effect of hull roughness and 5 | #' still-air resistance, using the Holtrop & Mennen method. 6 | #' 7 | #' @param maxDraft Maximum summer load line draft (vector of numericals, m) 8 | #' @param lwl Waterline length (vector of numericals, m) (see \code{\link{calclwl}}) 9 | #' @param Cbw Waterline block coefficient (vector of numericals, dimensionless) 10 | #' (see \code{\link{calcCbw}}) 11 | #' @param breadth Moulded breadth (vector of numericals, m) 12 | #' @param forwardDraft Forward draft (deviation from actual draft indicates trim) 13 | #' (vector of numericals, m) 14 | #' @param Abt Traverse bulb area (vector of numericals, m^2) (see 15 | #' \code{\link{calcAbt}}) 16 | #' @param hb Center of bulb area above keel line (vector of numericals, m) (see 17 | #' \code{\link{calchb}}) 18 | #' 19 | #' @return \code{Ca} (vector of numericals, dimensionless) 20 | #' 21 | #' @references 22 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 23 | #'method." International Shipbuilding Progress 29. 24 | #' 25 | #'@seealso \itemize{ 26 | #'\item \code{\link{calclwl}} 27 | #'\item \code{\link{calcCbw}} 28 | #'\item \code{\link{calcAbt}} 29 | #'\item \code{\link{calchb}} 30 | #'} 31 | #' 32 | #' @family Holtrop-Mennen Calculations 33 | #' @family Resistance Calculations 34 | #' 35 | #' @examples 36 | #' calcHMCa(c(13.57,11.49),c(218.7500,209.2518),c(0.81,0.65),c(32.25,32.20),c(13.57,11.49), 37 | #' c(25.09,55.86),c(5.43,4.6)) 38 | #' 39 | #'calcHMCa(13.57,218.7500,0.81,32.25,13.57,25.0880,5.428) 40 | #' 41 | #' @export 42 | 43 | calcHMCa<-function(maxDraft,lwl,Cbw,breadth,forwardDraft,Abt,hb){ 44 | 45 | Ca<- 46 | ifelse(forwardDraft/lwl<=0.04,#case 1 47 | 0.006*((lwl+100)^-0.16)-0.00205+0.003*sqrt(lwl/7.5)*Cbw^4* 48 | (#c2 49 | exp(-1.89*sqrt( 50 | #c3 51 | 0.56*Abt^1.5/(breadth*maxDraft*( 52 | 0.31*sqrt(Abt)+forwardDraft-hb 53 | )) 54 | )) 55 | )* 56 | (0.04- 57 | (#c4 58 | forwardDraft/lwl 59 | )) 60 | ,#case 2 61 | 0.006*((lwl+100)^-0.16)-0.00205+0.003*sqrt(lwl/7.5)*Cbw^4* 62 | (#c2 63 | exp(-1.89*sqrt( 64 | #c3 65 | 0.56*Abt^1.5/(breadth*maxDraft*( 66 | 0.31*sqrt(Abt)+forwardDraft-hb 67 | )) 68 | )) 69 | )* 70 | (0.04- 71 | (#c4 72 | 0.04 73 | )) 74 | ) 75 | 76 | return(Ca) 77 | } 78 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMImmersedTransomRes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMImmersedTransomRes.r 3 | \name{calcHMImmersedTransomRes} 4 | \alias{calcHMImmersedTransomRes} 5 | \title{calcHMImmersedTransomRes} 6 | \usage{ 7 | calcHMImmersedTransomRes( 8 | shipSpeed, 9 | breadth, 10 | Cwp, 11 | maxDraft, 12 | At, 13 | seawaterDensity = 1.025 14 | ) 15 | } 16 | \arguments{ 17 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 18 | \code{\link{calcSpeedUnitConversion}})} 19 | 20 | \item{breadth}{Moulded breadth (vector of numericals, m)} 21 | 22 | \item{Cwp}{Water plane area coefficient (vector of numericals, see 23 | \code{\link{calcCwp}})} 24 | 25 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 26 | 27 | \item{At}{Transom area (vector of numericals, m^2) (see \code{\link{calcAt}})} 28 | 29 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 30 | supply either a vector of numericals, a single number, or rely on the default} 31 | } 32 | \value{ 33 | \code{Rtr} (vector of numericals, kN) 34 | } 35 | \description{ 36 | Calculate additional pressure resistance due to immersed transom (\code{Rtr}) 37 | (kN). 38 | } 39 | \examples{ 40 | calcHMImmersedTransomRes(seq(1,5,1),32.25,0.91,13.57,22.2,seawaterDensity=1.025) 41 | 42 | } 43 | \references{ 44 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 45 | method." International Shipbuilding Progress 29. 46 | } 47 | \seealso{ 48 | \itemize{ 49 | \item \code{\link{calcSpeedUnitConversion}} 50 | \item \code{\link{calcCwp}} 51 | \item \code{\link{calcAt}} } 52 | 53 | Other Holtrop-Mennen Calculations: 54 | \code{\link{calcHMAppendageRes}()}, 55 | \code{\link{calcHMBulbousBowRes}()}, 56 | \code{\link{calcHMCa}()}, 57 | \code{\link{calcHMFormFactor}()}, 58 | \code{\link{calcHMPwr}()}, 59 | \code{\link{calcHMThrustFactor}()}, 60 | \code{\link{calcHMTotalRes}()}, 61 | \code{\link{calcHMWakeFraction}()}, 62 | \code{\link{calcHMWaveMakingRes}()}, 63 | \code{\link{calcHMWettedSA}()} 64 | 65 | Other Resistance Calculations: 66 | \code{\link{calcCf}()}, 67 | \code{\link{calcHMAppendageRes}()}, 68 | \code{\link{calcHMBulbousBowRes}()}, 69 | \code{\link{calcHMCa}()}, 70 | \code{\link{calcHMTotalRes}()}, 71 | \code{\link{calcHMWaveMakingRes}()}, 72 | \code{\link{calcKristCaa}()}, 73 | \code{\link{calcKristCa}()}, 74 | \code{\link{calcKristCr}()}, 75 | \code{\link{calcKristTotalRes}()} 76 | } 77 | \concept{Holtrop-Mennen Calculations} 78 | \concept{Resistance Calculations} 79 | -------------------------------------------------------------------------------- /ShipPowerModel/inst/extdata/Sample.Ships.csv: -------------------------------------------------------------------------------- 1 | "ship.type","dwt","lbp","lwl","breadth","Displacement","maxDraft","actualDraft","actual.disp","Cbw","Cm","Cp","M","FroudeNum","propDiam","t","w","hulleff","openwatereff","Cf","Cr","Ca","Caa","wettedSA","Power","Rtot","MCR","service.speed","shipSpeed" 2 | "bulk.carrier",70000,214.46,218.75,32.25,80097,13.57,12.48,71866.6038787138,0.809900252,0.994563301282051,0.814327505304077,5.26145290705207,0.119926782129677,6.66015,0.196106459874913,0.338021766244735,1.215672957,0.568891281041922,0.00152636163966249,0.000419169754868896,6.9677992156477e-05,5e-05,10598.3597742673,3267.0698687008,398.147404825964,9363,14.58,10.8 3 | "container.ship",191144,396.3068995,400.2699685,49,238941.8748,15.6,14.14960292,211440.440861811,0.749028687,0.977949911261538,0.765917229885288,6.71877846919321,0.155970891197493,9.5588,0.173032936220121,0.297222282931966,1.177,0.606420152909448,0.00132714171920816,0.000360951187095851,-0.000173168754976502,9e-05,24746.6387484094,31250.4440205537,2235.99878298647,69029,23,19 4 | "tanker",130000,256.81,261.95,45.47,151488,15.52,14.31,136270.636157908,0.793,0.994577218728162,0.797323712093533,5.09038903810143,0.152211867326519,7.4304,0.206451188025367,0.346844918677927,1.216,0.534851254814008,0.00143450886854894,0.000634302349129989,-6.90075390566078e-05,5e-05,16100.769957321,14031.7180502843,1158.07066642108,13384,15,15 5 | "container.ship",39437.25059,207.18,209.2518,32.2,52382.03931,11.49,11.09004404,49325.5320939023,0.653560065,0.979278711683096,0.667389229647114,5.70573954175358,0.249815086030681,6.99827,0.20169536735852,0.216765973089204,1.019241511,0.622935756466325,0.00140757698751396,0.000943891711411293,0.000144043617279074,0.000102103529094388,8631.1204151193,30792.9056167286,1692.81439363373,23472,20.5,22.00324864 6 | "tanker",25500,159.9797904,163.1793862,25.47240103,33047.1021,9.728098518,9.046500394,29982.1079254721,0.791259474,0.994623280774712,0.795536852288123,5.25264327624762,0.120000000011117,5.14259891461,0.19982692519424,0.320483885672256,1.178636225,0.567281227053914,0.00161290792067975,0.000417176745641779,0.0002342015987935,7e-05,5929.83044460818,1379.19168924263,188.055004357425,6300,14.7,9.333562446 7 | "bulk.carrier",10780,118.4445369,120.8134276,19.59674694,14068.16006,7.336175911,6.826963616,12772.3640056888,0.784086287,0.994627057998517,0.788321894819363,5.16842371016247,0.2007006941538,4.197789484845,0.207205765608763,0.299378130100916,1.132527777,0.559295525361584,0.00159995725822526,0.00104551037575852,0.000366989255188731,7e-05,3331.1362217368,3218.54691509561,288.910334204432,3535,13.43,13.43197953 8 | -------------------------------------------------------------------------------- /ShipEF/R/calcTier.r: -------------------------------------------------------------------------------- 1 | #' @title calcTier 2 | #' 3 | #' @description 4 | #' Estimate engine NOx tier from the vessel's keel-laid year for C3 vessels. 5 | 6 | #'@param engineType Engine type (vector of strings) (see 7 | #'\code{\link{calcEngineType}}). Valid values are: \itemize{ 8 | #'\item "SSD" 9 | #'\item "MSD" 10 | #'\item "MSD-ED" 11 | #'\item "GT" 12 | #'\item "GT-ED" 13 | #'\item "ST" 14 | #'\item "LNG" 15 | #'} 16 | #' @param keelLaidYear Keel-laid year (vector of ints). If not available, 17 | #' interpolate from build date 18 | #' @param shipCategory Ship category (vector of ints) (see 19 | #' \code{\link{calcShipCategory}}). Valid values are: 20 | #' \itemize{ 21 | #' \item 1 22 | #' \item 2 23 | #' \item 3 24 | #' } 25 | #' 26 | #' @details 27 | #' This function is designed to determine the engine NOx tier for C3 vessels. 28 | #' Therefore, it will return "None" for C1 or C2 vessels. 29 | #' 30 | #' "Tier 0" is returned for steam turbine, gas turbine, and LNG engines, as well 31 | #' as for diesel engines that were keel-laid prior to Tier 1 taking effect 32 | #' (2000). 33 | #' 34 | #' "Tier 1", "Tier 2", and "Tier 3" refer to Tier I, Tier II, and Tier III, 35 | #' respectively. 36 | #' 37 | #' @return 38 | #' \code{tier}, a factorized vector with possible levels of: \itemize{ 39 | #' \item "None" (used for C1/C2 vessels) 40 | #' \item "Tier 0" 41 | #' \item "Tier 1" 42 | #' \item "Tier 2" 43 | #' \item "Tier 3" 44 | #' } 45 | # 46 | #' @references 47 | #'\href{https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=P1005ZGH.TXT}{EPA. 2009. 48 | #'"Regulatory impact analysis: Control of emissions air pollution from category 49 | #'3 marine diesel engines." Ann Arbor, MI: Office of Transportation and Air 50 | #'Quality. US Environmental Protection Agency. Pg 3-118:119} 51 | #' 52 | #'@seealso \itemize{ 53 | #' \item \code{\link{calcEngineType}} 54 | #' \item \code{\link{calcShipCategory}} 55 | #'} 56 | #' 57 | #' @examples 58 | #' calcTier(c("MSD","GT","LNG","SSD"),c(1985, 2011, 2001,2004),c(3,3,3,2)) 59 | #' 60 | #' @export 61 | 62 | 63 | calcTier<-function(engineType, keelLaidYear,shipCategory){ 64 | tier<- ifelse(shipCategory==3, 65 | ifelse(engineType%in%c("ST","GT","GT-ED","LNG") | keelLaidYear<2000, 66 | "Tier 0", 67 | ifelse(keelLaidYear<2011, 68 | "Tier 1", 69 | ifelse(keelLaidYear<2016, 70 | "Tier 2", 71 | "Tier 3"))) 72 | , 73 | "None" 74 | ) 75 | tier<-as.factor(tier) 76 | return(tier) 77 | } 78 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMBulbousBowRes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMBulbousBowRes.r 3 | \name{calcHMBulbousBowRes} 4 | \alias{calcHMBulbousBowRes} 5 | \title{calcHMBulbousBowRes} 6 | \usage{ 7 | calcHMBulbousBowRes( 8 | shipSpeed, 9 | maxDraft, 10 | forwardDraft, 11 | Abt, 12 | hb, 13 | seawaterDensity = 1.025 14 | ) 15 | } 16 | \arguments{ 17 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 18 | \code{\link{calcSpeedUnitConversion}})} 19 | 20 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 21 | 22 | \item{forwardDraft}{Forward draft (deviation from actual draft indicates trim) 23 | (vector of numericals, m)} 24 | 25 | \item{Abt}{Traverse bulb area (vector of numericals, m^2) (see 26 | \code{\link{calcAbt}})} 27 | 28 | \item{hb}{Center of bulb area above keel line (vector of numericals, m) 29 | (see \code{\link{calchb}})} 30 | 31 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 32 | supply either a vector of numericals, a single number, or rely on the default} 33 | } 34 | \value{ 35 | \code{Rb} (vector of numericals, kN) 36 | } 37 | \description{ 38 | Calculate bulbous bow resistance (\code{Rb}) (kN) from the 39 | Holtrop & Mennen method. 40 | } 41 | \examples{ 42 | calcHMBulbousBowRes(seq(1,5,1),13.57,13.57,25.09,5.43,seawaterDensity=1.025) 43 | 44 | } 45 | \references{ 46 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 47 | method." International Shipbuilding Progress 29. 48 | } 49 | \seealso{ 50 | \itemize{ 51 | \item \code{\link{calcSpeedUnitConversion}} 52 | \item \code{\link{calcAbt}} 53 | \item \code{\link{calchb}} 54 | } 55 | 56 | Other Holtrop-Mennen Calculations: 57 | \code{\link{calcHMAppendageRes}()}, 58 | \code{\link{calcHMCa}()}, 59 | \code{\link{calcHMFormFactor}()}, 60 | \code{\link{calcHMImmersedTransomRes}()}, 61 | \code{\link{calcHMPwr}()}, 62 | \code{\link{calcHMThrustFactor}()}, 63 | \code{\link{calcHMTotalRes}()}, 64 | \code{\link{calcHMWakeFraction}()}, 65 | \code{\link{calcHMWaveMakingRes}()}, 66 | \code{\link{calcHMWettedSA}()} 67 | 68 | Other Resistance Calculations: 69 | \code{\link{calcCf}()}, 70 | \code{\link{calcHMAppendageRes}()}, 71 | \code{\link{calcHMCa}()}, 72 | \code{\link{calcHMImmersedTransomRes}()}, 73 | \code{\link{calcHMTotalRes}()}, 74 | \code{\link{calcHMWaveMakingRes}()}, 75 | \code{\link{calcKristCaa}()}, 76 | \code{\link{calcKristCa}()}, 77 | \code{\link{calcKristCr}()}, 78 | \code{\link{calcKristTotalRes}()} 79 | } 80 | \concept{Holtrop-Mennen Calculations} 81 | \concept{Resistance Calculations} 82 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcKristCa.r: -------------------------------------------------------------------------------- 1 | #'@title calcKristCa 2 | #' 3 | #'@description Calculate incremental hull (roughness) resistance coefficient 4 | #'(\code{Ca}) (dimensionless) using the Kristensen method. 5 | #' 6 | #'@param shipType Ship type (vector of strings, see \code{\link{calcShipType}}). 7 | #'Must align with \code{tankerBulkCarrierGCargoShipTypes} and 8 | #' \code{containerShipTypes} groupings 9 | #'@param actualDisplacement Actual loaded displacement (vector of numericals, 10 | #' m^3) (see \code{\link{calcActualDisp}}) 11 | #'@param tankerBulkCarrierGCargoShipTypes Ship types specified in input 12 | #'\code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 13 | #'vessels (vector of strings) 14 | #'@param containerShipTypes Ship types specified in input \code{shipTypes} to be 15 | #'modeled as container ships (vector of strings) 16 | #' 17 | #'@details 18 | #'Models the effect of realistic hull roughness on resistance, which is not 19 | #'captured in the frictional and residual resistance coefficients from tank 20 | #'towing operations. 21 | #' 22 | #' This method this requires ship types to be grouped. Use the 23 | #' \code{tankerBulkCarrierGCargoShipTypes}, \code{containerShipTypes} grouping 24 | #' parameters to provide these ship type groupings. Any ship types not included 25 | #' in these groupings will be considered as miscellaneous 26 | #' 27 | #'@return \code{Ca} (vector of numericals, dimensionless) 28 | #' 29 | #'@references 30 | #'Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 31 | #'Power of Ships." 32 | #' 33 | #'\href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 34 | #'"Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 35 | #' 36 | #'@seealso \code{\link{calcActualDisp}} 37 | #' 38 | #'@family Kristensen Calculations 39 | #'@family Resistance Calculations 40 | #' 41 | #'@examples 42 | #'calcKristCa(c("bulk.carrier","container.ship"),c(73663.27,216726.45)) 43 | #' 44 | #'@export 45 | 46 | 47 | calcKristCa<-function(shipType,actualDisplacement, 48 | tankerBulkCarrierGCargoShipTypes=c("tanker","general.cargo","chemical.tanker","liquified.gas.tanker","oil.tanker","other.tanker","bulk.carrier"), 49 | containerShipTypes=c("container.ship")){ 50 | 51 | Ca<- ifelse(shipType%in%containerShipTypes, 52 | (0.5*log10(actualDisplacement)-0.1*(log10(actualDisplacement))^2)/1000, 53 | ifelse(shipType%in%tankerBulkCarrierGCargoShipTypes, 54 | (pmax(-0.1, 0.5*log10(actualDisplacement)-0.1*(log10(actualDisplacement))^2))/1000, 55 | NA 56 | ) 57 | ) 58 | return(Ca) 59 | } 60 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMCa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMCa.r 3 | \name{calcHMCa} 4 | \alias{calcHMCa} 5 | \title{calcHMCa} 6 | \usage{ 7 | calcHMCa(maxDraft, lwl, Cbw, breadth, forwardDraft, Abt, hb) 8 | } 9 | \arguments{ 10 | \item{maxDraft}{Maximum summer load line draft (vector of numericals, m)} 11 | 12 | \item{lwl}{Waterline length (vector of numericals, m) (see \code{\link{calclwl}})} 13 | 14 | \item{Cbw}{Waterline block coefficient (vector of numericals, dimensionless) 15 | (see \code{\link{calcCbw}})} 16 | 17 | \item{breadth}{Moulded breadth (vector of numericals, m)} 18 | 19 | \item{forwardDraft}{Forward draft (deviation from actual draft indicates trim) 20 | (vector of numericals, m)} 21 | 22 | \item{Abt}{Traverse bulb area (vector of numericals, m^2) (see 23 | \code{\link{calcAbt}})} 24 | 25 | \item{hb}{Center of bulb area above keel line (vector of numericals, m) (see 26 | \code{\link{calchb}})} 27 | } 28 | \value{ 29 | \code{Ca} (vector of numericals, dimensionless) 30 | } 31 | \description{ 32 | Calculate incremental hull (roughness) resistance coefficient 33 | (\code{Ca}) (dimensionless), which describes the effect of hull roughness and 34 | still-air resistance, using the Holtrop & Mennen method. 35 | } 36 | \examples{ 37 | calcHMCa(c(13.57,11.49),c(218.7500,209.2518),c(0.81,0.65),c(32.25,32.20),c(13.57,11.49), 38 | c(25.09,55.86),c(5.43,4.6)) 39 | 40 | calcHMCa(13.57,218.7500,0.81,32.25,13.57,25.0880,5.428) 41 | 42 | } 43 | \references{ 44 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 45 | method." International Shipbuilding Progress 29. 46 | } 47 | \seealso{ 48 | \itemize{ 49 | \item \code{\link{calclwl}} 50 | \item \code{\link{calcCbw}} 51 | \item \code{\link{calcAbt}} 52 | \item \code{\link{calchb}} 53 | } 54 | 55 | Other Holtrop-Mennen Calculations: 56 | \code{\link{calcHMAppendageRes}()}, 57 | \code{\link{calcHMBulbousBowRes}()}, 58 | \code{\link{calcHMFormFactor}()}, 59 | \code{\link{calcHMImmersedTransomRes}()}, 60 | \code{\link{calcHMPwr}()}, 61 | \code{\link{calcHMThrustFactor}()}, 62 | \code{\link{calcHMTotalRes}()}, 63 | \code{\link{calcHMWakeFraction}()}, 64 | \code{\link{calcHMWaveMakingRes}()}, 65 | \code{\link{calcHMWettedSA}()} 66 | 67 | Other Resistance Calculations: 68 | \code{\link{calcCf}()}, 69 | \code{\link{calcHMAppendageRes}()}, 70 | \code{\link{calcHMBulbousBowRes}()}, 71 | \code{\link{calcHMImmersedTransomRes}()}, 72 | \code{\link{calcHMTotalRes}()}, 73 | \code{\link{calcHMWaveMakingRes}()}, 74 | \code{\link{calcKristCaa}()}, 75 | \code{\link{calcKristCa}()}, 76 | \code{\link{calcKristCr}()}, 77 | \code{\link{calcKristTotalRes}()} 78 | } 79 | \concept{Holtrop-Mennen Calculations} 80 | \concept{Resistance Calculations} 81 | -------------------------------------------------------------------------------- /ShipEF/man/calcEngineType.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcEngineType.r 3 | \name{calcEngineType} 4 | \alias{calcEngineType} 5 | \title{calcEngineType} 6 | \usage{ 7 | calcEngineType( 8 | propulsionType, 9 | mainEngineStrokeType = NULL, 10 | mainEngineRPM = NULL, 11 | MSD_SSD_RPM_CutOff = 500, 12 | main_aux_boiler = "main" 13 | ) 14 | } 15 | \arguments{ 16 | \item{propulsionType}{Descriptor of engine propulsion type (from IHS) (vector 17 | of strings)} 18 | 19 | \item{mainEngineStrokeType}{Engine stroke type (vector of ints). Valid values 20 | are: \itemize{ 21 | \item 4 22 | \item 2 23 | \item \code{NA} 24 | }} 25 | 26 | \item{mainEngineRPM}{Engine revolutions per minute (vector of numericals)} 27 | 28 | \item{MSD_SSD_RPM_CutOff}{Cutoff rpm value between medium and slow speed 29 | diesel engines. Default = 500 rpm.} 30 | 31 | \item{main_aux_boiler}{Is this calculation for a propulsive (main), auxiliary 32 | (aux), or boiler engine? Options: \itemize{ 33 | \item "main" (Default) 34 | \item "aux" 35 | \item "boiler" 36 | }} 37 | } 38 | \value{ 39 | \code{engineType} (vector of strings). Valid values are: \itemize{ 40 | \item "SSD" = Slow-speed diesel 41 | \item "MSD" = Medium-speed diesel 42 | \item "GT" = Gas turbine 43 | \item "ST" = Steam turbine 44 | \item "MSD-ED" = Electric drive MSD 45 | \item "GT-ED" = Electric drive GT 46 | \item "LNG" = Liquified natural gas 47 | \item "HSD" = High-speed diesel (auxiliary engines only) 48 | \item "Boiler" = Boiler engine (boilers only) 49 | } 50 | } 51 | \description{ 52 | Assigns a standardized engine type descriptor using engine stroke and engine 53 | rpm data. 54 | } 55 | \details{ 56 | For more information about assigning engine speed, see Section 3.3.2.2 of the 57 | Port Emissions Inventory Guidance. 58 | } 59 | \examples{ 60 | calcEngineType(propulsionType=c("Oil Engine(s), Geared Drive", 61 | "Oil Engine(s), Geared Drive", 62 | "Sail, Aux Oil Eng(s), Geared"), 63 | mainEngineStrokeType = c(2,4,4), 64 | mainEngineRPM = c(NA,1515,1800)) 65 | 66 | calcEngineType(propulsionType=c("Oil Engine(s), Geared Drive", 67 | "Oil Engine(s), Geared Drive", 68 | "Sail, Aux Oil Eng(s), Geared"), 69 | mainEngineStrokeType = c(2,4,4), 70 | mainEngineRPM = c(NA,1515,1800), 71 | main_aux_boiler = "aux") 72 | 73 | } 74 | \references{ 75 | \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 76 | "Ports Emissions Inventory Guidance: Methodologies for Estimating 77 | Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 78 | Office of Transportation and Air Quality. US Environmental Protection Agency.} 79 | } 80 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMAppendageRes.r: -------------------------------------------------------------------------------- 1 | #'@title calcHMAppendageRes 2 | #' 3 | #'@description Calculate appendage resistance (\code{Rapp}) (kN) from the 4 | #'Holtrop & Mennen method. 5 | #' 6 | #'@param shipSpeed Ship actual speed (vector of numericals, m/s) (see 7 | #' \code{\link{calcSpeedUnitConversion}}) 8 | #'@param Cf Frictional resistance coefficient (vector of numericals, 9 | #' dimensionless) (see \code{\link{calcCf}}) 10 | #'@param appendagesList List of appendages on ship (vector of strings) \itemize{ 11 | #'\item"rudder behind skeg" 12 | #'\item"rudder behind stern" 13 | #'\item"twin-screw balance rudders" 14 | #'\item"shaft brackets" 15 | #'\item"skeg" 16 | #'\item"strut bossings" 17 | #'\item"hull bossings" 18 | #'\item"shafts" 19 | #'\item"stabilizer fins" 20 | #'\item"dome" 21 | #'\item"bilge keels" 22 | #'} 23 | #'@param wettedAppSAList List of wetted surface areas corresponding to list of appendages 24 | #' (vector of numericals, m^2) 25 | #'@param seawaterDensity Sea water density. Default = 1.025 (g/cm^3). Can 26 | #' supply either a vector of numericals corresponding to the ship speed, provide a single 27 | #' number, or rely on the default 28 | #' 29 | #'@return \code{Rapp} (vector of numericals, kN) 30 | #' 31 | #'@references 32 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 33 | #'method." International Shipbuilding Progress 29. 34 | #' 35 | #'@seealso \itemize{ 36 | #'\item \code{\link{calcSpeedUnitConversion}} 37 | #'\item \code{\link{calcCf}} } 38 | #' 39 | #'@family Holtrop-Mennen Calculations 40 | #'@family Resistance Calculations 41 | #' 42 | #'@examples calcHMAppendageRes(seq(1,5,1),0.0015,"rudder behind skeg",50,seawaterDensity=1.025) 43 | #' calcHMAppendageRes(seq(1,5,1),0.0015,NA,0,seawaterDensity=1.025) 44 | #' 45 | #'@export 46 | 47 | calcHMAppendageRes<- function(shipSpeed,Cf, 48 | appendagesList,wettedAppSAList,seawaterDensity=1.025){ 49 | 50 | 51 | AppResFactor <- data.frame(appendage=c("rudder behind skeg","rudder behind stern", 52 | "twin-screw balance rudders","shaft brackets","skeg","strut bossings","hull bossings", 53 | "shafts","stabilizer fins","dome","bilge keels"), 54 | resistance.factor=c(1.5,1.4,2.8,3,1.75,3,2,3,2.8,2.7,1.4)) 55 | 56 | wettedAppSAList[is.na(wettedAppSAList)==TRUE]<-0 57 | appendagesList<- tolower(appendagesList) 58 | 59 | FormFactorEqu=0 60 | 61 | for(i in 1:length(appendagesList)){ 62 | if(length(AppResFactor$resistance.factor[AppResFactor$appendage==paste(appendagesList[i])]* 63 | wettedAppSAList[i])>0){ 64 | j<- AppResFactor$resistance.factor[grepl(appendagesList[i],AppResFactor$appendage)==TRUE]* 65 | wettedAppSAList[i]}else{j<-0} 66 | FormFactorEqu=FormFactorEqu+j 67 | } 68 | 69 | FormFactorEqu<-FormFactorEqu/sum(wettedAppSAList) 70 | FormFactorEqu[is.na(FormFactorEqu)]<-0 71 | Rapp<-0.5*seawaterDensity*(shipSpeed^2)*wettedAppSAList*FormFactorEqu*Cf 72 | 73 | return(Rapp) 74 | } 75 | 76 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcHMAppendageRes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcHMAppendageRes.r 3 | \name{calcHMAppendageRes} 4 | \alias{calcHMAppendageRes} 5 | \title{calcHMAppendageRes} 6 | \usage{ 7 | calcHMAppendageRes( 8 | shipSpeed, 9 | Cf, 10 | appendagesList, 11 | wettedAppSAList, 12 | seawaterDensity = 1.025 13 | ) 14 | } 15 | \arguments{ 16 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 17 | \code{\link{calcSpeedUnitConversion}})} 18 | 19 | \item{Cf}{Frictional resistance coefficient (vector of numericals, 20 | dimensionless) (see \code{\link{calcCf}})} 21 | 22 | \item{appendagesList}{List of appendages on ship (vector of strings) \itemize{ 23 | \item"rudder behind skeg" 24 | \item"rudder behind stern" 25 | \item"twin-screw balance rudders" 26 | \item"shaft brackets" 27 | \item"skeg" 28 | \item"strut bossings" 29 | \item"hull bossings" 30 | \item"shafts" 31 | \item"stabilizer fins" 32 | \item"dome" 33 | \item"bilge keels" 34 | }} 35 | 36 | \item{wettedAppSAList}{List of wetted surface areas corresponding to list of appendages 37 | (vector of numericals, m^2)} 38 | 39 | \item{seawaterDensity}{Sea water density. Default = 1.025 (g/cm^3). Can 40 | supply either a vector of numericals corresponding to the ship speed, provide a single 41 | number, or rely on the default} 42 | } 43 | \value{ 44 | \code{Rapp} (vector of numericals, kN) 45 | } 46 | \description{ 47 | Calculate appendage resistance (\code{Rapp}) (kN) from the 48 | Holtrop & Mennen method. 49 | } 50 | \examples{ 51 | calcHMAppendageRes(seq(1,5,1),0.0015,"rudder behind skeg",50,seawaterDensity=1.025) 52 | calcHMAppendageRes(seq(1,5,1),0.0015,NA,0,seawaterDensity=1.025) 53 | 54 | } 55 | \references{ 56 | Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 57 | method." International Shipbuilding Progress 29. 58 | } 59 | \seealso{ 60 | \itemize{ 61 | \item \code{\link{calcSpeedUnitConversion}} 62 | \item \code{\link{calcCf}} } 63 | 64 | Other Holtrop-Mennen Calculations: 65 | \code{\link{calcHMBulbousBowRes}()}, 66 | \code{\link{calcHMCa}()}, 67 | \code{\link{calcHMFormFactor}()}, 68 | \code{\link{calcHMImmersedTransomRes}()}, 69 | \code{\link{calcHMPwr}()}, 70 | \code{\link{calcHMThrustFactor}()}, 71 | \code{\link{calcHMTotalRes}()}, 72 | \code{\link{calcHMWakeFraction}()}, 73 | \code{\link{calcHMWaveMakingRes}()}, 74 | \code{\link{calcHMWettedSA}()} 75 | 76 | Other Resistance Calculations: 77 | \code{\link{calcCf}()}, 78 | \code{\link{calcHMBulbousBowRes}()}, 79 | \code{\link{calcHMCa}()}, 80 | \code{\link{calcHMImmersedTransomRes}()}, 81 | \code{\link{calcHMTotalRes}()}, 82 | \code{\link{calcHMWaveMakingRes}()}, 83 | \code{\link{calcKristCaa}()}, 84 | \code{\link{calcKristCa}()}, 85 | \code{\link{calcKristCr}()}, 86 | \code{\link{calcKristTotalRes}()} 87 | } 88 | \concept{Holtrop-Mennen Calculations} 89 | \concept{Resistance Calculations} 90 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcCp.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcCp.r 3 | \name{calcCp} 4 | \alias{calcCp} 5 | \title{calcCp} 6 | \usage{ 7 | calcCp( 8 | Cm, 9 | Cbw, 10 | shipType, 11 | bounds = "none", 12 | roroPaxContainerShipTypes = c("ro.ro", "passenger", "ferry.pax", "ferry.ro.pax", 13 | "cruise", "cruise.ed", "yacht", "container.ship"), 14 | gCargoShipTypes = c("general.cargo"), 15 | tankerBulkCarrierShipTypes = c("tanker", "chemical.tanker", "liquified.gas.tanker", 16 | "oil.tanker", "other.tanker", "bulk.carrier") 17 | ) 18 | } 19 | \arguments{ 20 | \item{Cm}{Midship section coefficient (vector of numericals, dimensionless) 21 | (see \code{\link{calcCm}})} 22 | 23 | \item{Cbw}{Waterline block coefficient (vector of numericals, dimensionless) 24 | (see \code{\link{calcCbw}})} 25 | 26 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}}). 27 | Must align with \code{roroPaxContainerShipTypes}, 28 | \code{gCargoShipTypes}, and \code{tankerBulkCarrierShipTypes} groupings} 29 | 30 | \item{bounds}{Indicates which upper and lower bounds on \code{Cp} should be 31 | applied:\itemize{ 32 | \item Pass "holtrop mennen" to use the bounds specified by Holtrop & Mennen 33 | \item Pass "none" (default) to calculate \code{Cp} without upper or lower 34 | bounds} 35 | This argument is not vectorized. Either supply a single string or rely on the 36 | default} 37 | 38 | \item{roroPaxContainerShipTypes}{Ship types specified in input \code{shipTypes} 39 | to be modeled as RORO, passenger and container ships (vector of strings)} 40 | 41 | \item{gCargoShipTypes}{Ship types specified in input \code{shipTypes} to be 42 | modeled as general cargo (vector of strings)} 43 | 44 | \item{tankerBulkCarrierShipTypes}{Ship types specified in input 45 | \code{shipTypes} to be modeled as tankers and bulk carriers (vector of strings)} 46 | } 47 | \value{ 48 | \code{Cp} (vector of numericals, dimensionless) 49 | } 50 | \description{ 51 | Calculates the prismatic coefficient (\code{Cp}) (dimensionless). 52 | } 53 | \details{ 54 | \deqn{Cp = \frac{Cbw}{Cm}}{Cp=Cbw/Cm} 55 | 56 | This function can calculate \code{Cp} with or without upper and lower bounds. 57 | If the Holtrop & Mennen bounds are applied, this requires ship types to be 58 | grouped. Use the \code{roroPaxContainerShipTypes}, \code{gCargoShipTypes}, 59 | and \code{tankerBulkCarrierShipTypes} parameters to provide these ship 60 | type groupings. Any ship types not included in these groupings will be 61 | considered as miscellaneous vessels. 62 | } 63 | \examples{ 64 | calcCp(c(0.99,0.98), c(.8,.75),c("bulk.carrier","container.ship"),"none") 65 | 66 | } 67 | \references{ 68 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 69 | Solutions. 2011. "Basic Principles of Propulsion."} 70 | } 71 | \seealso{ 72 | \itemize{ 73 | \item \code{\link{calcCm}} 74 | \item \code{\link{calcCbw}} 75 | \item \code{\link{calcShipType}} 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcOperatingMode.r: -------------------------------------------------------------------------------- 1 | #'@title calcOperatingMode 2 | #' 3 | #' @description 4 | #' Assigns an operating mode designation according to ship speed and engine load 5 | #' fraction. 6 | #' 7 | #' @param shipSpeed Vessel speed (vector of numericals, knots) 8 | #' @param loadFactor Fractional percentage (between 0 and 1) of main engine 9 | #' required to propel vessel at given speed (vector of numericals) (see 10 | #' ShipPowerModel library) 11 | #' @param berthArea Vector of named berth areas (NA if not at berth) or vector 12 | #' of booleans (TRUE if at berth, FALSE if not) 13 | #' @param anchorageArea Vector of named anchorage areas (NA if not at anchorage) 14 | #' or vector of booleans (TRUE if at berth, FALSE if not) 15 | #' 16 | #' @details 17 | #' Calculated as a simplification of the methods described in Section 3.8.5 of 18 | #' the Port Emissions Inventory Guidance. 19 | #' 20 | #' @return \code{opMode} (vector of strings). Valid values are: \itemize{ 21 | #' \item "Berth" 22 | #' \item "Anchorage" 23 | #' \item "Maneuvering" 24 | #' \item "Transit" 25 | #' } 26 | #' 27 | #' @references 28 | #' \href{https://nepis.epa.gov/Exe/ZyPDF.cgi?Dockey=P10102U0.pdf}{EPA. 2020. 29 | #' "Port Emissions Inventory Guidance: Methodologies for Estimating 30 | #' Port-Related and Goods Movement Mobile Source Emissions." Ann Arbor, MI: 31 | #' Office of Transportation and Air Quality. US Environmental Protection Agency.} 32 | #' 33 | #'@seealso 34 | #'ShipPowerModel library 35 | #' 36 | #' @examples 37 | #' calcOperatingMode(shipSpeed = c(0, 2.5, 14, 20), 38 | #' loadFactor = c(0.01, 0.0, 0.15, 0.75), 39 | #' berthArea = c(TRUE, FALSE, FALSE, FALSE), 40 | #' anchorageArea = c(FALSE, TRUE, FALSE, FALSE) 41 | #' ) 42 | #' 43 | #' @export 44 | 45 | calcOperatingMode <- function(shipSpeed,loadFactor,berthArea,anchorageArea){ 46 | opMode <- ifelse(!is.na(anchorageArea) & anchorageArea != FALSE & shipSpeed <= 3, "Anchorage", 47 | # not in anchorage area and moving slowly 48 | ifelse(!is.na(berthArea) & berthArea != FALSE & shipSpeed <= 1, "Berth", 49 | # not in berth area and moving slowly 50 | ifelse(shipSpeed > 1 & loadFactor <= 0.20, "Maneuvering", 51 | # not maneuvering 52 | # assume anything with a load factor >20% is in transit 53 | ifelse(loadFactor > 0.20, "Transit", 54 | # not in transit 55 | # vessel is going <= 1 knots with a load factor <= 0.20; assume anchorage 56 | "Anchorage" 57 | ) # end ifelse for transit 58 | ) # end ifelse for maneuvering 59 | ) # end ifelse for Berth 60 | ) # end ifelse for Anchorage 61 | 62 | return(opMode) 63 | } 64 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcKristCa.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcKristCa.r 3 | \name{calcKristCa} 4 | \alias{calcKristCa} 5 | \title{calcKristCa} 6 | \usage{ 7 | calcKristCa( 8 | shipType, 9 | actualDisplacement, 10 | tankerBulkCarrierGCargoShipTypes = c("tanker", "general.cargo", "chemical.tanker", 11 | "liquified.gas.tanker", "oil.tanker", "other.tanker", "bulk.carrier"), 12 | containerShipTypes = c("container.ship") 13 | ) 14 | } 15 | \arguments{ 16 | \item{shipType}{Ship type (vector of strings, see \code{\link{calcShipType}}). 17 | Must align with \code{tankerBulkCarrierGCargoShipTypes} and 18 | \code{containerShipTypes} groupings} 19 | 20 | \item{actualDisplacement}{Actual loaded displacement (vector of numericals, 21 | m^3) (see \code{\link{calcActualDisp}})} 22 | 23 | \item{tankerBulkCarrierGCargoShipTypes}{Ship types specified in input 24 | \code{shipTypes} to be modeled as tankers, bulk carriers and general cargo 25 | vessels (vector of strings)} 26 | 27 | \item{containerShipTypes}{Ship types specified in input \code{shipTypes} to be 28 | modeled as container ships (vector of strings)} 29 | } 30 | \value{ 31 | \code{Ca} (vector of numericals, dimensionless) 32 | } 33 | \description{ 34 | Calculate incremental hull (roughness) resistance coefficient 35 | (\code{Ca}) (dimensionless) using the Kristensen method. 36 | } 37 | \details{ 38 | Models the effect of realistic hull roughness on resistance, which is not 39 | captured in the frictional and residual resistance coefficients from tank 40 | towing operations. 41 | 42 | This method this requires ship types to be grouped. Use the 43 | \code{tankerBulkCarrierGCargoShipTypes}, \code{containerShipTypes} grouping 44 | parameters to provide these ship type groupings. Any ship types not included 45 | in these groupings will be considered as miscellaneous 46 | } 47 | \examples{ 48 | calcKristCa(c("bulk.carrier","container.ship"),c(73663.27,216726.45)) 49 | 50 | } 51 | \references{ 52 | Kristensen, H. O. and Lutzen, M. 2013. "Prediction of Resistance and Propulsion 53 | Power of Ships." 54 | 55 | \href{https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo}{Kristensen, H. O. 56 | "Ship-Desmo-Tool." https://gitlab.gbar.dtu.dk/oceanwave3d/Ship-Desmo} 57 | } 58 | \seealso{ 59 | \code{\link{calcActualDisp}} 60 | 61 | Other Kristensen Calculations: 62 | \code{\link{calcKristCaa}()}, 63 | \code{\link{calcKristCr}()}, 64 | \code{\link{calcKristPwr}()}, 65 | \code{\link{calcKristThrustFactor}()}, 66 | \code{\link{calcKristTotalRes}()}, 67 | \code{\link{calcKristWakeFrac}()}, 68 | \code{\link{calcKristWettedSA}()} 69 | 70 | Other Resistance Calculations: 71 | \code{\link{calcCf}()}, 72 | \code{\link{calcHMAppendageRes}()}, 73 | \code{\link{calcHMBulbousBowRes}()}, 74 | \code{\link{calcHMCa}()}, 75 | \code{\link{calcHMImmersedTransomRes}()}, 76 | \code{\link{calcHMTotalRes}()}, 77 | \code{\link{calcHMWaveMakingRes}()}, 78 | \code{\link{calcKristCaa}()}, 79 | \code{\link{calcKristCr}()}, 80 | \code{\link{calcKristTotalRes}()} 81 | } 82 | \concept{Kristensen Calculations} 83 | \concept{Resistance Calculations} 84 | -------------------------------------------------------------------------------- /ShipPowerModel/man/calcPropPwr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/calcPropPwr.r 3 | \name{calcPropPwr} 4 | \alias{calcPropPwr} 5 | \title{calcPropPwr} 6 | \usage{ 7 | calcPropPwr( 8 | totalInstalledPwr, 9 | shipSpeed, 10 | refSpeed, 11 | serviceMargin = 15, 12 | n = 3, 13 | refSpeedType = "serviceSpeed" 14 | ) 15 | } 16 | \arguments{ 17 | \item{totalInstalledPwr}{Total installed main engine power (vector of 18 | numericals, kW) (maximum 19 | continuous rated power)} 20 | 21 | \item{shipSpeed}{Ship actual speed (vector of numericals, m/s) (see 22 | \code{\link{calcSpeedUnitConversion}})} 23 | 24 | \item{refSpeed}{Reference speed of the ship (service speed or maximum speed) 25 | (vector of numericals, m/s)} 26 | 27 | \item{serviceMargin}{A service margin to account for weather and sea effects: 28 | \itemize{\item At-sea operations = 15 (Default) \item Coastal operations = 10} 29 | Can supply either a vector of numericals, a single number, or rely on the default} 30 | 31 | \item{n}{Exponential relationship applied to the ship speed ratio (dimensionless). 32 | Default = 3. This argument is not vectorized, so supply a single number or rely 33 | on the default} 34 | 35 | \item{refSpeedType}{Indicates if the reference speed is service speed or 36 | maximum speed: \itemize{ 37 | \item "serviceSpeed (Default)" 38 | \item "maxSpeed"} 39 | Can supply either a vector of strings, a single value, or rely on the default.} 40 | } 41 | \value{ 42 | power (vector of numericals, kW) 43 | } 44 | \description{ 45 | Calculates ship power (kW) using the propeller law. 46 | } 47 | \details{ 48 | Ship speed and actual draft are typically obtained from sources such as AIS 49 | messages or ship records. 50 | 51 | serviceMargin = 10 or 15, based on IMO (Prpic Orsic and Faltinsen, 2012). 52 | 15 indicates 15\% increased resistance in at-sea water conditions, and 10 53 | indicates 10\% increased resistance in coastal water conditions. 54 | 55 | Note that service margin is treated as an added resistance here 56 | (instead of as a reduced efficiency) to maintain consistency with the other 57 | power models used in this library. (See MAN, 2011). 58 | } 59 | \examples{ 60 | calcPropPwr(totalInstalledPwr = 9363, 61 | shipSpeed = seq(10,14,1), 62 | refSpeed = 15, 63 | serviceMargin = 15, 64 | n = 3) 65 | 66 | } 67 | \references{ 68 | \href{https://nepis.epa.gov/Exe/ZyPURL.cgi?Dockey=P1005ZGH.TXT}{EPA. 2009. 69 | "Regulatory impact analysis: Control of emissions air pollution from category 70 | 3 marine diesel engines." Ann Arbor, MI: Office of Transportation and Air 71 | Quality. US Environmental Protection Agency.} 72 | 73 | \href{https://www.man-es.com/marine/products/propeller-aft-ship}{MAN Energy 74 | Solutions. 2011. "Basic Principles of Propulsion."} 75 | } 76 | \seealso{ 77 | \itemize{ 78 | \item \code{\link{calcSpeedUnitConversion}} 79 | \item \code{\link{calcAdmPwr}} 80 | \item \code{vignette("OverviewOfPowerModels", package="ShipPowerModel")} 81 | \item \code{vignette("Propeller.Law.Example", package="ShipPowerModel")} 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /ShipPowerModel/R/calcHMTotalRes.r: -------------------------------------------------------------------------------- 1 | #'@title calcHMTotalRes 2 | #' 3 | #' @description Calculate total ship resistance (\code{Rtot}) (kN) using the 4 | #' Holtrop & Mennen method. 5 | #' 6 | #' @param Rapp Appendage resistance (vector of numericals, kN) (see 7 | #' \code{\link{calcHMAppendageRes}}) 8 | #' @param Rw Wave waking (similar to residual) resistance (vector of numericals, kN) 9 | #' (see \code{\link{calcHMWaveMakingRes}}) 10 | #' @param Rb Bulbous bow resistance (vector of numericals, kN) (see 11 | #' \code{\link{calcHMBulbousBowRes}}) 12 | #' @param Rtr Immersed transom resistance (vector of numericals, kN) (see 13 | #' \code{\link{calcHMImmersedTransomRes}}) 14 | #' @param seawaterDensity Sea water density. Default = 1.025 (g/cm^2). Can 15 | #' supply either a vector of numericals, a single number, or rely on the default 16 | #' @param wettedSA Wetted hull surface area (vector of numericals, m^2) (see 17 | #' \code{\link{calcHMWettedSA}}) 18 | #' @param shipSpeed Ship actual speed (vector of numericals, m/s) (see 19 | #' \code{\link{calcSpeedUnitConversion}}) 20 | #' @param Cf Frictional resistance coefficient (vector of numericals, dimensionless) 21 | #' (see \code{\link{calcCf}}) 22 | #' @param formFactor Form factor (1+k) (vector of numericals, dimensionless) 23 | #' (see \code{\link{calcHMFormFactor}}) 24 | #' @param Ca Incremental hull (roughness) resistance coefficient (vector of 25 | #' numericals, dimensionless) (see \code{\link{calcHMCa}}) 26 | #' @param serviceMargin A service margin to account for weather and sea effects: 27 | #' \itemize{\item Coastal operations = 10 \item At-sea operations = 15 (default)}. 28 | #' Can supply either a vector of numericals, a single number, or rely on the default 29 | #' 30 | #' @details 31 | #' Note that service margin is included here as a resistance term. 32 | #' 33 | #' @return \code{Rtot} (vector of numericals, kN) 34 | #' 35 | #' @references 36 | #'Holtrop, J. and Mennen, G. G. J. 1982. "An approximate power prediction 37 | #'method." International Shipbuilding Progress 29. 38 | #' 39 | #' @seealso \code{\link{calcSpeedUnitConversion}} 40 | #' 41 | #' @family Holtrop-Mennen Calculations 42 | #' @family Resistance Calculations 43 | #' 44 | #' @examples 45 | #' calcHMTotalRes(Rapp=0.24, 46 | #' Rw=2.6, 47 | #' Rb=c(4.538188e-07,3.579217e-06,1.180116e-05,2.709520e-05,5.085940e-05), 48 | #' Rtr=c(0.58,2.2,4.8,8.1,12.1), 49 | #' seawaterDensity=1.025, 50 | #' wettedSA=10746.282, 51 | #' shipSpeed=seq(1,5,1), 52 | #' Cf=c(0.0019,0.0017,0.0016,0.0016,0.0015), 53 | #' formFactor=1.275601, 54 | #' Ca=0.0003356088, 55 | #' serviceMargin=15) 56 | #' 57 | #' @export 58 | 59 | calcHMTotalRes<- function(Rapp,Rw,Rb,Rtr,seawaterDensity,wettedSA,shipSpeed, 60 | Cf,formFactor,Ca,serviceMargin){ 61 | Rtot<- 62 | ( Rapp+Rw+Rb+Rtr+ 63 | (.5*seawaterDensity*wettedSA*((shipSpeed)^2)*Cf)*(formFactor)+ 64 | (.5*seawaterDensity*wettedSA*((shipSpeed)^2)*Ca))*(1+serviceMargin/100) 65 | return(Rtot) 66 | } 67 | 68 | --------------------------------------------------------------------------------