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

Heat exchange models #183

Merged
merged 34 commits into from Dec 19, 2023
Merged

Heat exchange models #183

merged 34 commits into from Dec 19, 2023

Conversation

spahrenk
Copy link
Contributor

@spahrenk spahrenk commented Nov 20, 2023

Description

  • In this PR, the form Model refers to a manufacturer product; model refers to a physics representation.
  • This code simulates heat-exchange HPWH Models (AquaThermAire), in which tank fluid (currently water) remains isolated from a delivered-water line. A simple heat-exchange model was implemented for initial testing. Assigning the flag hasHeatExchanger as true applies this model. The model assumes heat transfer from each tank node to the inlet water line using an effectiveness coefficient (heatExchangerEffectiveness). This process is repeated for each node upward, in sequence. However, the initial AquaThermAire Model preset and file use a single node, so this model has not been directly tested.
  • One additional test schedule (villara_24hr67) has been added. This is run for the AquaThermAire Model preset and file. No regression test is performed for this Model, lacking an accepted output file for comparison. Test profile was changed to convert degF to degC and DR flag was changed to unlock condenser. Passes all HPWH and cse tests.

Author Progress Checklist:

  • Open draft pull request
    • Make title clearly understandable in a standalone change log context
    • Assign yourself the issue
    • Add at least one label (enhancement, bug, or maintenance)
    • Link the issue(s) addressed by this PR (under "Development" in the sidebar menu)
  • Make code changes (if you haven't already)
  • Self-review of code
    • My code follows the style guidelines of this project
    • I have added comments to my code, particularly in hard-to-understand areas
    • I have only committed the necessary changes for this fix or feature
    • I have made corresponding changes to the documentation
    • My changes generate no new warnings
    • I have ensured that my fix is effective or that my feature works as intended by:
      • exercising the code changes in the test framework, and/or
      • manually verifying the changes (as explained in the the pull request description above)
    • My changes pass all local tests
    • My changes successfully passes CI checks
    • Add any unit test for proof and documentation.
    • Merge in main branch and address resulting conflicts and/or test failures.
  • Move pull request out of draft mode and assign reviewers
  • [] Iterate with reviewers until all changes are approved
    • Make changes in response to reviewer comments
    • Merge in main branch and address resulting conflicts and/or test failures.
    • Re-request review in GitHub

Reviewer Checklist:

  • Read the pull request description
  • Perform a code review on GitHub
  • Confirm all CI checks pass and there are no build warnings
  • Pull, build, and run automated tests locally
  • Perform manual tests of the fix or feature locally
  • Add any review comments, if applicable
  • Submit review in GitHub as either
    • Request changes, or
    • Approve
  • Iterate with author until all changes are approved

@spahrenk spahrenk self-assigned this Nov 20, 2023
@spahrenk spahrenk mentioned this pull request Nov 27, 2023
33 tasks
@spahrenk spahrenk changed the title Heat exchange Models - moved from fork Heat exchange models Nov 27, 2023
@@ -515,7 +515,7 @@ int HPWH::HPWHinit_presets(MODELS presetNum) {

else if (presetNum == MODELS_StorageTank) {
setNumNodes(12);
setpoint_C = F_TO_C(127.0);
setpoint_C = 800.;
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be changing on this branch, and will likely cause conflicts when master is merged in.

@@ -0,0 +1,71 @@
verbosity silent
numNodes 1 #number of nodes
Copy link
Member

Choose a reason for hiding this comment

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

Change to 12?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

volume 54.4 gal
UA 10.35 kJperHrC
depressTemp false
mixOnDraw true
Copy link
Member

Choose a reason for hiding this comment

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

This should be false, the draw doesn't go into the tank at all, and it shouldn't cause any mixing of the water.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@spahrenk
Copy link
Contributor Author

Added function bottomTwelfth_absolute. Fixed function topThird_absolute (seems to be unused.)

@spahrenk
Copy link
Contributor Author

This is a primitive solution using the existing method to read hpwh spec files. Can improve with generalized-logic-node method (forthcoming).

src/HPWH.cc Outdated
@@ -63,6 +63,10 @@ const double HPWH::MAXOUTLET_R410A = F_TO_C(140.);
const double HPWH::MAXOUTLET_R744 = F_TO_C(190.);
const double HPWH::MINSINGLEPASSLIFT = dF_TO_dC(15.);

double makeC(const double T_F_or_C,const HPWH::UNITS units,const bool absolute){
Copy link
Member

Choose a reason for hiding this comment

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

This can probably be inline, no?

The name is also not very descriptive. Maybe convertTempToC?

src/HPWH.cc Outdated
Comment on lines 1813 to 1816
std::shared_ptr<HPWH::TempBasedHeatingLogic> HPWH::bottomTwelfth_absolute(double decisionPoint) {
std::vector<NodeWeight> nodeWeights = getNodeWeightRange(0., 1./12.);
return std::make_shared<HPWH::TempBasedHeatingLogic>("bottom twelfth",nodeWeights,decisionPoint,this,true);
}
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed anymore.

heatsource 0 minT -25 F
heatsource 0 maxT 125 F
heatsource 0 hysteresis 1 F
heatsource 0 coilConfig wrapped
Copy link
Member

Choose a reason for hiding this comment

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

Should probably be "submerged" based on conversations with Ben. What impact will this have on the simulation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapped and submerged use different heat distributions. Simulation results are slightly altered.

@nealkruis nealkruis merged commit 58dd30b into master Dec 19, 2023
2 checks passed
@nealkruis nealkruis deleted the heat-exchange-models branch December 19, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants