Skip to content

Conversation

@MarcusHolly
Copy link
Contributor

Summary/Motivation:

The cost methods are missing from most of the documentation

Changes proposed in this PR:

  • Adds costing method to documentation
  • Modifies names of costing variables that are too ambiguous

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@MarcusHolly MarcusHolly self-assigned this Dec 18, 2025
@MarcusHolly MarcusHolly added the documentation Improvements or additions to documentation label Dec 18, 2025

def build_caoh2_cost_param_block(blk):
blk.cost = pyo.Param(
blk.CaOH2_cost = pyo.Param(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious what inspired these changes to make cost more specific

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly just personal preference - I thought it was a bit too ambiguous. There also wasn't any consistency as to what cost meant. In some scenarios, it referred to unit model costs and in others it referred to chemical costs. Evidently, this name change has resulted in some test failures that I need to fix. Now, unit costs should be consistently called unit_cost and chemical costs called chemical_cost

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In reality, it probably wasn't too problematic since I believe it will usually be paired with the corresponding docstring

Copy link
Contributor

@adam-a-a adam-a-a Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcusHolly I wonder if we should just use unit_cost across the board. For chemicals, $ / kg cost is technically a unit cost. Any cost per unit of quantity can be rendered a unit_cost. For pumps, unit_cost would be something like $/W, and so on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this - thanks for the suggestion

m.fs.costing.reverse_osmosis.membrane_cost.fix(30)
m.fs.costing.reverse_osmosis.high_pressure_membrane_cost.fix(50)
m.fs.costing.high_pressure_pump.cost.fix(53 / 1e5 * 3600)
m.fs.costing.high_pressure_pump.unit_cost.fix(53 / 1e5 * 3600)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adam-a-a The best argument for updating the cost names is to make code more intuitive when flowsheets are updating the values of these variables.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose unit_cost across the board so that is clear that the cost is in $ per some quantity, as opposed to some absolute cost.

@ksbeattie ksbeattie added the Priority:High High Priority Issue or PR label Dec 18, 2025

"Membrane replacement factor", ":math:`f_{replace}`", "``factor_membrane_replacement``", "0.2", ":math:`\text{yr}^{-1}`"
"Membrane cost", ":math:`C_{mem}`", "``membrane_unit_cost``", "56", ":math:`\text{USD}_{2018}\text{/m}^2`"
"Membrane cost", ":math:`C_{mem}`", "``membrane_cost``", "56", ":math:`\text{USD}_{2018}\text{/m}^2`"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should instances of membrane_cost also be replaced with unit_cost?

Comment on lines 20 to 22
"**CaOH2 mixer** (cost method = `cost_caoh2_mixer`)"
"Mixer unit cost", ":math:`C_{mix, CaOH2}`", "``unit_cost``", "873.911", ":math:`\text{USD}_{2018}\text{/kg/day}`"
"CaOH2 cost", ":math:`C_{CaOH2}`", "``CaOH2_cost``", "0.12", ":math:`\text{USD}_{2018}\text{/kg}`"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should we handle this? Call the unit model cost and the chemical cost unit_COST ?

Copy link
Contributor

@adam-a-a adam-a-a Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh-- another alternative can be unit_cost_CaOH2 or basically unit_cost appended or prepended with the specific item name (e.g., unit_cost_pump, unit_cost_antiscalant).

We should also probably check IDAES costing and try to be as consistent as we can across projects. For example, if IDAES already uses some convention for these sorts of costs (and the naming isn't too cryptic), we can use that convention.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick skim, I don't think there's an IDAES convention for these sorts of costs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Priority:High High Priority Issue or PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants