Modeling and Simulation Case Studies | JuliaHub

Improved HVAC Diagnostics - JuliaSim Case Study

Written by MERL | Jul 9, 2024 7:09:55 AM

First Principles HVAC Modeling and Scientific Machine Learning Provide Improved Diagnostic Capabilities

About Mitsubishi Electric Research Laboratories (MERL):

Mitsubishi Electric Research Laboratories (MERL) stands as the US-based research and development arm of Mitsubishi Electric Corporation. MERL conducts application-motivated basic research and advanced development in: Physical Modelling & Simulation,
Signal Processing, Control, Optimization, and Artificial Intelligence. MERL is an open lab We are an open lab, publishing our results, collaborating with the world-wide research community, and measuring our performance by the impact we have on Mitsubishi Electric and the world. This case study focuses on estimating the quantity of refrigerant in vapor-compression cycles used in air-conditioners or heat pumps, highlighting recent advancements and developments in these areas.

Use Case

Estimates of the quantity of refrigerant contained inside a vapor-compression cycle, as used in common air-conditioners or heat pumps, are valuable for a few distinct reasons.  First, the amount of refrigerant in a cycle affects its overall performance; insufficient refrigerant may result in the inability to provide adequate cooling or heating capabilities, while an excessive amount of refrigerant may result in excessive electrical power consumption.  Second, such information is needed by methods that assess and manage the environmental impact of refrigerants, which can have a climate impact between 100x and 2000x greater than CO2.  These considerations thus motivate the pursuit of methods to gain insights into this practical system information.

Unfortunately, the only direct means by which the total refrigerant mass may be measured involves its complete removal from a given unit of equipment for the purposes of weighing it.  This practice is quite disruptive to the system operation, and the invasive nature of this process represents its own risks for refrigerant release.  Methods to estimate the total quantity of refrigerant in the system using less invasive methods are therefore quite attractive.
                 

 A Schematic of a Vapor Compression Cycle [1,2,3]

State estimation methods provide one path to obtaining key insights into system operation using readily available measurements.  These methods effectively relate quantities that can be directly measured (e.g., temperatures and pressures) to quantities that cannot be directly measured (e.g., refrigerant mass) by using a mathematical model of the system under study.  This is accomplished by applying measurements of the system inputs to the inputs of the mathematical model, and then comparing model outputs to the measured system outputs.  Discrepancies between the measured and simulated model outputs are subsequently used to adjust the model so that the model predictions remain close to the measured data.  With a well-designed state estimator, the corrected model can then be used to predict other unmeasurable quantities of interest, such as refrigerant mass. 

One powerful tool for representing one for creating high-accuracy physics-based models of vapor-compression cycles is the Modelica language, which enables the methodical equation-based construction of large, complex system models from a set of component models with a correct mathematical structure.  Existing Modelica tools can manage the challenging numerics of the sets of hybrid differential algebraic equations that describe this equipment, with direction-switching fluid flows, conjugate heat transfer processes, and complex multiphysics behavior.  

While many Modelica tools have useful capabilities that may be used for advanced simulation and control design, they are not well-suited for use in the state estimation context.  Whereas state estimation techniques often require the computation of large sensitivity matrices at each solver step for numerically stiff systems, the monolithic nature of many Modelica compilers prevents such information from being accessed by the user.  Moreover, other numerical programming languages that would otherwise be candidates for implementing state estimators, such as Python, are not suited to equation-based system descriptions, and do not have solvers that can accurately and quickly solve the nonlinear differential algebraic equations that are encountered in the description of vapor-compression cycles.

A Novel state estimation method in JuliaSim correctly determines pipe lengths and refrigerant mass [2]

The ModelingToolkit package and JuliaSim compiler provided MERL with a path to implementing state estimators based on equation-oriented models in the fully-featured scientific programming language of Julia.  The process of implementing those models using ModelingToolkit was relatively straightforward due to the similar designs of ModelingToolkit and Modelica, and these models simulated accurately and quickly because ModelingToolkit is integrated with the high-quality differential equation solvers in the SciML ecosystem.  As it is now possible to interact with the internals of these solvers, we were able to obtain the sensitivity information needed to implement state estimators and make further improvements needed for high-dimensional system models.  In addition, the automatic differentiation capabilities enabled by this connection to Julia provide more accurate estimates of the Jacobian than are possible with standard numerical approximations.  More details of this theoretical work are provided in the referenced publications.

We evaluated these state estimation methods on a simulation of a relatively small model of a vapor-compression cycle implemented in ModelingToolkit, with 278 equations, and found that they worked quite well.  Refrigerant mass estimates generated by these methods differed from the reference mass used in the simulation with less than 2% error by using a limited number of temperature and pressure sensors, despite variations in the actuator inputs (compressor or fan speed) or driving conditions (heat load, inlet air temperature).  These methods have significant promise to provide new diagnostic capabilities for practical equipment, and we are looking forward to further advances in our research that are enabled by the new opportunities provided by JuliaSim.

About Christopher R. Laughman

Christopher R. Laughman received the S.B. and M.Eng. degrees in electrical engineering and computer science and the Ph.D. degree in architecture from the Massachusetts Institute of Technology, Cambridge, MA, USA, in 1999, 2001, and 2008, respectively.,He has been with Mitsubishi Electric Research Laboratories, Cambridge, since 2008, where he currently holds the position of a Senior Principal Research Scientist and is the Senior Team Leader of the Multiphysical Systems Team. His research interests include the modeling, simulation, control, and optimization of large-scale multiphysical systems, with an emphasis on multiphase thermofluid applications.

References: 

  1. Laughman, C.R., Deshpande, V.M., Qiao, H., Bortoff, S.A., Chakrabarty, A., "Digital Twins for Vapor Compression Cycles: Challenges & Opportunities", International Congress of Refrigeration (ICR), August 2023.
  2. Deshpande, V.M., Laughman, C.R., "Multi-pass Extended Kalman Smoother with Partially-known Constraints for Estimation of Vapor Compression Cycles", World Congress of the International Federation of Automatic Control (IFAC), July 2023.  https://ifac.papercept.net/conferences/conferences/IFAC23/program/IFAC23_ContentListWeb_3.html
  3. V. M. Deshpande, C. R. Laughman, Y. Ma and C. Rackauckas, "Constrained Smoothers for State Estimation of Vapor Compression Cycles," 2022 American Control Conference (ACC), Atlanta, GA, USA, 2022, pp. 2333-2340, doi: 10.23919/ACC53348.2022.9867269U