Skip to content
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

Crossflow hx #1382

Merged
merged 46 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
5782077
add unit models
dallan-keylogic Feb 21, 2024
db31552
edits
dallan-keylogic Feb 22, 2024
cde84b7
changes
dallan-keylogic Mar 8, 2024
1bc0ea7
Code cleaning
dallan-keylogic Mar 12, 2024
65b3863
Fix initialization
dallan-keylogic Mar 12, 2024
d9405f8
Begin adding tests
dallan-keylogic Mar 12, 2024
693305f
changes
dallan-keylogic Mar 12, 2024
a2fe413
test units
dallan-keylogic Mar 15, 2024
a30edf6
fix pressure drop unit issue
dallan-keylogic Mar 15, 2024
1c03d23
Moving towards heater testing
dallan-keylogic Mar 19, 2024
599ae34
move changes from other branch
dallan-keylogic Mar 20, 2024
5b6f6ce
Merge branch 'main' into crossflow_hx
dallan-keylogic Mar 20, 2024
50d5fd9
format remaining file
dallan-keylogic Mar 20, 2024
52e67b6
separate 1d hx changes
dallan-keylogic Mar 22, 2024
d08267d
Merge branch 'main' into crossflow_hx
dallan-keylogic Mar 22, 2024
c9b86da
Fix pylint errors
dallan-keylogic Mar 22, 2024
4a0f9aa
more pylint issues
dallan-keylogic Mar 22, 2024
e440cc5
remove elevation change
dallan-keylogic Apr 1, 2024
57d1e87
run black
dallan-keylogic Apr 1, 2024
659de32
get rid of commented code
dallan-keylogic Apr 3, 2024
44f0345
Merge branch 'main' into crossflow_hx
dallan-keylogic Apr 4, 2024
bcde9a3
Fix typo
dallan-keylogic Apr 4, 2024
f78413a
Merge branch 'nu_xflow' into crossflow_hx
dallan-keylogic Apr 4, 2024
09e6b31
Merge branch 'main' into crossflow_hx
dallan-keylogic Apr 4, 2024
37d3edf
At Andrew's insistence, make methods public
dallan-keylogic Apr 12, 2024
622762a
address more of Andrew's comments
dallan-keylogic Apr 12, 2024
eb1fc30
Merge branch 'main' into crossflow_hx
dallan-keylogic Apr 12, 2024
2514cfb
Update initialization to new form
dallan-keylogic Apr 15, 2024
c721eb5
documentation
dallan-keylogic Apr 16, 2024
04153e5
Documentation in progress
dallan-keylogic Apr 16, 2024
ff75476
Merge branch 'xflow_hx' into crossflow_hx
dallan-keylogic Apr 16, 2024
53c3849
remove debugging
dallan-keylogic Apr 16, 2024
e8068b7
Documentation
dallan-keylogic Apr 17, 2024
b2af3c9
pitch
dallan-keylogic Apr 18, 2024
4e6af02
Merge branch 'main' into crossflow_hx
dallan-keylogic Apr 18, 2024
ad4dddf
polishing step
dallan-keylogic Apr 18, 2024
74c5e73
run black
dallan-keylogic Apr 18, 2024
dd3afc7
new black version
dallan-keylogic Apr 18, 2024
ac64869
culling common
dallan-keylogic Apr 18, 2024
bf82efd
Docstrings and merges
dallan-keylogic Apr 19, 2024
3c34674
spelling
dallan-keylogic Apr 19, 2024
864695f
pylint
dallan-keylogic Apr 19, 2024
4ffcc52
more Andrew suggestions
dallan-keylogic Apr 22, 2024
10e46fa
run Black
dallan-keylogic Apr 22, 2024
18a7f36
pylint
dallan-keylogic Apr 22, 2024
29c4a88
no more values
dallan-keylogic Apr 22, 2024
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
96 changes: 51 additions & 45 deletions idaes/models/unit_models/heat_exchanger_1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,39 +430,62 @@ def build(self):

# Set flow directions for the control volume blocks and specify
# discretization if not specified.
if self.config.flow_type == HeatExchangerFlowPattern.cocurrent:
set_direction_hot = FlowDirection.forward
set_direction_cold = FlowDirection.forward
if self.config.hot_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the hot side of the "
"co-current heat exchanger. "
"Defaulting to finite "
"difference method on the hot side."
)
self.config.hot_side.transformation_method = "dae.finite_difference"
if self.config.cold_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the cold side of the "
"co-current heat exchanger. "
"Defaulting to finite "
"difference method on the cold side."
)
self.config.cold_side.transformation_method = "dae.finite_difference"

if (
self.config.hot_side.transformation_method
!= self.config.cold_side.transformation_method
):
dallan-keylogic marked this conversation as resolved.
Show resolved Hide resolved
raise ConfigurationError(
"HeatExchanger1D only supports similar transformation "
"methods on the hot and cold side domains for "
"both cocurrent and countercurrent flow patterns. "
f"Found method {self.config.hot_side.transformation_method} "
f"on hot side and method {self.config.cold_side.transformation_method} "
"on cold side."
)
if self.config.hot_side.transformation_method == "dae.collocation":
if (
self.config.hot_side.transformation_scheme is useDefault
or self.config.cold_side.transformation_scheme is useDefault
):
raise ConfigurationError(
"If a collocation method is used for HeatExchanger1D, the user "
"must specify the transformation scheme they want to use."
)
if (
self.config.hot_side.transformation_method
!= self.config.cold_side.transformation_method
) or (
self.config.hot_side.transformation_scheme
dallan-keylogic marked this conversation as resolved.
Show resolved Hide resolved
!= self.config.cold_side.transformation_scheme
):
raise ConfigurationError(
"If a collocation method is used, "
"HeatExchanger1D only supports similar transformation "
"schemes on the hot and cold side domains for "
"both cocurrent and countercurrent flow patterns."
)
if self.config.hot_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the hot side of the "
"co-current heat exchanger. "
"Defaulting to finite "
"difference method on the hot side."
"schemes on the hot and cold side domains. Found "
f"{self.config.hot_side.transformation_scheme} scheme on "
f"hot side and {self.config.cold_side.transformation_scheme} "
"scheme on cold side."
)
self.config.hot_side.transformation_method = "dae.finite_difference"
if self.config.cold_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the cold side of the "
"co-current heat exchanger. "
"Defaulting to finite "
"difference method on the cold side."
)
self.config.cold_side.transformation_method = "dae.finite_difference"

if self.config.flow_type == HeatExchangerFlowPattern.cocurrent:
set_direction_hot = FlowDirection.forward
set_direction_cold = FlowDirection.forward
if self.config.hot_side.transformation_scheme is useDefault:
_log.warning(
"Discretization scheme was "
Expand All @@ -484,24 +507,6 @@ def build(self):
elif self.config.flow_type == HeatExchangerFlowPattern.countercurrent:
set_direction_hot = FlowDirection.forward
set_direction_cold = FlowDirection.backward
if self.config.hot_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the hot side of the "
"counter-current heat exchanger. "
"Defaulting to finite "
"difference method on the hot side."
)
self.config.hot_side.transformation_method = "dae.finite_difference"
if self.config.cold_side.transformation_method is useDefault:
_log.warning(
"Discretization method was "
"not specified for the cold side of the "
"counter-current heat exchanger. "
"Defaulting to finite "
"difference method on the cold side."
)
self.config.cold_side.transformation_method = "dae.finite_difference"
if self.config.hot_side.transformation_scheme is useDefault:
_log.warning(
"Discretization scheme was "
Expand All @@ -519,7 +524,7 @@ def build(self):
"Defaulting to forward finite "
"difference on the cold side."
)
self.config.cold_side.transformation_scheme = "BACKWARD"
self.config.cold_side.transformation_scheme = "FORWARD"
else:
raise ConfigurationError(
"{} HeatExchanger1D only supports cocurrent and "
Expand Down Expand Up @@ -776,6 +781,7 @@ def initialize_build(
cold_side_units = (
self.cold_side.config.property_package.get_metadata().get_derived_units
)
# TODO What if there is more than one time point? What if t0 != 0?
if duty is None:
duty = value(
0.25
Expand Down
2 changes: 2 additions & 0 deletions idaes/models_extra/power_generation/unit_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
from .boiler_fireside import BoilerFireside
from .boiler_heat_exchanger import BoilerHeatExchanger
from .boiler_heat_exchanger_2D import HeatExchangerCrossFlow2D_Header
from .cross_flow_heat_exchanger_1D import CrossFlowHeatExchanger1D
from .downcomer import Downcomer
from .drum import Drum
from .drum1D import Drum1D
from .feedwater_heater_0D_dynamic import FWH0DDynamic
from .heater_1D import Heater1D
from .heat_exchanger_3streams import HeatExchangerWith3Streams
from .steamheater import SteamHeater
from .waterpipe import WaterPipe
Expand Down
Loading
Loading