Synthetic Ammonia (Electrochemical)
Contents
Overview | Asset Structure | Flow Equations | Input File (Standard Format) | Types - Asset Structure | Constructors | Examples
Overview
In Macro, the Synthetic Ammonia asset represents an electrochemical ammonia production facility that uses hydrogen and nitrogen as feedstocks. This technology produces ammonia through electrochemical synthesis, typically using renewable electricity. Unlike thermal ammonia production, this process has zero direct CO₂ emissions if green hydrogen is used as the feedstock.
These assets are defined using either JSON or CSV input files placed in the assets directory, typically named with descriptive identifiers like synthetic_ammonia.json or synthetic_ammonia.csv.
Asset Structure
A Synthetic Ammonia plant is made of the following components:
- 1
Transformationcomponent, representing the electrochemical ammonia synthesis process. - 4
Edgecomponents:- 1 incoming
Hydrogen Edge, representing hydrogen supply. - 1 incoming
Nitrogen Edge, representing nitrogen supply. - 1 incoming
Electricity Edge, representing electricity consumption. - 1 outgoing
Ammonia Edge, representing ammonia production.
- 1 incoming
Here is a graphical representation of the Synthetic Ammonia asset:
Flow Equations
The Synthetic Ammonia asset follows these stoichiometric relationships:
\[\begin{aligned} \phi_{h2} &= \phi_{nh3} \cdot \epsilon_{h2\_consumption} \\ \phi_{n2} &= \phi_{nh3} \cdot \epsilon_{n2\_consumption} \\ \phi_{elec} &= \phi_{nh3} \cdot \epsilon_{electricity\_consumption} \\ \end{aligned}\]
Where:
- $\phi$ represents the flow of each commodity
- $\epsilon$ represents the stoichiometric coefficients defined in the Conversion Process Parameters section.
Input File (Standard Format)
The easiest way to include a Synthetic Ammonia asset in a model is to create a new file (either JSON or CSV) and place it in the assets directory together with the other assets.
your_case/
├── assets/
│ ├── synthetic_ammonia.json # or synthetic_ammonia.csv
│ ├── other_assets.json
│ └── ...
├── system/
├── settings/
└── ...This file can either be created manually, or using the template_asset function, as shown in the Adding an Asset to a System section of the User Guide. The file will be automatically loaded when you run your Macro model. An example of an input JSON file is shown in the Examples section.
The following tables outline the attributes that can be set for a Synthetic Ammonia asset.
Transform Attributes
Essential Attributes
| Field | Type | Description |
|---|---|---|
Type | String | Asset type identifier: "SyntheticAmmonia" |
id | String | Unique identifier for the asset instance |
location | String | Geographic location/node identifier |
timedata | String | Time resolution for the time series data linked to the transformation |
Conversion Process Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
h2_consumption | Float64 | Hydrogen consumption per MWh of ammonia output | $MWh_{H_2}/MWh_{NH_3}$ | 0.0 |
n2_consumption | Float64 | Nitrogen consumption per MWh of ammonia output | $t_{N_2}/MWh_{NH_3}$ | 0.0 |
electricity_consumption | Float64 | Electricity consumption per MWh of ammonia output | $MWh_{elec}/MWh_{NH_3}$ | 0.0 |
General Attributes
| Field | Type | Values | Default | Description |
|---|---|---|---|---|
type | String | Any Macro commodity type matching the commodity of the edge | Required | Commodity of the edge. E.g. "Electricity". |
start_vertex | String | Any node id present in the system matching the commodity of the edge | Required | ID of the starting vertex of the edge. The node must be present in the nodes.json file. E.g. "elec_node_1". |
end_vertex | String | Any node id present in the system matching the commodity of the edge | Required | ID of the ending vertex of the edge. The node must be present in the nodes.json file. E.g. "nh3_node_1". |
availability | Dict | Availability file path and header | Empty | Path to the availability file and column name for the availability time series to link to the edge. E.g. {"timeseries": {"path": "assets/availability.csv", "header": "SyntheticAmmonia"}}. |
has_capacity | Bool | Bool | false | Whether capacity variables are created for the edge. |
integer_decisions | Bool | Bool | false | Whether capacity variables are integers. |
unidirectional | Bool | Bool | false | Whether the edge is unidirectional. |
As a modeling decision, only the Ammonia edge is allowed to expand. Therefore, both the has_capacity and constraints attributes can only be set for that edge. For all other edges, these attributes are pre-set to false and an empty list, respectively, to ensure the correct modeling of the asset.
Investment Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
can_retire | Boolean | Whether capacity can be retired | - | true |
can_expand | Boolean | Whether capacity can be expanded | - | true |
existing_capacity | Float64 | Initial installed capacity | MWh NH₃ | 0.0 |
Economic Parameters
| Field | Type | Description | Units | Default |
|---|---|---|---|---|
investment_cost | Float64 | CAPEX per unit capacity | $/MW | 0.0 |
fixed_om_cost | Float64 | Fixed O&M costs | $/MW-yr | 0.0 |
variable_om_cost | Float64 | Variable O&M costs | $/MWh NH₃ | 0.0 |
Constraints Configuration
Synthetic Ammonia assets can have different constraints applied to them, and the user can configure them using the following fields:
| Field | Type | Description |
|---|---|---|
transform_constraints | Dict{String,Bool} | List of constraints applied to the transformation component. |
output_constraints | Dict{String,Bool} | List of constraints applied to the output edge component. |
For example, if the user wants to apply the BalanceConstraint to the transformation component and the CapacityConstraint to the output edge, the constraints fields should be set as follows:
{
"transform_constraints": {
"BalanceConstraint": true
},
"edges":{
"nh3_edge": {
"constraints": {
"CapacityConstraint": true
}
}
}
}Users can refer to the Adding Asset Constraints to a System section of the User Guide for a list of all the constraints that can be applied to the different components of a Synthetic Ammonia asset.
Default constraints
To simplify the input file and the asset configuration, the following constraints are applied to the Synthetic Ammonia asset by default:
- Balance constraint (applied to the transformation component)
- Capacity constraint (applied to the output ammonia edge)
Types - Asset Structure
The Synthetic Ammonia asset is defined as follows:
struct SyntheticAmmonia <: AbstractAsset
id::AssetId
synthetic_ammonia_transform::Transformation
h2_edge::Edge{<:Hydrogen}
n2_edge::Edge{<:Nitrogen}
elec_edge::Edge{<:Electricity}
nh3_edge::Edge{<:Ammonia}
endConstructors
Factory constructor
make(asset_type::Type{SyntheticAmmonia}, data::AbstractDict{Symbol,Any}, system::System)| Field | Type | Description |
|---|---|---|
asset_type | Type{SyntheticAmmonia} | Macro type of the asset |
data | AbstractDict{Symbol,Any} | Dictionary containing the input data for the asset |
system | System | System to which the asset belongs |
Stoichiometry balance data
synthetic_ammonia_transform.balance_data = Dict(
:hydrogen => Dict(
nh3_edge.id => get(transform_data, :h2_consumption, 0.0),
h2_edge.id => 1.0,
),
:nitrogen => Dict(
nh3_edge.id => get(transform_data, :n2_consumption, 0.0),
n2_edge.id => 1.0,
),
:electricity => Dict(
nh3_edge.id => get(transform_data, :electricity_consumption, 0.0),
elec_edge.id => 1.0
),
)In the code above, each get function call looks up a parameter in the transform_data dictionary using a symbolic key such as :h2_consumption or :n2_consumption. These keys must exactly match the corresponding field names in your input asset .json or .csv files. Mismatched key names between the constructor file and the asset input will result in missing or incorrect parameter values (defaulting to the values shown above).
Examples
This example illustrates a basic Synthetic Ammonia configuration in JSON format:
{
"SyntheticAmmonia": [
{
"type": "SyntheticAmmonia",
"global_data":{
"nodes": {},
"transforms": {
"timedata": "Ammonia"
},
"edges":{
"nh3_edge": {
"commodity": "Ammonia",
"unidirectional": true,
"has_capacity": true,
"can_retire": true,
"can_expand": true,
"integer_decisions": false
},
"h2_edge": {
"commodity": "Hydrogen",
"unidirectional": true,
"has_capacity": false
},
"n2_edge": {
"commodity": "Nitrogen",
"unidirectional": true,
"has_capacity": false
},
"elec_edge": {
"commodity": "Electricity",
"unidirectional": true,
"has_capacity": false
}
}
},
"instance_data":[
{
"id": "synthetic_ammonia_1",
"transforms":{
"h2_consumption": 1.1484,
"n2_consumption": 0.1597,
"electricity_consumption": 0.2473
},
"edges":{
"nh3_edge": {
"end_vertex": "nh3_node_1",
"existing_capacity": 0.0,
"investment_cost": 1461749.91,
"fixed_om_cost": 2512.7481,
"variable_om_cost": 0.02027
},
"h2_edge": {
"start_vertex": "h2_node_1"
},
"n2_edge": {
"start_vertex": "n2_node_1"
},
"elec_edge": {
"start_vertex": "elec_node_1"
}
}
}
]
}
]
}See Also
- Edges - Components that connect Vertices and carry flows
- Transformations - Processes that transform flows of several Commodities
- Nodes - Network nodes that allow for import and export of commodities
- Vertices - Network nodes that edges connect
- Assets - Higher-level components made from edges, nodes, storage, and transformations
- Commodities - Types of resources stored by Commodities
- Time Data - Temporal modeling framework
- Constraints - Additional constraints for Storage and other components
- Thermal Ammonia - Thermal ammonia production without CCS
- Thermal Ammonia - Thermal ammonia production (with and without CCS)