openpytea.equipment¶
- openpytea.equipment.inflation_adjustment(equipment_cost, cost_year, target_year=2024)[source]¶
Adjust equipment cost from one year to another using the Chemical Engineering Plant Cost Index (CEPCI).
This function uses historical CEPCI values to convert equipment costs between different years, accounting for inflation in the chemical engineering industry.
- Parameters:
- Returns:
The inflation-adjusted equipment cost in target_year (in USD).
- Return type:
- Raises:
ValueError – If cost_year is not found in CEPCI_DF.
ValueError – If target_year is not found in CEPCI_DF.
Notes
The adjustment factor is calculated as: adjusted_cost = equipment_cost * (CEPCI[target_year] / CEPCI[cost_year])
Examples
>>> # Adjust from 2015 to 2023 >>> new_cost = inflation_adjustment(50000, 2015, 2023)
- class openpytea.equipment.CostCorrelationDB(df= key ... doi / link 0 impeller_mixer_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 1 kneader_blender_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 2 propeller_mixer_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 3 propeller_mixer_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 4 ribbon_blender_turton_2001 ... https://books.google.nl/books/about/Analysis_S... .. ... ... ... 160 cooling_tower_and_pumps_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 161 packaged_mechanical_refrigerator_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 162 water_ion_exchange_plant_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 163 internal_coils_vaporizers_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 164 jacketed_vessels_vaporizers_turton_2001 ... https://books.google.nl/books/about/Analysis_S... [165 rows x 21 columns])[source]¶
Bases:
objectDatabase interface for equipment cost correlations.
Manages cost estimation correlations for equipment based on size/capacity parameters. Supports multiple correlation forms (power-law, quad log-log) and handles equipment parallelization when capacity limits are exceeded.
- df¶
Cost correlation data with columns: key, category, type, form, s_lower, s_upper, upper_parallel, a, b, n, k1, k2, k3, cost_year.
- Type:
pd.DataFrame
- evaluate(key, s)[source]¶
Calculate purchased equipment cost based on correlation key and size.
- Parameters:
- Returns:
(total_cost, number_of_units, cost_year).
- Return type:
tuple[float,int,int]- Raises:
KeyError – If correlation key not found in database.
ValueError – If size is below the lower bound or the correlation form is unsupported.
- class openpytea.equipment.Equipment(name, param, process_type, category, type=None, material='Carbon steel', num_units=None, purchased_cost=None, cost_year=None, cost_func=None, target_year=2024, erection_factor=None, piping_factor=None, instrumentation_factor=None, electrical_factor=None, civil_factor=None, structural_factor=None, lagging_factor=None, material_factor=None)[source]¶
Bases:
objectEquipment cost estimation class for process equipment.
Manages cost calculation of process equipment based on process type, material, and equipment parameters. Supports both direct cost input and calculated costs from a cost correlation database.
- process_factors¶
Process type factors affecting cost calculation. Keys are process types (“Solids”, “Fluids”, “Mixed”, “Electrical”). Values are dicts with factors: fer, fp, fi, fel, fc, fs, fl.
- Type:
- material_factors¶
Material type multipliers mapping material names to cost factors (1.0 to 1.7).
- Type:
- Parameters:
name (
str) – Equipment identifier/name.param (
float) – Equipment parameter (size, capacity) for cost correlation lookup.process_type (
str) – Type of process (“Solids”, “Fluids”, “Mixed”, or “Electrical”).category (
str) – Equipment category for database lookup.type (
str | None, optional) – Equipment sub-type for database lookup. Default is None.material (
str, optional) – Material of construction. Default is “Carbon steel”.num_units (
int | None, optional) – Number of identical units. Default is None (set to 1 when purchased_cost is provided).purchased_cost (
float | None, optional) – Direct purchased cost input. If provided, param is ignored. Default is None.cost_year (
int | None, optional) – Year of the purchased_cost quote for inflation adjustment. Default is None.cost_func (
str | None, optional) – Explicit cost correlation key from the database. Default is None (auto-resolved from category/type).target_year (
int, optional) – Target year for inflation adjustment. Default is 2024.erection_factor (
float | None, optional) – Erection factor override. Default is None (use process_type table).piping_factor (
float | None, optional) – Piping factor override. Default is None (use process_type table).instrumentation_factor (
float | None, optional) – Instrumentation & controls factor override. Default is None.electrical_factor (
float | None, optional) – Electrical factor override. Default is None (use process_type table).civil_factor (
float | None, optional) – Civil factor override. Default is None (use process_type table).structural_factor (
float | None, optional) – Structural steel factor override. Default is None (use process_type table).lagging_factor (
float | None, optional) – Lagging & painting factor override. Default is None (use process_type table).material_factor (
float | None, optional) – Material factor override. Default is None (use material table).
- Raises:
ValueError – If process_type or material is not found in the factor dictionaries.
KeyError – If the category/type combination is not found in the database and cost_func is not specified.
Examples
>>> eq = Equipment( ... name="Reactor", ... param=100, ... process_type="Fluids", ... category="Reactor", ... material="304 stainless steel" ... ) >>> print(eq.direct_cost)
- process_factors = {'Electrical': {'fc': 0.2, 'fel': 0.7, 'fer': 0.4, 'fi': 0.7, 'fl': 0.1, 'fp': 0.1, 'fs': 0.1}, 'Fluids': {'fc': 0.3, 'fel': 0.2, 'fer': 0.3, 'fi': 0.3, 'fl': 0.1, 'fp': 0.8, 'fs': 0.2}, 'Mixed': {'fc': 0.3, 'fel': 0.2, 'fer': 0.5, 'fi': 0.3, 'fl': 0.1, 'fp': 0.6, 'fs': 0.2}, 'Solids': {'fc': 0.2, 'fel': 0.15, 'fer': 0.6, 'fi': 0.2, 'fl': 0.05, 'fp': 0.2, 'fs': 0.1}}¶
- material_factors = {'304 stainless steel': 1.3, '316 stainless steel': 1.3, '321 stainless steel': 1.5, 'Aluminum': 1.07, 'Bronze': 1.07, 'Carbon steel': 1.0, 'Cast steel': 1.1, 'Hastelloy C': 1.55, 'Inconel': 1.7, 'Monel': 1.65, 'Nickel': 1.7}¶
Functions
- openpytea.equipment.inflation_adjustment(equipment_cost, cost_year, target_year=2024)[source]¶
Adjust equipment cost from one year to another using the Chemical Engineering Plant Cost Index (CEPCI).
This function uses historical CEPCI values to convert equipment costs between different years, accounting for inflation in the chemical engineering industry.
- Parameters:
- Returns:
The inflation-adjusted equipment cost in target_year (in USD).
- Return type:
- Raises:
ValueError – If cost_year is not found in CEPCI_DF.
ValueError – If target_year is not found in CEPCI_DF.
Notes
The adjustment factor is calculated as: adjusted_cost = equipment_cost * (CEPCI[target_year] / CEPCI[cost_year])
Examples
>>> # Adjust from 2015 to 2023 >>> new_cost = inflation_adjustment(50000, 2015, 2023)
Classes
- class openpytea.equipment.CostCorrelationDB(df= key ... doi / link 0 impeller_mixer_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 1 kneader_blender_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 2 propeller_mixer_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 3 propeller_mixer_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 4 ribbon_blender_turton_2001 ... https://books.google.nl/books/about/Analysis_S... .. ... ... ... 160 cooling_tower_and_pumps_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 161 packaged_mechanical_refrigerator_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 162 water_ion_exchange_plant_towler_2010 ... doi.org/10.1016/B978-0-12-821179-3.00007-8 163 internal_coils_vaporizers_turton_2001 ... https://books.google.nl/books/about/Analysis_S... 164 jacketed_vessels_vaporizers_turton_2001 ... https://books.google.nl/books/about/Analysis_S... [165 rows x 21 columns])[source]¶
Bases:
objectDatabase interface for equipment cost correlations.
Manages cost estimation correlations for equipment based on size/capacity parameters. Supports multiple correlation forms (power-law, quad log-log) and handles equipment parallelization when capacity limits are exceeded.
- df¶
Cost correlation data with columns: key, category, type, form, s_lower, s_upper, upper_parallel, a, b, n, k1, k2, k3, cost_year.
- Type:
pd.DataFrame
- evaluate(key, s)[source]¶
Calculate purchased equipment cost based on correlation key and size.
- Parameters:
- Returns:
(total_cost, number_of_units, cost_year).
- Return type:
tuple[float,int,int]- Raises:
KeyError – If correlation key not found in database.
ValueError – If size is below the lower bound or the correlation form is unsupported.
- class openpytea.equipment.Equipment(name, param, process_type, category, type=None, material='Carbon steel', num_units=None, purchased_cost=None, cost_year=None, cost_func=None, target_year=2024, erection_factor=None, piping_factor=None, instrumentation_factor=None, electrical_factor=None, civil_factor=None, structural_factor=None, lagging_factor=None, material_factor=None)[source]¶
Bases:
objectEquipment cost estimation class for process equipment.
Manages cost calculation of process equipment based on process type, material, and equipment parameters. Supports both direct cost input and calculated costs from a cost correlation database.
- process_factors¶
Process type factors affecting cost calculation. Keys are process types (“Solids”, “Fluids”, “Mixed”, “Electrical”). Values are dicts with factors: fer, fp, fi, fel, fc, fs, fl.
- Type:
- material_factors¶
Material type multipliers mapping material names to cost factors (1.0 to 1.7).
- Type:
- Parameters:
name (
str) – Equipment identifier/name.param (
float) – Equipment parameter (size, capacity) for cost correlation lookup.process_type (
str) – Type of process (“Solids”, “Fluids”, “Mixed”, or “Electrical”).category (
str) – Equipment category for database lookup.type (
str | None, optional) – Equipment sub-type for database lookup. Default is None.material (
str, optional) – Material of construction. Default is “Carbon steel”.num_units (
int | None, optional) – Number of identical units. Default is None (set to 1 when purchased_cost is provided).purchased_cost (
float | None, optional) – Direct purchased cost input. If provided, param is ignored. Default is None.cost_year (
int | None, optional) – Year of the purchased_cost quote for inflation adjustment. Default is None.cost_func (
str | None, optional) – Explicit cost correlation key from the database. Default is None (auto-resolved from category/type).target_year (
int, optional) – Target year for inflation adjustment. Default is 2024.erection_factor (
float | None, optional) – Erection factor override. Default is None (use process_type table).piping_factor (
float | None, optional) – Piping factor override. Default is None (use process_type table).instrumentation_factor (
float | None, optional) – Instrumentation & controls factor override. Default is None.electrical_factor (
float | None, optional) – Electrical factor override. Default is None (use process_type table).civil_factor (
float | None, optional) – Civil factor override. Default is None (use process_type table).structural_factor (
float | None, optional) – Structural steel factor override. Default is None (use process_type table).lagging_factor (
float | None, optional) – Lagging & painting factor override. Default is None (use process_type table).material_factor (
float | None, optional) – Material factor override. Default is None (use material table).
- Raises:
ValueError – If process_type or material is not found in the factor dictionaries.
KeyError – If the category/type combination is not found in the database and cost_func is not specified.
Examples
>>> eq = Equipment( ... name="Reactor", ... param=100, ... process_type="Fluids", ... category="Reactor", ... material="304 stainless steel" ... ) >>> print(eq.direct_cost)
- process_factors = {'Electrical': {'fc': 0.2, 'fel': 0.7, 'fer': 0.4, 'fi': 0.7, 'fl': 0.1, 'fp': 0.1, 'fs': 0.1}, 'Fluids': {'fc': 0.3, 'fel': 0.2, 'fer': 0.3, 'fi': 0.3, 'fl': 0.1, 'fp': 0.8, 'fs': 0.2}, 'Mixed': {'fc': 0.3, 'fel': 0.2, 'fer': 0.5, 'fi': 0.3, 'fl': 0.1, 'fp': 0.6, 'fs': 0.2}, 'Solids': {'fc': 0.2, 'fel': 0.15, 'fer': 0.6, 'fi': 0.2, 'fl': 0.05, 'fp': 0.2, 'fs': 0.1}}¶
- material_factors = {'304 stainless steel': 1.3, '316 stainless steel': 1.3, '321 stainless steel': 1.5, 'Aluminum': 1.07, 'Bronze': 1.07, 'Carbon steel': 1.0, 'Cast steel': 1.1, 'Hastelloy C': 1.55, 'Inconel': 1.7, 'Monel': 1.65, 'Nickel': 1.7}¶