Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bc9c98d
Added initial version of NG plant
johnjasa Aug 18, 2025
c1e9b4d
Adding actual models for NG
johnjasa Aug 18, 2025
4138ff8
Fixed BTU to cu ft conversion
johnjasa Aug 18, 2025
3d48315
Added natural gas doc
johnjasa Aug 18, 2025
2c1aa67
Refining names
johnjasa Aug 18, 2025
675ab3a
Refactoring NG workflow, esp. for pricing
johnjasa Aug 19, 2025
82d7116
Updated example test values for NG
johnjasa Aug 19, 2025
e677ac2
added feedstock cost model and tests and updated costmodelbaseclass
elenya-grant Aug 19, 2025
8c4abf6
Merge branch 'develop' of github.com:NREL/H2Integrate into feedstock
elenya-grant Aug 20, 2025
cb7daba
Removing prior notion of resource for NG
johnjasa Aug 20, 2025
b27009d
Merged and started on shared feedstock work
johnjasa Aug 20, 2025
37336f9
New feedstocks working as intended
johnjasa Aug 22, 2025
90c7c8f
Updated test values for the natural gas example
johnjasa Aug 22, 2025
a767201
Added feedstocks doc page
johnjasa Aug 22, 2025
1690034
Updating feedstock test file
johnjasa Aug 22, 2025
8299b29
Merge branch 'develop' into add_ng_plants
johnjasa Aug 22, 2025
12b2630
Updating tests due to develop
johnjasa Aug 25, 2025
3ed3371
Merge conflicts
johnjasa Aug 29, 2025
c96290c
Updated examples
johnjasa Aug 29, 2025
22f4d49
fix tests
kbrunik Aug 29, 2025
0b5aecd
Merge branch 'add_ng_plants' of https://github.com/johnjasa/H2Integra…
kbrunik Aug 29, 2025
09906ed
update plant config
kbrunik Aug 29, 2025
f6c0944
Merge branch 'develop' into add_ng_plants
johnjasa Aug 29, 2025
57f6a49
added default cost values in feedstockcostconfig
elenya-grant Aug 29, 2025
bdea66d
resolved merge conflicts with develop
elenya-grant Aug 29, 2025
df161a4
Merge branch 'develop' into add_ng_plants
johnjasa Aug 30, 2025
d81d203
updated feedstock doc page
elenya-grant Sep 2, 2025
5d6bfc5
updated ng to handle varying dt
elenya-grant Sep 4, 2025
10222b5
Merge branch 'develop' into add_ng_plants
johnjasa Sep 4, 2025
b898ca3
Merge branch 'develop' into add_ng_plants
johnjasa Sep 5, 2025
bfb83f6
unit conversion
kbrunik Sep 5, 2025
834914b
Fixing dt logic in NG performance model
johnjasa Sep 5, 2025
79d3eff
Making pipe work for NG as well
johnjasa Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
- Updated finance parameter organization naming in `plant_config`.
- Added cost model base class and removed `plant_config['finance_parameters']['discount_years']['tech']`. Some cost models require user-input cost year (`tech_config[tech]['model_inputs']['cost_parameters']['cost_year']`) others do not. Cost year is output from cost models as a discrete output.
- Add ocean alkalinity enhancement technology model.
- Refactored `ProFastComp` and put in a new file (`h2integrate/core/profast_financial.py`). Added flexibility to allow users to specify different financial models.
- Added ability to export ProFAST object to yaml file in `ProFastComp`
- Added `natural_gas_performance` and `natural_gas_cost` models, allowing for natural gas power plant modeling.
- Revamped the feedstocks technology group to allow for more precise modeling of feedstock supply chains, including capacity constraints and feedstock amount consumed.
- Refactored `ProFastComp` and put in a new file (`h2integrate/core/profast_financial.py`). Added flexibility to allow users to specify different financial models.
- Bugfix on `h2integrate/transporters/power_combiner.py` and enabled usage of multiple electricity producing technologies.
- Updated option to pass variables in technology interconnections to allow for different variable names from source to destination in the format `[source_tech, dest_tech, (source_tech_variable, dest_tech_variable)]`
- Added `simulation` section under `plant_config['plant']` that has information such as number of timesteps in the simulation, time step interval in seconds, simulation start time, and time zone.
Expand Down
2 changes: 2 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ parts:

- caption: Technology Models
chapters:
- file: technology_models/feedstocks
- file: technology_models/run_of_river
- file: technology_models/direct_ocean_capture
- file: technology_models/natural_gas
- file: technology_models/wombat_electrolyzer_om
- file: technology_models/pvwattsv8_solar_pv.md
- file: technology_models/atb_costs_pv.md
Expand Down
81 changes: 81 additions & 0 deletions docs/technology_models/feedstocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Feedstock Models

Feedstock models in H2Integrate represent any resource input that is consumed by technologies in your plant, such as natural gas, water, electricity from the grid, or any other material input.
The feedstock modeling approach provides a flexible way to track resource consumption and calculate associated costs for any type of input material or energy source.
Please see the example `16_natural_gas` in the `examples` directory for a complete setup using natural gas as a feedstock.

## How Feedstock Models Work

### Two-Component Architecture

Each feedstock type requires two model components:

1. **Performance Model** (`feedstock_performance`):
- Generates the feedstock supply profile
- Outputs `{feedstock_type}_out` variable
- Located at the beginning of the technology chain

2. **Cost Model** (`feedstock_cost`):
- Calculates consumption costs based on actual usage
- Takes `{feedstock_type}_consumed` as input
- Located after all consuming technologies in the chain

### Technology Interconnections

Feedstocks connect to consuming technologies through the `technology_interconnections` in your plant configuration. The connection pattern is:

```yaml
technology_interconnections: [
["name_of_feedstock_source", "consuming_technology", "feedstock_type", "connection_type"],
]
```

Where:
- `name_of_feedstock_source`: Name of your feedstock source
- `consuming_technology`: Technology that uses the feedstock
- `feedstock_type`: Type identifier (e.g., "natural_gas", "water", "electricity")
- `connection_type`: Name for the connection (e.g., "pipe", "cable")

## Configuration

To use the feedstock performance and cost models, add an entry to your `tech_config.yaml` like this:

```yaml
ng_feedstock:
performance_model:
model: "feedstock_performance"
cost_model:
model: "feedstock_cost"
model_inputs:
shared_parameters:
feedstock_type: "natural_gas"
units: "MMBtu"
performance_parameters:
rated_capacity: 100.
cost_parameters:
cost_year: 2023
price: 4.2
annual_cost: 0.
start_up_cost: 100000.
```

### Performance Model Parameters

- `feedstock_type` (str): Identifier for the feedstock type (e.g., "natural_gas", "water", "electricity")
- `units` (str): Units for feedstock consumption (e.g., "MMBtu", "kg", "galUS", "MWh")
- `rated_capacity` (float): Maximum feedstock supply rate in `units`/hour

### Cost Model Parameters

- `feedstock_type` (str): Must match the performance model identifier
- `units` (str): Must match the performance model units
- `price` (float, int, or list): Cost per unit in USD/`units`. Can be:
- Scalar: Constant price for all timesteps and years
- List: Price per timestep
- `annual_cost` (float, optional): Fixed cost per year in USD/year. Defaults to 0.0
- `start_up_cost` (float, optional): One-time capital cost in USD. Defaults to 0.0
- `cost_year` (int): Dollar year for cost inputs

```{tip}
The `price` parameter is flexible - you can specify constant pricing with a single value or time-varying pricing with an array of values matching the number of simulation timesteps.
```
39 changes: 39 additions & 0 deletions docs/technology_models/natural_gas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Natural gas power plant model

The natural gas power plant model simulates electricity generation from natural gas combustion, suitable for both natural gas combustion turbines (NGCT) and natural gas combined cycle (NGCC) plants. The model calculates electricity output based on natural gas input and plant heat rate, along with comprehensive cost modeling that includes capital expenses, operating expenses, and fuel costs.

To use this model, specify `"natural_gas_performance"` as the performance model and `"natural_gas_cost"` as the cost model.

## Performance Parameters

The performance model requires the following parameter:

- `heat_rate` (required): Heat rate of the natural gas plant in MMBtu/MWh. This represents the amount of fuel energy required to produce one MWh of electricity. Lower values indicate higher efficiency. Typical values:
- **NGCC (Combined Cycle)**: 6-8 MMBtu/MWh (high efficiency)
- **NGCT (Combustion Turbine)**: 10-14 MMBtu/MWh (lower efficiency, faster response)

The model implements the relationship:

$$
\text{Electricity Output (MW)} = \frac{\text{Natural Gas Input (MMBtu/h)}}{\text{Heat Rate (MMBtu/MWh)}}
$$

## Cost Parameters

The cost model calculates capital and operating costs based on the following parameters:

- `capex` (required): Capital cost per unit capacity in $/kW. This includes all equipment, installation, and construction costs. Typical values:
- **NGCT**: 600-2000 $/kW (lower capital cost)
- **NGCC**: 800-2400 $/kW (higher capital cost)

- `fopex` (required): Fixed operating expenses per unit capacity in \$/kW/year. This includes fixed O&M costs that don't vary with generation. Typical values: 5-15 \$/kW/year

- `vopex` (required): Variable operating expenses per unit generation in \$/MWh. This includes variable O&M costs that scale with electricity generation. Typical values: 1-5 \$/MWh

- `heat_rate` (required): Heat rate in MMBtu/MWh, used for fuel cost calculations.

- `ng_price` (required): Natural gas price in $/MMBtu. Can be a numeric value for fixed price or `"variable"` string to indicate external price management.

- `project_life` (optional): Project lifetime in years for cost calculations. Default is 30 years, typical for power plants.

- `cost_year` (required): Dollar year corresponding to input costs.
5 changes: 5 additions & 0 deletions examples/16_natural_gas/driver_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name: "driver_config"
description: "This analysis runs a natural gas power plant"

general:
folder_output: outputs
7 changes: 7 additions & 0 deletions examples/16_natural_gas/natgas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "H2Integrate_config"

system_summary: "This reference natural gas plant contains a simple natural gas combined cycle (NGCC) power plant"

driver_config: "driver_config.yaml"
technology_config: "tech_config.yaml"
plant_config: "plant_config.yaml"
64 changes: 64 additions & 0 deletions examples/16_natural_gas/plant_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: "plant_config"
description: "This plant is located in Texas"

site:
latitude: 32.34
longitude: -98.27
elevation_m: 440.0
time_zone: -6

# array of polygons defining boundaries with x/y coords
boundaries: [
{
x: [0.0, 1000.0, 1000.0, 0.0],
y: [0.0, 0.0, 100.0, 1000.0],
},
{
x: [2000.0, 2500.0, 2000.0],
y: [2000.0, 2000.0, 2500.0],
}
]

# array of arrays containing left-to-right technology
# interconnections; can support bidirectional connections
# with the reverse definition.
# in this example the natural gas combined cycle plant is behind-the-meter
# and not connected to additional technologies.
# hence the empty array.
technology_interconnections: [
["ng_feedstock", "natural_gas_plant", "natural_gas", "pipe"],
]

plant:
plant_life: 30
grid_connection: False # option, can be turned on or off
ppa_price: 0.027498168 # based off correlations of LBNL PPA data
hybrid_electricity_estimated_cf: 0.492 #should equal 1 if grid_connection = True
simulation:
n_timesteps: 8760

finance_parameters:
finance_model: "ProFastComp"
model_inputs:
params:
analysis_start_year: 2032
installation_time: 36
inflation_rate: 0.0
discount_rate: 0.09
debt_equity_ratio: 2.62
property_tax_and_insurance: 0.03
total_income_tax_rate: 0.308
capital_gains_tax_rate: 0.15
sales_tax_rate: 0.07375
debt_interest_rate: 0.07
debt_type: "Revolving debt"
loan_period_if_used: 0
cash_onhand_months: 1
admin_expense: 0.00
capital_items:
depr_type: "MACRS"
depr_period: 5
refurb: [0.]
cost_adjustment_parameters:
cost_year_adjustment_inflation: 0.025
target_dollar_year: 2022
11 changes: 11 additions & 0 deletions examples/16_natural_gas/run_natural_gas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from h2integrate.core.h2integrate_model import H2IntegrateModel


# Create an H2I model
h2i = H2IntegrateModel("natgas.yaml")

# Run the model
h2i.run()

# Post-process the results
h2i.post_process()
34 changes: 34 additions & 0 deletions examples/16_natural_gas/tech_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "technology_config"
description: "This plant produces electricity from natural gas using a combined cycle turbine"

technologies:
ng_feedstock:
performance_model:
model: "feedstock_performance"
cost_model:
model: "feedstock_cost"
model_inputs:
shared_parameters:
feedstock_type: "natural_gas"
units: "MMBtu"
performance_parameters:
rated_capacity: 100.
cost_parameters:
cost_year: 2023
price: 4.2
annual_cost: 0.
start_up_cost: 100000.
natural_gas_plant:
performance_model:
model: "natural_gas_performance"
cost_model:
model: "natural_gas_cost"
model_inputs:
shared_parameters:
heat_rate_mmbtu_per_mwh: 7.5 # MMBtu/MWh - typical for NGCC
cost_parameters:
plant_capacity_mw: 100.
capex_per_kw: 1000 # $/kW - typical for NGCC
fixed_opex_per_kw_per_year: 10.0 # $/kW/year
variable_opex_per_mwh: 2.5 # $/MWh
cost_year: 2023
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
)


plant_config = {
"plant": {
"plant_life": 30,
"simulation": {
"n_timesteps": 8760,
},
},
}

tech_config_dict = {
"model_inputs": {
"shared_parameters": {
Expand Down
Empty file.
41 changes: 41 additions & 0 deletions h2integrate/converters/natural_gas/natural_gas_baseclass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import openmdao.api as om


class NaturalGasPerformanceBaseClass(om.ExplicitComponent):
"""
Base class for natural gas plant performance models.

This base class defines the common interface for natural gas combustion
turbine (NGCT) and natural gas combined cycle (NGCC) performance models.
"""

def initialize(self):
self.options.declare("driver_config", types=dict)
self.options.declare("plant_config", types=dict)
self.options.declare("tech_config", types=dict)

def setup(self):
n_timesteps = self.options["plant_config"]["plant"]["simulation"]["n_timesteps"]
self.add_input(
"natural_gas_in",
val=0.0,
shape=n_timesteps,
units="MMBtu",
desc="Natural gas input energy",
)
self.add_output(
"electricity_out",
val=0.0,
shape=n_timesteps,
units="MW",
desc="Electricity output from natural gas plant",
)

def compute(self, inputs, outputs):
"""
Computation for the OM component.

For a template class this is not implemented and raises an error.
"""

raise NotImplementedError("This method should be implemented in a subclass.")
Loading