Matgas Format (.m)

Here we detail the parameters that can be inputted using the matgas format. They can be inputted in the order they appear here, or selectively, in the case where some data is not required, by using the following header format.

%% junction data
% id p_min p_max p_nominal junction_type status pipeline_name edi_id lat lon

See case files in test/data/matgas or examples/data/matgas for examples of file syntax.

Junctions (mgc.junction)

These components model “point” locations in the system, i.e. locations of withdrawal or injection, or simply connection points between pipes. Each junction may have multiple pipes attached.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntJunction id:heavycheckmark:Unique id for junctions
p_minFloat64Pressure MinimumPascalPSI:heavycheckmark:Optimization constraint
p_maxFloat64Pressure MaximumPascalPSI:heavycheckmark:Maximum operating pressure (MOP, psig) used in line pack calculations, which is lower than the maximum allowable operating pressure (MAOP, psig)
p_nominalFloat64PressurePascalPSI:heavycheckmark:Nominal pressure, can have a default that lies between the pressure min/max
junction_typeIntJunction Type:heavycheckmark:Classification of the junction: 0 = standard node, 1 = slack node
statusIntJunction Status:heavycheckmark:Determines if the component is active in the model
pipeline_nameStringPipeline NameName of the pipeline to which this junction belongs
edi_idStringEDI IDEDI ID if applicable, to enabled easy input of near-real-time EDI data
latFloat64LatitudeDecimal degreesDecimal degreesLatitude of the junction
lonFloat64LongitudeDecimal degreesDecimal degreesLongitude of the junction

Pipes (mgc.pipe)

These components model pipelines which connect two junctions.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntPipe id:heavycheckmark:Unique id for pipes
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
diameterFloat64DiameterMetersInches:heavycheckmark:Pipe diameter
lengthFloat64LengthMetersMiles:heavycheckmark:Pipe Length
friction_factorFloat64Friction Factor:heavycheckmark:parameter based on the relative roughness of the pipe and Reynolds Number
p_minFloat64Pressure MinimumPascalPSI:heavycheckmark:Float value link minimum pressure used as optimization constraint, typically set equal to 14.7 psia, which is equivalent to 1.01325 bar
p_maxFloat64Pressure MaximumPascalPSI:heavycheckmark:Maximum allowable operating pressure (MAOP,psig) for a given pipeline segment
statusIntPipe status:heavycheckmark:Determines if the component is active in the model
is_bidirectionalIntBi-directionalitySpecifies whether the pipe supports bi-directional flow
pipeline_nameStringPipeline NameName of the pipeline to which this pipe belongs
numspatialdiscretization_pointsIntSpace pointsNumber of spatial discretization points in the pipe, used for Transient calculations

Compressors (mgc.compressor)

These components model infrastructure used to boost pressure between two nodes.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntCompressor id:heavycheckmark:Unique id for compressor
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
cratiominFloat64Minimum compression ratio:heavycheckmark:Minimum compression ratio
cratiomaxFloat64Maximum compression ratio:heavycheckmark:Maximum compression ratio
power_maxFloat64Maximum powerWHP:heavycheckmark:Float value compressor max power, used as optimization constraint
flow_minFloat64Minimum mass flowkg/s:heavycheckmark:Minimum mass flow
flow_maxFloat64Maximum mass flowkg/s:heavycheckmark:Maximum mass flow
inletpminFloat64Minimum inlet pressurePascalPSI:heavycheckmark:Minimum pressure at compressor inlet
inletpmaxFloat64Maximum inlet pressurePascalPSI:heavycheckmark:Maximum pressure at compressor inlet
outletpminFloat64Minimum outlet pressurePascalPSI:heavycheckmark:Minimum pressure at compressor outlet
outletpmaxFloat64Maximum outlet pressurePascalPSI:heavycheckmark:Maximum pressure at compressor outlet
statusIntCompressor status:heavycheckmark:Determines if the component is active in the model
operating_costFloat64Operating cost$/W$/kWCost to operate compressor
directionalityIntDirectionalityAn integer value that denotes the directionality of compression and flow: 0 = bi-directional compressor, 1 = unidirectional compressor with no reversal for flow allowed, 2 = unidirectional compressor which allows for uncompressed reversal of flows
compressorstationnameStringCompressor Station NameName of compressor stations
pipeline_nameStringPipeline nameName of Pipeline
totalinstalledpowerFloat64Total installed powerWWTotal installed horsepower – same as maximum power
numcompressorunitsIntNumber of compressor unitsNumber of compressor units – needed to account for number of gas-fired compressors versus those driven by electric power
compressor_typeStringCompressor TypeCompressor type (reciprocal versus turbine) – used to determine compressor efficiency
designsuctionpressureFloat64Design Suction PressurePascalPSIUsed to estimate compressor max pressure delta
designdischargepressureFloat64Design discharge pressurePascalPSIUsed to determine maximum extent of line pack for downstream pipeline segments
maxcompressedvolumeFloat64Maximum compressed volumeMaximum volume compressed at design conditions
designfuelrequiredFloat64Design fuel requiredMMSCFDFuel required at design conditions
designelectricpower_requiredFloat64Design electric power requiredkWh/dayElectric power required at design conditions – determines which compressor stations could be affected by an electric outage
numunitsforpeakserviceIntNumber of units for peak serviceNumber of units in service during peak conditions
peak_yearIntPeak yearYear of peak conditions

Short Pipes (mgc.short_pipe)

These components model, e.g., handling complicated contract situations at single entry points; they are modeled to have zero resistance.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntShort pipe id:heavycheckmark:Unique id for short pipe
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
statusIntShort Pipe status:heavycheckmark:Determines if the component is active in the model
is_bidirectionalIntBi-directionalitySpecifies whether the pipe supports bi-directional flow
pipeline_nameStringPipeline NameName of the pipeline to which this pipe belongs

Resistors (mgc.resistor)

These components model pressure drops for which no other data or models are available.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntResistor id:heavycheckmark:Unique id for resistor
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
dragFloat64Drag factor:heavycheckmark:the drag factor of the resistors - non dimensional value
statusIntResistor status:heavycheckmark:Determines if the component is active in the model
is_bidirectionalIntBi-directionalitySpecifies whether the pipe supports bi-directional flow
pipeline_nameStringPipeline NameName of the pipeline to which this pipe belongs

Regulators (mgc.regulator)

These components model pressure reducing valves.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntRegulator id:heavycheckmark:Unique id for regulator
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
reductionfactorminFloat64Minimum reduction factor:heavycheckmark:This value is necessarily < 1
reductionfactormaxFloat64Maximum reduction factor:heavycheckmark:Default value = 1, but can be < 1
flow_minFloat64Minimum flowkg/sMMSCFD:heavycheckmark:Minimum flow through the regulator
flow_maxFloat64Maximum flowkg/sMMSCFD:heavycheckmark:Maximum flow through the regulator
statusIntRegulator status:heavycheckmark:Determines if the component is active in the model
discharge_coefficientFloat64Discharge coefficient:heavycheckmark:More commonly known as the "flow coefficient Kv"
designflowrateFloat64kg/sMMSCFDMaximum design flow
designinletpressureFloat64PascalPSIPressure upstream of the regulator
designoutletpressureFloat64PascalPSIPressure downstream of the regulator
pipeline_nameStringPipeline NameName of the pipeline to which this pipe belongs

Valves (mgc.valve)

These model components which close off flow between two points in a natural gas network.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntValve id:heavycheckmark:Unique id for valve
fr_junctionIntFrom Junction id:heavycheckmark:Unique id of the junction on the from side
to_junctionIntTo Junction id:heavycheckmark:Unique id of the junction on the to side
statusIntValve status:heavycheckmark:Determines if the component is active in the model
flow_coefficientFloat64Flow Coefficient:heavycheckmark:Coefficient of flow (Cv) – used to determine a valve’s flow under various conditions (e.g., potentially partially open)
pipeline_nameStringPipeline NameName of the pipeline to which this pipe belongs

Transfers (mgc.transfer)

These components model interconnects, i.e. points in the network that can act both as a receipt point or delivery point at different times of the day (redundant for steady-state). In practice, a transfer could be modeled as a receipt point and a delivery point, however, modeling it as a transfer allows for explicitly stating that a boundary condition can act as either an injection or consumption–but not both.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntTransfer id:heavycheckmark:Unique id for transfer
junction_idIntJunction id:heavycheckmark:Unique id of Junction to which component is connected
withdrawal_minFloat64Minimum Withdrawalkg/sMMSCFD:heavycheckmark:This number can be negative, in which case it means that the transfer point is injecting gas into the system
withdrawal_maxFloat64Maximum Withdrawalkg/sMMSCFD:heavycheckmark:this variable can depend on flow direction
withdrawal_nominalFloat64Nominal Withdrawalkg/sMMSCFD:heavycheckmark:Can have a default of 0.0
is_dispatchableIntDispatchable:heavycheckmark:If the component is marked as dispatchable, it means that it can vary its withdrawal between its minimum and maximum. If not, then the component is injecting or withdrawing exactly at the nominal withdrawal rate
statusIntTransfer status:heavycheckmark:Determines if the component is active in the model
bid_priceFloat64Bid Price$/kg$/volBid price
offer_priceFloat64Offer Price$/kg$/volOffer price
exchangepointnameStringExchange Point NameName of Exchange point
pipeline_nameStringPipeline NameName of pipeline to which the transfer belongs
otherpipelinenameStringOther Pipeline NameName of pipeline to which the transfer connects
design_pressureFloat64Design pressurePSIMaximum designed pressure
meter_capacityFloat64Meter CapacityMMSCFDProvided by real-time data collection (EDI), model constraint
dailyscheduledflowFloat64Daily scheduled flowMMSCFDProvided by near-real-time data collection (EDI)

Receipts (mgc.receipt)

These components model consumers of natural gas.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntReceipt id:heavycheckmark:Unique id for receipt
junction_idIntJunction id:heavycheckmark:Unique id of Junction to which component is connected
injection_minFloat64Minimum Injectionkg/sMMSCFD:heavycheckmark:Minimum amount of gas that can be injected
injection_maxFloat64Maximum Injectionkg/sMMSCFD:heavycheckmark:Maximum amount of gas that can be injected
injection_nominalFloat64Nominal Injectionkg/sMMSCFD:heavycheckmark:Nominal gas injection
is_dispatchableIntDispatchable:heavycheckmark:If the component is marked as dispatchable, it means that it can vary its injection between its minimum and maximum. If not, then the component is injecting exactly at the nominal injection rate
statusIntReceipt status:heavycheckmark:Determines if the component is active in the model
offer_priceFloat64Offer Price$/W$/volOffer price
nameStringReceipt NameName of receipt point
company_nameStringCompany NameName of company that owns receipt point
dailyscheduledflowFloat64Daily Scheduled FlowMMSCFDProvided by real-time data collection (EDI), model constraint
design_capacityFloat64Design CapacityMMSCFDProvided by real-time data collection (EDI), model constraint
operating_capacityFloat64Operating CapacityMMSCFDProvided by real-time data collection (EDI), model constraint
is_firmIntInterruptable vs FirmIdentifies the order by which the receipt flow could be curtailed (interruptible first, then firm)
edi_idIntEDI IDUnique ID to allow easy input of near-real-time EDI data

Deliveries (mgc.delivery)

These components model producers (providers) of natural gas.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntDelivery id:heavycheckmark:Unique id for delivery
junction_idIntJunction id:heavycheckmark:Unique id of Junction to which component is connected
withdrawal_minFloat64Minimum withdrawalkg/sMMSCFD:heavycheckmark:Minimum amount of gas that can be withdrawn
withdrawal_maxFloat64Maximum withdrawalkg/sMMSCFD:heavycheckmark:Maximum amount of gas that can be withdrawn
withdrawal_nominalFloat64Nominal withdrawalkg/sMMSCFD:heavycheckmark:Nominal gas withdrawal
is_dispatchableIntDispatchable:heavycheckmark:If the component is marked as dispatchable, it means that it can vary its injection between its minimum and maximum. If not, then the component is injecting exactly at the nominal injection rate
statusIntDelivery status:heavycheckmark:Determines if the component is active in the model
bid_priceFloat64Bid Price$/W$/volBid price
nameStringDelivery NameName of delivery point
company_nameStringCompany NameName of company that owns delivery point
dailyscheduledflowFloat64Daily Scheduled FlowMMSCFDProvided by real-time data collection (EDI), model constraint
design_capacityFloat64Design CapacityMMSCFDProvided by real-time data collection (EDI), model constraint
operating_capacityFloat64Operating CapacityMMSCFDProvided by real-time data collection (EDI), model constraint
is_firmIntInterruptable vs FirmIdentifies the order by which the d flow could be curtailed (interruptible first, then firm)
edi_idIntEDI IDUnique ID to allow easy input of near-real-time EDI data

Storage (mgc.storage)

These components are used to model locations which can store and release natural gas.

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
idIntStorage id:heavycheckmark:Unique id for storage
junction_idIntJunction id:heavycheckmark:Unique id of Junction to which component is connected
pressure_nominalFloat64Nominal pressurePascalPSI:heavycheckmark:pressure at the storage
flowinjectionrate_minFloat64Minimum injection ratekg/sMMSCFD:heavycheckmark:Minimum flow injection rate
flowinjectionrate_maxFloat64Maximum injection ratekg/sMMSCFD:heavycheckmark:Maximum flow injection rate
flowwithdrawalrate_minFloat64Minimum withdrawal ratekg/sMMSCFD:heavycheckmark:Minimum flow withdrawal rate
flowwithdrawalrate_maxFloat64Maximum withdrawal ratekg/sMMSCFD:heavycheckmark:Maximum flow withdrawal rate
capacityFloat64CapacitykgMMSCF:heavycheckmark:Capacity of the storage
statusIntStorage status:heavycheckmark:Determines if the component is active in the model
nameStringStorage NameName of the Storage point
owner_nameStringOwner NameName of the Storage point owner
storage_typeStringStorage typeType of storage (aquifer, salt cavern, or depleted oil and gas)
dailywithdrawalmaxFloat64Daily withdrawal ratekg/sMMSCFDMaximum daily withdrawal
seasonalwithdrawalmaxFloat64Seasonal withdrawal ratekg/sMMSCFDMaximum Seasonal withdrawal
basegascapacityFloat64Base gas capacitykgMMSCFBase gas capacity
workinggascapacityFloat64Working gas capacitykgMMSCFWorking gas capacity
totalfieldcapacityFloat64Total field capacitykgMMSCFTotal field gas capacity
edi_idIntEDI IDUnique ID to allow easy input of near-real-time EDI data

Network Parameters (mgc.parameter)

VariableTypeNameStandard Units (SI)United States Customary UnitsRequiredDescription
gasspecificgravityFloat64Specific GravityGas gravity
specificheatcapacity_ratioFloat64Specific heat capacityspecific heat capacity ratio
temperatureFloat64TemperatureKtemperature of the network
sound_speedFloat64Speed of Soundm/sspeed of sound in gas
RFloat64Universal Gas ConstantJ/mol/KUniversial gas constant
gasmolarmassFloat64Molar Masskg/molMolar Mass
compressibility_factorFloat64Compressibility factorCompressibility factor (unitless)
base_pressureFloat64Base PressurePascalPSIBase pressure in Pa or psi
base_lengthFloat64Base LengthMetersMilesBase length in m or miles
base_timeFloat64Base TimeHoursHoursBase time in hr
unitsStringUnits'si' for standard units or 'usc' for United States customary units
isperunitIntPer-unitIf data is already in per-unit (non-dimensionalized
nameStringCase NameName of Network Case
yearIntYearYear from which data originated

Transient Data Format (CSV)

The transient/time-series data will come in as one .csv file (comma separated format). The first column in the CSV format will be a time stamp in the date-time format YYYY-MM-DDTHH:MM:SS+HH:MM, where the +HH:MM indicates the timezone offset, the second column will be the component type, the third column will be the component id, the forth column will be the parameter name, and the fifth column will be the value of the parameter. See below example for valid header names.

timestamp,component_type,component_id,parameter,value
1992-09-12T00:00:00.0+00:00,delivery,1,withdrawal_nominal,0.104678
1992-09-13T00:00:00.0+00:00,delivery,1,withdrawal_nominal,0.540400
1992-09-14T00:00:00.0+00:00,delivery,1,withdrawal_nominal,0.929477
1992-09-15T00:00:00.0+00:00,delivery,1,withdrawal_nominal,0.412720