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

add wet coil model based on epsilon-NTU approach #622

Closed
mwetter opened this issue Jan 10, 2017 · 10 comments
Closed

add wet coil model based on epsilon-NTU approach #622

mwetter opened this issue Jan 10, 2017 · 10 comments
Assignees

Comments

@mwetter
Copy link
Member

mwetter commented Jan 10, 2017

No description provided.

@mwetter mwetter self-assigned this Jan 10, 2017
@mwetter
Copy link
Member Author

mwetter commented Mar 21, 2017

Items to do before merging to master

  • Update reference results so that we don't introduce a new error when revising the model.
  • Add revision notes
  • Add info and revision notes to examples
  • Remove numerical Jacobians (use Hidden.PrintFailureToDifferentiate = true; for debugging)
  • Delete BaseClasses.effCalc and use BaseClasses.epsilon_ntuZ instead. Note that the newly introduced heat exchanger configurations CrossFlowStream1MixedStream2Unmixed and CrossFlowStream1UnmixedStream2Mixed are the same as the existing ones CrossFlowCMinUnmixedCMaxMixed and CrossFlowCMinMixedCMaxUnmixed.
  • mwetter Check why DUMMY is used.
  • WetCalcs is not differentiable
  • Profiling of WetCoilEffNtuMassFlow (with Advanced.GenerateTimers=true) shows that a large part of the computation is spent in the new function TSat_ph which includes its own solver. Maybe this can be refactored to use not a function but rather equations, and let the tool solve the nonlinear equation.
  • mwetter to insert in VAVReheat model to compare computing time.
  • mwetter: remove non-differentiability in WetCalcs and DryCalcs.
  • add flow reversal treatment and a test that verifies that the results are the same if the flow reverses the direction
  • verify why Buildings.Fluid.HeatExchangers.Examples.WetCoilCounterFlowMassFlow has a large sensible heat ratio while WetCoilEffNtuMassFlow has a small one.
  • Make most instances in the coil protected.
  • Add the following variables to WetEffectivenessNTU model: QSen, QLat, mWat_flow, SHR?, QTot?

@michael-okeefe
Copy link
Collaborator

Updated the items listed above. Performance of the model is similar to the WetCoilCounterFlow model. I've added quite a bit of documentation to the models and cleaned up the commits to remove models/functions I'm no longer using.

@michael-okeefe
Copy link
Collaborator

Note: I've pulled/merged in the branch issue622_wet_coil_base_class_refactor directly and also merged the pull request of the same name so we can probably delete the issue622_wet_coil_base_class_refactor branch at some point.

@mwetter
Copy link
Member Author

mwetter commented Apr 17, 2017 via email

@michael-okeefe
Copy link
Collaborator

I should have committed and pushed up from the remaining TODO items assigned to me. I just repushed a few minutes ago to correct an issue where a new Example I added (to test reverse flow) was not in alphabetical order. I need to switch to another project right now but don't hesitate to reach out to me if you have any questions or comments or would like to discuss further. Thank you!

@mwetter
Copy link
Member Author

mwetter commented Apr 18, 2017

@michael-okeefe : Thanks, I will work on it today.

@AntoineGautier
Copy link
Contributor

AntoineGautier commented Dec 11, 2019

@kim1077 I have pushed the new branch issue622_wet_coil_refactor_2_fuzzy which:

Based on our last discussion I start here a list of things to do:

  • Update the fuzzy logic implementation to support simulation in heating mode.
  • The model uses smoothMax to guard against zero flow rate when computing Z=CMin/CMax and NTU=UA/CMin. This is likely the cause of the simulation error (too high heat flow rate for the actual mass flow rate).
  • The exposed parameter is currently UA_nominal. This must be changed in favor of temperature and humidity nominal values as in Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU.

Please tell me which parts you will handle and I will work on the remaining ones.

@AntoineGautier
Copy link
Contributor

AntoineGautier commented May 29, 2020

@kim1077

The Newton solver convergence issues in Buildings.Fluid.HeatExchangers.Examples.WetCoilEffNtuMassFlowFuzzy_V2_2 are likely due to the transition to NTU(Sta) = 0 and eps(Sta) = 1 at low flow rates as implemented in DryCalcsFuzzy_V2_2 and WetcalcsFuzzy_V2_2, which seems to yield a discontinuity in eps(Sta). With Dymola 2020x, the transition to fixed point iterating solves the issue. With Dymola 2021 the simulation fails with the error

Fixed point iterating to handle problem.
Previous problem occured when evaluating crossing function, reducing step-size
cvode: CVODE cvRcheck3 At t = 2102.95, the rootfinding routine failed in an unrecoverable manner.
Unexpected value: -12 at time 2102.4

Could you consider a similar approach as in epsilon_C function with an additional smooth gain to regularize NTU? I implemented this here for DryCalcsFuzzy_V2_2 and WetcalcsFuzzy_V2_2 and it solved the issue.

I think we should consider converting DryCalcsFuzzy_V2_2, WetcalcsFuzzy_V2_2 and ParcalcsFuzzy_V2_2 into functions that we could call to compute UA_nominal based on temperature and humidity nominal values. We indeed need to compute the nominal sensible heat flow rate for that, which we cannot do with the current model implementation.

I cannot remember which validation model led to initialization issues. I did not notice any issue anymore but you may have solved it already?

EDIT: I ran some additional testing in https://github.com/AntoineGautier/modelica-buildings/tree/issue622_wet_coil_refactor_3_ang. I used the NTU regularization described before as simulations fail otherwise. I still get a lot of non convergence errors when simulating the models Buildings.Applications.DHC.Loads.Examples.CouplingSpawnZ6Wet and Buildings.Applications.DHC.Loads.Examples.CouplingTimeSeriesWet. For the latter, here is the comparison of the simulation statistics for a one year simulation when using

  • Buildings.Fluid.HeatExchangers.DryCoilEffectivenessNTU
Integration terminated successfully at T = 3.1536e+07
   CPU-time for integration                  : 5.487 seconds
   CPU-time for initialization               : 0.00416493 seconds
   Number of result points                   : 8772
   Number of grid points                     : 8761
   Number of accepted steps                  : 191690
   Number of rejected steps                  : 20723
   Number of f-evaluations (dynamics)        : 309373
   Number of non-linear iteration            : 309345
   Number of non-linear convergence failures : 802
   Number of Jacobian-evaluations            : 6982
   Number of crossing function evaluations   : 200523
   Number of model time events               : 2
   Number of state events                    : 4
   Number of step events                     : 0
  • Buildings.Fluid.HeatExchangers.WetEffectivenessNTU_Fuzzy_V2_2
Fixed point iterating to handle problem.
Integration terminated successfully at T = 3.1536e+07
   CPU-time for integration                  : 11.3251 seconds
   CPU-time for initialization               : 0.00607491 seconds
   Number of result points                   : 8772
   Number of grid points                     : 8761
   Number of accepted steps                  : 196000
   Number of rejected steps                  : 20963
   Number of f-evaluations (dynamics)        : 315440
   Number of non-linear iteration            : 315409
   Number of non-linear convergence failures : 878
   Number of Jacobian-evaluations            : 7272
   Number of crossing function evaluations   : 204824
   Number of model time events               : 2
   Number of state events                    : 4
   Number of step events                     : 0

@kim1077
Copy link
Contributor

kim1077 commented May 29, 2020 via email

@AntoineGautier
Copy link
Contributor

For reference, the computation of the specific heat capacity for air and water does not take into account the flow direction. This is a workaround for a bug in Dymola, see attached bug report.
bug_cp.pdf
The variable always corresponds to the entering fluid according to the design flow direction.
Note that the computation of the effective capacity to represent the wet regime is based on the enthalpy and is not impacted by this simplification.
Once Dymola bug is fixed the equations can be rewritten as follows.

  Modelica.Blocks.Sources.RealExpression cp_a1Exp(
    final y = if allowFlowReversal1
    then
      fra_a1 * Medium1.specificHeatCapacityCp(state_a1_inflow)
      + fra_b1 * Medium1.specificHeatCapacityCp(state_b1_inflow)
    else
      Medium1.specificHeatCapacityCp(state_a1_inflow))
    "Expression for cp of air"

  Modelica.Blocks.Sources.RealExpression cp_a2Exp(
    final y = if allowFlowReversal2
    then
      fra_a2 * Medium2.specificHeatCapacityCp(state_a2_inflow)
      + fra_b2 * Medium2.specificHeatCapacityCp(state_b2_inflow)
    else
      Medium2.specificHeatCapacityCp(state_a2_inflow))
    "Specific heat capacity at port a2"

AntoineGautier added a commit that referenced this issue Apr 14, 2021
This is a workaround for a bug in Dymola, see #622 (comment)
mwetter added a commit that referenced this issue Apr 20, 2021
* Added dryFra as a public variable

* Add validation in heating

* Compute cp from entering fluid, update results

This is a workaround for a bug in Dymola, see #622 (comment)

* Update parameter binding

* Updated release notes for new cooling coil model

Co-authored-by: dkim1077 <[email protected]>
Co-authored-by: Michael Wetter <[email protected]>
@mwetter mwetter closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants