Thermostats With Settings for Heat That You Can Change
A thermostat is a device that senses the temperature of a system and uses this data to command the system's heaters, or coolers, to keep the temperature close to a desired setpoint. While there are many dissimilar types of thermostats, we volition focus today on i that turns a heater either on or off based upon two setpoints. This is known equally an on-off or a bang-bang controller, and it tin can exist implemented with the Events interface in COMSOL Multiphysics.
How Thermostats Work
Let'southward consider a thermostat like to the i that you have in your dwelling house. Although at that place are many different types of thermostats, nearly of them use the aforementioned control scheme: A sensor that monitors temperature is placed somewhere inside the system, usually some altitude abroad from the heater. When the sensed temperature falls below a desired lower setpoint, the thermostat switches the heater on. As the temperature rises above a desired upper setpoint, the thermostat switches the heater off. This is known every bit a blindside-bang controller. In practice, you typically only have a single setpoint, and there is an offset, or lag, which is used to ascertain the upper and lower setpoints.
The objective of having different upper and lower setpoints is to minimize the switching of the heater land. If the upper and lower setpoints are the same, the thermostat would constantly be cycling the heater, which can pb to premature component failure. If y'all do want to implement such a control, you simply need to know the current temperature of the sensor. This can exist modeled in COMSOL Multiphysics quite easily, every bit nosotros have highlighted in this previous blog postal service.
On the other hand, the blindside-bang controller is a bit more circuitous since information technology does demand to know something almost the history of the organization; the heater changes its country as the temperature rises above or beneath the setpoints. In other words, the controller provides hysteresis. In COMSOL Multiphysics, this tin be implemented using the Events interface.
Using the Events Interface to Control a Heater
When using COMSOL Multiphysics to solve time-dependent models, the Events interface is used to stop the fourth dimension-stepping algorithms at a item indicate and offering the possibility of changing the values of variables. The times at which these events occur tin be specified either explicitly or implicitly. An explicit event should exist used when we know the bespeak in fourth dimension when something virtually the system changes. We've previously written about this topic on the blog in the context of modeling a periodic heat load. An implicit issue, on the other mitt, occurs at an unknown point in time and thus requires a bit more fix-up. Permit's have a look at how this is done inside the context of the thermal model shown beneath.
Sketch of the thermal organization under consideration.
Consider a uncomplicated thermal model of a lab-on-a-chip device modeled in a 2d plane. A i millimeter thick drinking glass slide has a heater on i side and a temperature sensor on the other. Nosotros volition treat the heater as a 1W estrus load distributed beyond part of the bottom surface, and we will assume that there is a very pocket-sized, thermally insignificant temperature sensor on the meridian surface. At that place is also free convective cooling from the top of the slide to the surroundings, which is modeled with a heat flux boundary status. The system is initially at 20°C, and we want to keep the sensor between 45°C and 55°C.
A Component Coupling is used to define the Variable, T_s, the sensor temperature.
The kickoff thing we need to practice — before using the Events interface — is ascertain the temperature at the sensor signal via an Integration Component Coupling and a Variable, as shown to a higher place. The reason why this is done is to brand the temperature at this point, T_s, available within the Events interface.
The Events interface itself is added similar any other physics interface inside COMSOL Multiphysics. It is available inside the Mathematics > ODE and DAE interfaces branch.
The Discrete States interface is used to define the state of the heater. Initially, the heater is on.
First, we use the Events interface to define a fix of discrete variables, variables which are discontinuous in time. These are advisable for modeling on/off atmospheric condition, as we take here. The Discrete States interface shown above defines a variable, HeaterState, which is multiplied by the applied estrus load in the Heat Transfer in Solids problem. The variable can be either 1 or zero, depending upon the system's temperature history. The initial status is one, significant we are starting our simulation with the heater on. It is important that nosotros set the advisable initial condition here. Information technology is this HeaterState variable that will be changed depending upon the sensor temperature during the simulation.
Ii Indicator States in the Events interface depend upon the sensor temperature.
To trigger a alter in the HeaterState variable, we need to commencement introduce 2 Indicator States. The objective of the Indicator States is to define variables that volition bespeak when an event will occur. There are ii indicator variables defined. The Up indicator variable is defined as:
T_s - 55[degC]
which goes smoothly from negative to positive as the sensor temperature rises above 55°C. Similarly, the Downwards indicator variable will go smoothly from negative to positive at 45°C. We will want to trigger a change in the HeaterState variable as these indicator variables change sign.
The HeaterState variable is reinitialized within the Events interface.
We employ the Implicit Events interface, since we practice non know ahead of time when these events volition occur, but nosotros do know under what conditions we want to change the land of the heater. Every bit shown above, ii Implicit Event features are used to reinitialize the country of the heater to either zero or i, depending upon when the Upward and Down indicator variables become greater than or less than cipher, respectively. The event is triggered when the logical condition becomes true. Once this happens, the transient solver will stop and restart with the newly initialized HeaterState variable, which is used to control the applied heat, equally illustrated beneath.
The HeaterState variable controls the applied oestrus.
When solving this model, we can make some changes to the solver settings to ensure that we accept proficient accurateness and keep only the virtually of import results. We will want to solve this model for a total time of 30 minutes, and we will store the results only at the fourth dimension steps that the solver takes. These settings are depicted below.
The study settings for the Time-Dependent Solver set the total solution time from 0-30 minutes, with a relative tolerance of 0.001.
Nosotros volition need to brand some changes inside the settings for the Time-Dependent Solver. These changes can exist made prior to the solution past first right-clicking on the Study branch, choosing "Show Default Solver", and then making the two changes shown below.
Modifications to the default solver settings. The outcome tolerance is changed to 0.001 and the output times to store are set up to the steps taken by the solver.
Of course, as with any finite element simulation, nosotros will want to study the convergence of the solution every bit the mesh is refined and the solver tolerances are fabricated tighter. Representative simulation results are highlighted beneath and demonstrate how the sensor temperature is kept between the upper and lower setpoints. Too, observe that the solver takes smaller time steps immediately afterward each issue, just larger time steps when the solution varies gradually.
The heater switches on and off to keep the sensor temperature between the setpoints.
Summary
We have demonstrated here how implicit events tin be used to stop and restart the solver as well equally modify variables that control the model. This enables u.s.a. to model systems with hysteresis, such every bit thermostats, and perform simulations with minimal computational cost.
Source: https://www.comsol.com/blogs/implementing-a-thermostat-with-the-events-interface/
0 Response to "Thermostats With Settings for Heat That You Can Change"
Post a Comment