Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Adding PFR and StoichiometricReactor Notebook Examples #84

Merged
merged 22 commits into from
Aug 5, 2022

Conversation

bpaul4
Copy link
Contributor

@bpaul4 bpaul4 commented Dec 22, 2021

Fixes # .

Proposed changes:

  • New notebook examples for PFR and StoichiometricReactor unit models and associated index updates

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.

Copy link
Member

@andrewlee94 andrewlee94 left a comment

Choose a reason for hiding this comment

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

I haven't look at the stoichiometric reactor notebook yet, but I am guessing many of the comments for the PFR notebook will apply there too.

notebook_index.yml Outdated Show resolved Hide resolved
src/notebook_index.ipynb Outdated Show resolved Hide resolved
@bpaul4
Copy link
Contributor Author

bpaul4 commented Dec 29, 2021

Thank you @andrewlee94 for your comments, I will review and update all three notebooks for any changes.

@bpaul4
Copy link
Contributor Author

bpaul4 commented Dec 30, 2021

@andrewlee94 I've made the suggested changes in all three rate-reactor notebook examples, including adding the two links. Additionally, I reformulated the initial plug-flow reactor problem which solves correctly now.

Copy link
Member

@andrewlee94 andrewlee94 left a comment

Choose a reason for hiding this comment

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

I did a quick read through of the stoichiometric reactor example this time and only had a few comments. Most of them are imports I don't think you need, plus a couple of things that don't make much sense for a stoichiometric reactor, but were left over from the CSTR/PFR example.

@bpaul4
Copy link
Contributor Author

bpaul4 commented Jan 3, 2022

@andrewlee94 I cleaned up the notebooks and updated the PR

@ksbeattie ksbeattie added the Priority:Normal Normal Priority Issue or PR label Jan 13, 2022
@bpaul4
Copy link
Contributor Author

bpaul4 commented Feb 7, 2022

@MAZamarripa @jghouse88 This PR is awaiting an additional review. Please let me know if you will have time to review this, or if there is another reviewer I may add. Thanks!

src/Examples/UnitModels/Reactors/cstr_testing.ipynb Outdated Show resolved Hide resolved
src/Examples/UnitModels/Reactors/cstr_testing.ipynb Outdated Show resolved Hide resolved
"2021-12-13 13:43:04 [INFO] idaes.init.fs.R101.control_volume.reactions: Initialization Complete.\n",
"2021-12-13 13:43:04 [INFO] idaes.init.fs.R101.control_volume: Initialization Complete\n",
"2021-12-13 13:43:04 [INFO] idaes.init.fs.R101: Initialization Complete: optimal - Optimal Solution Found\n"
"2022-04-13 14:49:03 [INFO] idaes.init.fs.M101.reagent_feed_state: Starting initialization\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I know, we are not supposed to include the output in the notebooks. @andrewlee94 what is the policy on this?

"m.fs.R101.conversion.fix(0.5)\n",
"\n",
"m.fs.R101.heat_duty.setub(0*pyunits.J/pyunits.s) # heat duty is only used for cooling\n",
"\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is an upper bound on heat duty necessary? At first, I thought you were fixing the heat duty, because this is where you are specifying the degrees of freedom. Only after I looked at it carefully, I realized that you are setting an upper bound. If it is not necessary, I suggest you to remove this. But if it is necessary, move the line to a separate cell to avoid confusion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The upper bound is necessary for convergence. I split this line into a separate cell, with text explanation.

"m.fs.R101.heat_duty.setub(0*pyunits.J/pyunits.s) # heat duty is only used for cooling\n",
"\n",
"m.fs.R101.length.fix(1*pyunits.m)"
]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what I'm missing here. The rate of reaction equation requires the volume of the fluid. You are specifying the length here, but I didn't see the cross-sectional area specification anywhere. How is the volume calculated then?

"m.fs.R101.length.unfix()\n",
"m.fs.R101.length.setlb(0*pyunits.m)\n",
"m.fs.R101.length.setub(5*pyunits.m)\n",
"\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

This goes back to my earlier question. From the notebook, it is not clear how the length and the volume are related. Here, you are letting both the volume and length free. It would help if there is an explanation on how these two properties are related.

Copy link
Contributor Author

@bpaul4 bpaul4 May 23, 2022

Choose a reason for hiding this comment

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

To address your questions in this comment and the comment above, reaction extent (conversion), reaction rate (k_rxn) and the reactor volume are interdependent through the performance equation in the thermophysical property paragraph. The performance equation is an internal model constraint. By fixing the conversion and inlet temperature, we determine the required reactor volume. The volume is defined as volume = length*area, and therefore specifying length for our square problem determines the required cross-sectional area.

Copy link
Contributor

@radhakrishnatg radhakrishnatg left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@bpaul4 bpaul4 requested review from andrewlee94 and removed request for andrewlee94, MAZamarripa and jghouse88 July 21, 2022 13:06
@bpaul4 bpaul4 requested review from dallan-keylogic and andrewlee94 and removed request for andrewlee94 August 1, 2022 21:13
Copy link
Member

@andrewlee94 andrewlee94 left a comment

Choose a reason for hiding this comment

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

I only did a quick skim, so I will trust that my prior reviews were sufficient.

@ksbeattie ksbeattie merged commit 19cbb88 into IDAES:main Aug 5, 2022
@bpaul4 bpaul4 deleted the rate-reactor-examples branch August 18, 2023 16:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Priority:Normal Normal Priority Issue or PR
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants