recordExternalDataImport

Record of the external data import logic to create InstanceRecords automatically

Information

1. Purpose of model

The purpose of this record is to load parameters of the superstructure from external data sources and write them into InstanceRecords for each technology.

The contents of this record is designed to be rewritten, depending on the format of the avaliable data.

2. Level of detail, physical effects considered, and physical insight

(no remarks)

3. Limits of validity

(no remarks)

4. Interfaces

Possible Outputs:

Instance Records:

  • electricalStorageInstancesRecordRegionInfo
  • gasStorageInstancesRecordRegionInfo
  • powerPlantInstancesRecordRegionInfo
  • localDemandInstancesRecordRegionInfo
  • cO2SystemInstancesRecordRegionInfo
  • powerToGasInstancesRecordRegionInfo
  • heatingGridInstancesRecordRegionInfo


Paths to tables:

  • localElectricDemand_pathToTable_info
  • localGasDemand_pathToTable_info
  • localSolarthermalProduction_pathToTable_info
  • localTemperature_pathToTable_info
  • localHeatDemand_pathToTable_info
  • localBiogasProduction_pathToTable_info
  • localWindOffshoreProduction_pathToTable_info
  • localBiomassProduction_pathToTable_info
  • localPhotovoltaicProduction_pathToTable_info
  • localWindOnshoreProduction_pathToTable_info


5. Nomenclature

(no remarks)

6. Governing Equations

(no remarks)

7. Remarks for Usage

(no remarks)

8. Validation

(no remarks)

9. References

(no remarks)

10. Version History

Model created by Jon Babst (babst@xrg-simulation.de) on 06.09.2021.

Parameters

TypeNameDefaultDescription
String[nRegions_info]file_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_data_path_info) + "Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".mat") for i in 1:nRegions_info}
Integer[2]dim_PowerPlants_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".PowerPlants")Dimensions of PowerPlants matrix
Integer[2]dim_CHPPlants_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".CHPPlants")Dimensions of CHPPlants matrix
Integer[2]dim_ElectricalStorages_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".ElectricalStorages")Dimensions of ElectricalStorages matrix
Integer[2]dim_PowerToGasPlants_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".PowerToGasPlants")Dimensions of PowerToGasPlants matrix
Integer[2]dim_ElectricHeater_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".ElectricHeater")Dimensions of ElectricHeater matrix
Integer[2]dim_GasStorages_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".GasStorages")Dimensions of GasStorage matrix
Integer[2]dim_GasBoiler_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".GasBoiler")Dimensions of GasBoiler matrix
Integer[2]dim_GeneralInformation_infoModelica.Utilities.Streams.readMatrixSize(file_info[1], "Region" + String(Region_info[1]) + ".GeneralInformation")Dimensions of GeneralInformation matrix
Real[nRegions_info,dim_PowerPlants_info[1],dim_PowerPlants_info[2]]InformationRegion_PowerPlants{if LoadInformationPowerPlants_info[i] == false then zeros(dim_PowerPlants_info[1], dim_PowerPlants_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".PowerPlants", dim_PowerPlants_info[1], dim_PowerPlants_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,:,:]InformationRegion_CHPPlants{if LoadInformationCHPPlants_info[i] == false then zeros(dim_CHPPlants_info[1], dim_CHPPlants_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".CHPPlants", dim_CHPPlants_info[1], dim_CHPPlants_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,dim_ElectricalStorages_info[1],dim_ElectricalStorages_info[2]]InformationRegion_ElectricalStorages{if LoadInformationElectricalStorages_info[i] == false then zeros(dim_ElectricalStorages_info[1], dim_ElectricalStorages_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".ElectricalStorages", dim_ElectricalStorages_info[1], dim_ElectricalStorages_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,dim_PowerToGasPlants_info[1],dim_PowerToGasPlants_info[2]]InformationRegion_PowerToGasPlants{if LoadInformationPowerToGasPlants_info[i] == false then zeros(dim_PowerToGasPlants_info[1], dim_PowerToGasPlants_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".PowerToGasPlants", dim_PowerToGasPlants_info[1], dim_PowerToGasPlants_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,dim_ElectricHeater_info[1],dim_ElectricHeater_info[2]]InformationRegion_ElectricHeater{if LoadInformationElectricalHeater_info[i] == false then zeros(dim_ElectricHeater_info[1], dim_ElectricHeater_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".ElectricHeater", dim_ElectricHeater_info[1], dim_ElectricHeater_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,dim_GasStorages_info[1],dim_GasStorages_info[2]]InformationRegion_GasStorages_raw{if LoadInformationGasStorage_info[i] == false then zeros(dim_GasStorages_info[1], dim_GasStorages_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".GasStorages", dim_GasStorages_info[1], dim_GasStorages_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,:,:]InformationRegion_GasStorages{if LoadInformationGasStorage_info[i] == false then InformationRegion_GasStorages_raw[i, :, :] else cat(2, InformationRegion_GasStorages_raw[i, :, 1:3], scaleFactorGasStorageCap_info*[InformationRegion_GasStorages_raw[i, :, 4]], scaleFactorGasStoragePower_info*InformationRegion_GasStorages_raw[i, :, 5:6], InformationRegion_GasStorages_raw[i, :, 7:9], scaleFactorGasStorageCap_info*[InformationRegion_GasStorages_raw[i, :, 10]], InformationRegion_GasStorages_raw[i, :, 11:dim_GasStorages_info[2]]) for i in 1:nRegions_info}
Real[nRegions_info,dim_GasBoiler_info[1],dim_GasBoiler_info[2]]InformationRegion_GasBoiler{if LoadInformationGasBoiler_info[i] == false then zeros(dim_GasBoiler_info[1], dim_GasBoiler_info[2]) else Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".GasBoiler", dim_GasBoiler_info[1], dim_GasBoiler_info[2]) for i in 1:nRegions_info}
Real[nRegions_info,dim_GeneralInformation_info[1],dim_GeneralInformation_info[2]]InformationRegion_GeneralInformation{Modelica.Utilities.Streams.readRealMatrix(file_info[i], "Region" + String(Region_info[i]) + ".GeneralInformation", dim_GeneralInformation_info[1], dim_GeneralInformation_info[2]) for i in 1:nRegions_info}
Integer[nRegions_info]DifferentTypesOfPowerPlants_info{if LoadInformationPowerPlants_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_PowerPlants[i, :, 2])) else 0 for i in 1:nRegions_info}Amount of different power plant types
Integer[nRegions_info]DifferentTypesOfElectricalStorages_info{if LoadInformationElectricalStorages_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_ElectricalStorages[i, :, 2])) else 0 for i in 1:nRegions_info} Amount of different electrical storage types
Integer[nRegions_info]DifferentTypesOfCHPPlants_info{if LoadInformationCHPPlants_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_CHPPlants[i, :, 2])) else 0 for i in 1:nRegions_info} Amount of different CHP plant types
Import of external data sources › Matlab-script created matrices
Integer[nRegions_info]Region_info1:nRegions_infoList of regions
IntegerSimulationCounter_info99Data set identifier
IntegernRegions_info4Number of regions in data set
RealscaleFactorGasStorageCap_info1Scale factor for gas storage capacities
RealscaleFactorGasStoragePower_info1Scale factor for gas storage max in/outflow
Stringinput_table_path_infoTransiEnt.SystemGeneration.Superstructure.Types.SUPERSTRUCTURE_TABLESEnvironment variable
Stringinput_data_path_infoTransiEnt.SystemGeneration.Superstructure.Types.SUPERSTRUCTURE_INPUTEnvironment variable
Import of external data sources › General
Boolean[nRegions_info]LoadInformationPowerPlants_infofill(true, nRegions_info)true, if power plants exist in region
Boolean[nRegions_info]LoadInformationElectricalStorages_infofill(true, nRegions_info)true, if electrical storages exist in region
Boolean[nRegions_info]LoadInformationPowerToGasPlants_infofill(true, nRegions_info)true, if power to gas plants exist in region
Boolean[nRegions_info]LoadInformationGasStorage_infofill(true, nRegions_info)true, if gas storages exist in region
Boolean[nRegions_info]LoadInformationCHPPlants_infofill(false, nRegions_info)true, if CHP plants exist in region
Boolean[nRegions_info]LoadInformationElectricalHeater_infofill(false, nRegions_info)true, if electrical heater exist in region
Boolean[nRegions_info]LoadInformationGasBoiler_infofill(false, nRegions_info)true, if gas boiler exist in region
DataTables-previous
Integer[nRegions_info]DifferentTypesOfPowerToGasPlants_info{if LoadInformationPowerToGasPlants_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_PowerToGasPlants[i, :, 2])) else 0 for i in 1:nRegions_info}Amount of different power to gas plant types
Integer[nRegions_info]DifferentTypesOfElectricHeater_info{if LoadInformationElectricalHeater_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_ElectricHeater[i, :, 2])) else 0 for i in 1:nRegions_info}Amount of different electrical heater types
Integer[nRegions_info]DifferentTypesOfGasBoiler_info{if LoadInformationGasBoiler_info[i] == true then TransiEnt.Basics.Functions.real2integer(max(InformationRegion_GasBoiler[i, :, 2])) else 0 for i in 1:nRegions_info}Amount of different gas boiler types
Import of external data sources › InstanceRecord Creation
Config_info.Records.InstancesRecords.ElectricalStorageInstancesRecord[nRegions_info]electricalStorageInstancesRecordRegionInfo{Config_info.Records.InstancesRecords.ElectricalStorageInstancesRecord(nElectricalStorages = DifferentTypesOfElectricalStorages_info[i], electricalStorageType = {Config_info.ElectricalStorageType(integer(max(InformationRegion_ElectricalStorages[i, j, 13], 1))) for j in 1:DifferentTypesOfElectricalStorages_info[i]}, electricalStorageRecord = {Config_info.Records.ElectricalStorageRecord(E_start = InformationRegion_ElectricalStorages[i, j, 10], E_max = InformationRegion_ElectricalStorages[i, j, 8], E_min = InformationRegion_ElectricalStorages[i, j, 9], P_max_unload = InformationRegion_ElectricalStorages[i, j, 5], P_max_load = InformationRegion_ElectricalStorages[i, j, 4], P_grad_max = InformationRegion_ElectricalStorages[i, j, 11], eta_unload = InformationRegion_ElectricalStorages[i, j, 7], eta_load = InformationRegion_ElectricalStorages[i, j, 6], selfDischargeRate = InformationRegion_ElectricalStorages[i, j, 12]) for j in 1:DifferentTypesOfElectricalStorages_info[i]}) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.GasStorageInstancesRecord[nRegions_info]gasStorageInstancesRecordRegionInfo{Config_info.Records.InstancesRecords.GasStorageInstancesRecord(gasStorageRecord = Config_info.Records.GasStorageRecord(Volume = InformationRegion_GasStorages[i, 1, 4], m_gas_start = InformationRegion_GasStorages[i, 1, 10], m_flow_nom = InformationRegion_GasStorages[i, 1, 5], Vgeo_per_mMax = InformationRegion_GasStorages[i, 1, 4], m_flow_inMax = InformationRegion_GasStorages[i, 1, 5], m_flow_outMax = InformationRegion_GasStorages[i, 1, 6], GasStrorageTypeNo = InformationRegion_GasStorages[i, 1, 11])) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.PowerPlantInstancesRecord[nRegions_info]powerPlantInstancesRecordRegionInfo{Config_info.Records.InstancesRecords.PowerPlantInstancesRecord(nPowerPlants = max(DifferentTypesOfPowerPlants_info[i], 1), powerPlantType = {Config_info.PowerPlantType(integer(InformationRegion_PowerPlants[i, j, 10])) for j in 1:DifferentTypesOfPowerPlants_info[i]}, powerPlantRecord = {Config_info.Records.PowerPlantRecord(P_el_n = InformationRegion_PowerPlants[i, j, 4], P_min_star = InformationRegion_PowerPlants[i, j, 6], P_grad_max_star = InformationRegion_PowerPlants[i, j, 7], t_startup = if dim_PowerPlants_info[2] >= 13 then InformationRegion_PowerPlants[i, j, 13] else 0, CO2_Deposition_Rate = InformationRegion_PowerPlants[i, j, 11], quantity = if InformationRegion_PowerPlants[i, j, 10] == 3 then 1 else integer(InformationRegion_PowerPlants[i, j, 4]/1000e6) + 1, eta_total = InformationRegion_PowerPlants[i, j, 5], P_init_set = InformationRegion_PowerPlants[i, j, 9] + 1e-3) for j in 1:DifferentTypesOfPowerPlants_info[i]}) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.LocalDemandInstancesRecord[nRegions_info]localDemandInstancesRecordRegionInfo{Config_info.Records.InstancesRecords.LocalDemandInstancesRecord(localDemandRecord = Config_info.Records.LocalDemandRecord(Fraction = {InformationRegion_GeneralInformation[i, 1, k] for k in 6:15}, Q_demand_annual = InformationRegion_GeneralInformation[i, 1, 16]*3500*3600, volume_junction = InformationRegion_GeneralInformation[i, 1, 21], HeatPumpAndSolarSole_COP_n = InformationRegion_GeneralInformation[i, 1, 22], HeatPumpSole_COP_n = InformationRegion_GeneralInformation[i, 1, 22], HeatPumpAndSolar_COP_n = InformationRegion_GeneralInformation[i, 1, 23], HeatPump_COP_n = InformationRegion_GeneralInformation[i, 1, 23], gasboiler_eta = InformationRegion_GeneralInformation[i, 1, 24], electricBoiler_eta = InformationRegion_GeneralInformation[i, 1, 25])) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.CO2SystemInstancesRecord[nRegions_info]cO2SystemInstancesRecordRegionInfo{Config_info.Records.InstancesRecords.CO2SystemInstancesRecord(cO2SystemRecord = Config_info.Records.CO2SystemRecord(DirectAirCapture_EnergyDemandThermal = if dim_PowerToGasPlants_info[2] >= 22 then InformationRegion_PowerToGasPlants[i, 1, 22] else 7.92e6, DirectAirCapture_EnergyDemandElectrical = if dim_PowerToGasPlants_info[2] >= 22 then InformationRegion_PowerToGasPlants[i, 1, 21] else 2.52e6, m_start_CO2_storage = InformationRegion_PowerToGasPlants[i, 1, 20])) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.PowerToGasInstancesRecord[nRegions_info]powerToGasInstancesRecordRegionInfo{if DifferentTypesOfPowerToGasPlants_info[i] > 0 then Config_info.Records.InstancesRecords.PowerToGasInstancesRecord(nPowerToGasPlants = DifferentTypesOfPowerToGasPlants_info[i], powerToGasType = Config_info.PowerToGasType(integer(max(InformationRegion_PowerToGasPlants[i, 1, 12], 1))), powerToGasRecord = Config_info.Records.PowerToGasRecord(WasteHeatUsage_V_storage = InformationRegion_PowerToGasPlants[i, 1, 4]*0.22923*48/(4.18*(105 - 20))/959, MethanationPlant_m_flow_n_Hydrogen = InformationRegion_PowerToGasPlants[i, 1, 4]*InformationRegion_PowerToGasPlants[i, 1, 5]/(141.79e6 - 219972), P_el_n = InformationRegion_PowerToGasPlants[i, 1, 4], eta_n = InformationRegion_PowerToGasPlants[i, 1, 5], max_storage = InformationRegion_PowerToGasPlants[i, 1, 6]*1000, P_el_min_rel = InformationRegion_PowerToGasPlants[i, 1, 7], complexityLevelMethanation = integer(InformationRegion_PowerToGasPlants[i, 1, 8]), p_Start = InformationRegion_PowerToGasPlants[i, 1, 9]*1e5, m_flow_internaldemand_constant = InformationRegion_PowerToGasPlants[i, 1, 14], p_minLow_constantDemand = InformationRegion_PowerToGasPlants[i, 1, 15], p_minLow = InformationRegion_PowerToGasPlants[i, 1, 16], p_minHigh = InformationRegion_PowerToGasPlants[i, 1, 17], p_maxLow = InformationRegion_PowerToGasPlants[i, 1, 18], p_maxHigh = InformationRegion_PowerToGasPlants[i, 1, 19])) else Config_info.Records.InstancesRecords.PowerToGasInstancesRecord(nPowerToGasPlants = 0) for i in 1:nRegions_info}
Config_info.Records.InstancesRecords.HeatingGridSystemStorageInstancesRecord[nRegions_info]heatingGridInstancesRecordRegionInfo{if (DifferentTypesOfCHPPlants_info[i] > 0 or DifferentTypesOfElectricHeater_info[i] > 0 or DifferentTypesOfGasBoiler_info[i] > 0) then Config_info.Records.InstancesRecords.HeatingGridSystemStorageInstancesRecord(nHeatingGrid = 1, heatingGridSystemStorageRecord = Config_info.Records.HeatingGridSystemStorageRecord(Q_flow_max = InformationRegion_GeneralInformation[i, 1, 5]*InformationRegion_GeneralInformation[i, 1, 16], ElHeater_quantity = integer(InformationRegion_ElectricHeater[i, 1, 3]), ElHeater_Q_el_n = InformationRegion_ElectricHeater[i, 1, 4], ElHeater_eta_n = InformationRegion_ElectricHeater[i, 1, 5], CHP_quantity = integer(InformationRegion_CHPPlants[i, 1, 3]), CHP_P_el_n = InformationRegion_CHPPlants[i, 1, 4], CHP_Q_flow_n = InformationRegion_CHPPlants[i, 1, 5], CHP_meritOrder = integer(InformationRegion_CHPPlants[i, 1, 6]), CHP_Q_flow_init = InformationRegion_CHPPlants[i, 1, 7], GasBoiler_Q_flow_n = InformationRegion_GasBoiler[i, 1, 4], GasBoiler_eta_n = InformationRegion_GasBoiler[i, 1, 5], GasBoiler_quantity = integer(InformationRegion_GasBoiler[i, 1, 3]))) else Config_info.Records.InstancesRecords.HeatingGridSystemStorageInstancesRecord(nHeatingGrid = 0) for i in 1:nRegions_info}Always deactivated, still in development
Import of external data sources › Local Demand Profile Path
StringlocalElectricDemand_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "LoadProfiles/ElectricalDemandProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalGasDemand_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "LoadProfiles/GasDemandProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalSolarthermalProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "SolarthermalProduction/SolarthermalProductionProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalTemperature_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "Temperature/TemperatureProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalHeatDemand_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "HeatDemandProfiles/HeatDemandProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
Import of external data sources › Local Renewable Production Profile Path
StringlocalBiogasProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "BioProduction/BiogasProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalWindOffshoreProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "WindOffshoreProduction/RenewableWindOffshoreProductionProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalBiomassProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "BioProduction/RenewableBioProductionProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalPhotovoltaicProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "PVProduction/RenewablePVProductionProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}
StringlocalWindOnshoreProduction_pathToTable_info{TransiEnt.Basics.Functions.fullPathName(Modelica.Utilities.System.getEnvironmentVariable(input_table_path_info) + "WindProduction/RenewableWindProductionProfile_Region" + String(Region_info[i]) + "_" + String(SimulationCounter_info, significantDigits = 35) + ".txt") for i in 1:nRegions_info}

Contents

NameDescription
Config_info