-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new Complementarity formualtion for VLE with cubic EoSs #1397
Merged
Merged
Changes from 10 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a3f141f
Infrastructure work to support SmoothVLE2
ed3734a
Some pylint issues and tests for new cubic EoS functions
851cc3b
Fixing broken tests
251b7f7
Fixing more tests
7997adf
Tests for identify_VL_component_list
83539aa
Testing estimation of bubble and dew points
59e22dd
First unit testing of SmoothVLE2
d76b17d
First running version of code
3555f58
Running example
78d4372
Starting clean up and transition
cf5d515
Merge branch 'main' of https://github.com/IDAES/idaes-pse into smooth…
daf0502
Working on Tsweep test failure
eb72019
Merging main
7ddc023
Trying to debug Tsweep
81d9d26
Catch for non-cubics with SmoothVLE2
f4eb379
Fixing typo
0f0bd72
Merging main
860ad56
Tweaking eps values
92394ee
Fixing T sweep test
65087b6
Fixing some tests
39f1180
Merging main branch
f2b9813
Fixing some pylint issues
47c29bb
Typo
8e424cf
More pylinting
31fba13
More pylint
b27706a
Clean up debugging code
8771323
Fixing final test
8dd941b
Some clean up
55a5074
Merging main branch
f43e3e0
Using logspace
7a0375b
Adding initial docs
b563460
Documenting epsilons
c0a9e18
Fixing test
9d35277
Adjusting default value of epsilon
a98597c
Fixing typo
ad0da43
Merge branch 'main' into smooth_vle2
8b951b8
Fixing pint version issue
cbaf0aa
Addressing comments
0a1c28c
Merge branch 'main' into smooth_vle2
c2a593d
Fixing broken link in docs
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,8 @@ | |
) | ||
from idaes.core.util.exceptions import ConfigurationError, PropertyPackageError | ||
from idaes.models.properties.modular_properties.phase_equil.henry import HenryType | ||
from idaes.models.properties.modular_properties.eos.ceos import Cubic, CubicType | ||
from idaes.models.properties.modular_properties.state_definitions import FTPx | ||
from idaes.core.base.property_meta import UnitSet | ||
from idaes.core.initialization import BlockTriangularizationInitializer | ||
|
||
|
@@ -1955,3 +1957,54 @@ def build_critical_properties(b, *args, **kwargs): | |
"Component declarations.", | ||
): | ||
_initialize_critical_props(m.props[1]) | ||
|
||
|
||
# Invalid property configuration to trigger configuration error | ||
configuration = { | ||
# Specifying components | ||
"components": { | ||
"H2O": { | ||
"type": Component, | ||
"parameter_data": { | ||
"pressure_crit": (220.6e5, pyunits.Pa), | ||
"temperature_crit": (647, pyunits.K), | ||
"omega": 0.344, | ||
}, | ||
}, | ||
}, | ||
# Specifying phases | ||
"phases": { | ||
"Liq": { | ||
"type": LiquidPhase, | ||
"equation_of_state": Cubic, | ||
"equation_of_state_options": {"type": CubicType.PR}, | ||
}, | ||
"Vap": { | ||
"type": VaporPhase, | ||
"equation_of_state": Cubic, | ||
"equation_of_state_options": {"type": CubicType.PR}, | ||
}, | ||
}, | ||
# Set base units of measurement | ||
"base_units": { | ||
"time": pyunits.s, | ||
"length": pyunits.m, | ||
"mass": pyunits.kg, | ||
"amount": pyunits.mol, | ||
"temperature": pyunits.K, | ||
}, | ||
# Specifying state definition | ||
"state_definition": FTPx, | ||
"state_bounds": { | ||
"flow_mol": (0, 100, 1000, pyunits.mol / pyunits.s), | ||
"temperature": (273.15, 300, 500, pyunits.K), | ||
"pressure": (5e4, 1e5, 1e6, pyunits.Pa), | ||
}, | ||
"pressure_ref": (101325, pyunits.Pa), | ||
"temperature_ref": (298.15, pyunits.K), | ||
"parameter_data": { | ||
"PR_kappa": { | ||
("foo", "bar"): 0.000, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why "foo" and "bar"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is None, does the model break or is there a catch for this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just affects whether we can get initial guesses for Teq. Whether the model will solve or not is a separate issue at this point; the goal here is for the code to work without encountering a terminal error.