Allow upwinding in 1D Heat exchanger#1383
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1383 +/- ##
=======================================
Coverage 77.62% 77.63%
=======================================
Files 391 391
Lines 64375 64380 +5
Branches 14257 14261 +4
=======================================
+ Hits 49973 49979 +6
- Misses 11830 11835 +5
+ Partials 2572 2566 -6 ☔ View full report in Codecov by Sentry. |
bpaul4
left a comment
There was a problem hiding this comment.
Everything looks good, @dallan-keylogic.
andrewlee94
left a comment
There was a problem hiding this comment.
A lot of comments ,but most are really minor.
Regarding the level of logger messages, I can see why you put them at "warning" level, but I think we should reserve that for cases where something is going wrong, and not places where we are using default settings.
| set_direction_hot = FlowDirection.forward | ||
| set_direction_cold = FlowDirection.forward | ||
| if self.config.hot_side.transformation_method is useDefault: | ||
| _log.warning( |
There was a problem hiding this comment.
Should this be a warning level message? I am of two minds, but I think this would be better as info.
There was a problem hiding this comment.
This was originally a warning-level message before my proposed revisions. I'd be happy to downgrade it to "Caution" or "Info".
There was a problem hiding this comment.
Maybe make it a caution then - it is definitely not a warning but probably warrants more than info.
| ) | ||
| self.config.hot_side.transformation_method = "dae.finite_difference" | ||
| if self.config.cold_side.transformation_method is useDefault: | ||
| _log.warning( |
| self.config.hot_side.transformation_scheme is useDefault | ||
| or self.config.cold_side.transformation_scheme is useDefault | ||
| ): | ||
| raise ConfigurationError( |
There was a problem hiding this comment.
Minor comment, but should we have a default here? I vaguely recall that one of the collocation schemes had a bug too.
There was a problem hiding this comment.
Perhaps. Originally I wanted the user to assume full responsibility for using collocation, but since we need it for energy conservation in upwind schemes I might make "LAGRANGE-RADAU" the default. I should test it out on "LAGRANGE-LEGENDRE" as well, because that's the one that potentially has a bug in it; it creates additional continuity equations about the values of the function between finite elements, and I can easily see that it fails to do so correctly when flow is moving from 1 to 0.
There was a problem hiding this comment.
My vague recollection is the it was Lagrange-Legendre that had the possible bug. If so - we should make Lagrange-Radau the default.
There was a problem hiding this comment.
Is there an issue for this bug with Lagrange-Legendre?
There was a problem hiding this comment.
@blnicho @andrewlee94 It appears to work just fine for the HeatExchanger1D in counter-current mode, and, furthermore, both methods return the same answers for outlet temperatures.
| f"For {side}, a {bad_scheme} scheme was chosen to discretize the length domain. " | ||
| f"However, this scheme is not an upwind scheme for {flow_config} flow, and " | ||
| f"as a result may run into numerical stability issues. To avoid this, " | ||
| f"use a {good_scheme} scheme (which may result into energy conservation issues " |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1383 +/- ##
=======================================
Coverage 77.89% 77.89%
=======================================
Files 394 394
Lines 65053 65063 +10
Branches 14383 14387 +4
=======================================
+ Hits 50670 50679 +9
- Misses 11793 11798 +5
+ Partials 2590 2586 -4 ☔ View full report in Codecov by Sentry. |
| CRITICAL = logging.CRITICAL # 50 | ||
| ERROR = logging.ERROR # 40 | ||
| WARNING = logging.WARNING # 30 | ||
| CAUTION = 25 |
There was a problem hiding this comment.
I originally wondered if it would just be better to use INFO_LOW for the "cautions" rather than add additional logger levels, however the naming of the INFO levels is somewhat counter-intuitive (named by amount of output rather than importance). In that sense, I think I am actually inclined to keep CAUTION as being more intuitive.
|
@dallan-keylogic It looks like some tests are failing due to numerical diagnostics checks (possibly due to merging the near parallel constraint check into the main diagnostics toolbox). |
|
@lbianchi-lbl @ksbeattie Punting this was unsuccessful. Codecov demands its pound of flesh. |
It looks like the jobs on our side (i.e. the only thing we have control over) are passing: The reason why the required checks don't show up is on Codecov's side. Unfortunately, there's not much we can do other than maybe trying to re-run the CI (using |

Summary/Motivation:
Breaks off the changes to the
HeatExchanger1Dfrom #1382 into their own PRChanges proposed in this PR:
HeatExchanger1DLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: