"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fontesEscopo1CombEsta = void 0; const resposta_1 = require("../../resposta"); const gwp_1 = require("../ListasFatoresEmissao/gwp"); const listaEmissoes_1 = require("../ListasFatoresEmissao/listaEmissoes"); const listaFatorAno_1 = require("../ListasFatoresEmissao/listaFatorAno"); const listas_1 = require("../ListasFatoresEmissao/listas"); const interfaces_1 = require("../interfaces"); exports.fontesEscopo1CombEsta = { escopo: "Escopo1", idTipoFonte: "combustaoEst", descricao: "Combustão Estacionária", estruturaCadastro: [ { idCampo: "setor", descricao: "Tipo de Emissão do setor", tipo: interfaces_1.tiposCamposGee.opcoes, opcoes: listas_1.listaFatoresEmissao, }, { idCampo: "tipo", descricao: "Tipo de combustível", tipo: interfaces_1.tiposCamposGee.opcoes, opcoes: listas_1.listaCombustiveis, }, ], estruturaRegistro: [ { campo: "consumo", descricao: "Consumo do combustível", tipo: interfaces_1.tiposCamposGee.numero, }, { campo: "unidade", descricao: "Unidade de medida consumida", tipo: interfaces_1.tiposCamposGee.opcoes, opcoes: ["kg", "m³", "TJ", "Litros", "Toneladas"], }, ], formula: ({ cad, reg, inventario }) => { const combustivel = listaEmissoes_1.listaEmissoes.find((a) => a.ref == cad.tipo); if (!combustivel) { return resposta_1.respostaCM.addErro("Não foi encontrado combustível"); } const setor = cad.setor; const QTDCombustivel = Number(reg.consumo); let [CH4, CO2, N2O, BIO, QTDCombustivelBio, QTDCombustivelFossil] = [ 0, 0, 0, 0, 0, 0, ]; if (combustivel.combustivel == "Óleo Diesel (comercial)") { QTDCombustivelFossil = QTDCombustivel * (1 - listaFatorAno_1.listaFatorAno[Number(inventario.anoInventario) - 2000].percBio); QTDCombustivelBio = QTDCombustivel * listaFatorAno_1.listaFatorAno[Number(inventario.anoInventario) - 2000].percBio; } else if (combustivel.combustivel == "Gasolina Automotiva (comercial)") { QTDCombustivelFossil = QTDCombustivel * (1 - listaFatorAno_1.listaFatorAno[Number(inventario.anoInventario) - 2000].percGasolina); QTDCombustivelBio = QTDCombustivel - QTDCombustivelFossil; } else if (combustivel.combustivel == "Lenha Comercial") { QTDCombustivelFossil = 0; QTDCombustivelBio = QTDCombustivel; } else if (combustivel.combustivel == "Lenha para Carvoejamento") { QTDCombustivelFossil = 0; QTDCombustivelBio = QTDCombustivel; } else if (combustivel.combustivel == "Carvão Vegetal") { QTDCombustivelFossil = 0; QTDCombustivelBio = QTDCombustivel; } else if (combustivel.combustivel == "Resíduos Vegetais") { QTDCombustivelFossil = 0; QTDCombustivelBio = QTDCombustivel; } else if (combustivel.combustivel == "Lenha para Queima Direta") { QTDCombustivelFossil = 0; QTDCombustivelBio = QTDCombustivel; } else if (combustivel.combustivel == "Gás Liquefeito de Petróleo (GLP)") { QTDCombustivelFossil = QTDCombustivel; QTDCombustivelBio = 0; } else { QTDCombustivelFossil = QTDCombustivel; QTDCombustivelBio = QTDCombustivel; } if (setor == interfaces_1.setorGee.comercial) { CH4 = combustivel.setor_CH4_comercial; CO2 = combustivel.fatores_emissao_CO2_kg_TJ; N2O = combustivel.setor_N2O_comercial; BIO = Number(combustivel.biogenics); } else if (setor == interfaces_1.setorGee.energia) { CH4 = combustivel.setor_CH4_energia; CO2 = combustivel.fatores_emissao_CO2_kg_TJ; N2O = combustivel.setor_N2O_energia; BIO = Number(combustivel.biogenics); } else if (setor == interfaces_1.setorGee.manufatura) { CH4 = combustivel.setor_CH4_manufatura; CO2 = combustivel.fatores_emissao_CO2_kg_TJ; N2O = combustivel.setor_N2O_manufatura; BIO = Number(combustivel.biogenics); } else if (setor == interfaces_1.setorGee.residencial) { CH4 = combustivel.setor_CH4_residencial; CO2 = combustivel.fatores_emissao_CO2_kg_TJ; N2O = combustivel.setor_N2O_residencial; BIO = Number(combustivel.biogenics); } else { return resposta_1.respostaCM.addErro("Não foi encontrado setor"); } let carbono = 0; if (combustivel.combustivel == "Lenha Comercial") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else if (combustivel.combustivel == "Lenha para Carvoejamento") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else if (combustivel.combustivel == "Carvão Vegetal") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else if (combustivel.combustivel == "Resíduos Vegetais") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else if (combustivel.combustivel == "Lenha para Queima Direta") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else if (combustivel.combustivel == "Bagaço de Cana") { carbono = QTDCombustivelBio * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelBio * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } else { carbono = QTDCombustivelFossil * (CO2 / 1000) * Number(gwp_1.gwp[0].gwp) + QTDCombustivelFossil * (CH4 / 1000) * Number(gwp_1.gwp[1].gwp) + QTDCombustivelFossil * (N2O / 1000) * Number(gwp_1.gwp[2].gwp); } const bio = QTDCombustivelBio * (BIO / 1000); console.log("carbono", carbono); console.log("bio", bio); console.log("QTDCombustivelFossil", QTDCombustivelFossil); console.log("QTDCombustivelBio", QTDCombustivelBio); console.log("CO2", CO2); console.log("CH4", CH4); console.log("N2O", N2O); console.log("BIO", BIO); console.log("QTDCombustivel", QTDCombustivel); return resposta_1.respostaCM.addResultado([carbono, bio]); }, }; //# sourceMappingURL=escopo1CombuEst.js.map