|
The ThermalMass pattern computes the temperature of a mass depending on the amount of heat affecting the mass. For example, the air in a room is a thermal mass, and also walls or layers may be seen as a thermal mass.
Simulation thermischer Masse [RIE96] ( http://wwwagz.informatik.uni-kl.de/projects/SFB501/D1/PSiGene/publications.shtml#Rie96.0 ).
A volume has to act as a thermal mass to compute its temperature. This pattern works on the assumption that the temperature is always the same in every spot inside a thermal mass. Usually, rooms of a building are modelled as thermal masses. But also walls, ceilings and floors may act as a thermal mass. Decisive for a thermal mass is it stores a specific amount of heat, and (probably) delivers this heat to its surroundings. Exchange of heat between single masses can be direct (see ThermalExchange ) or indirect (via layers, see ThermalConnection ).
This pattern can be bound to any thermal mass. Typical this is a room or a thick wall. But also a night-storage heater may be modelled as a thermal mass. An important property of a mass is its ability to store a specific amount of heat. This storage ability depends on the specific heat capacity of the material (or gas) the mass consists of, and its volume. Additionally the amount of heat flowing into or from the mass must be known or calculable.
The computation relies on the calculation of the amount of heat flowing into or out of the mass. Usually these are: the amount of heat caused by transmission (through walls etc.), the amount of heat caused by radiation (radiators and sunlight), and direct exchange of heat (e.g., open windows). All influencing amounts of heat have to be modelled separately.
On application the volume and the heat capacity of the mass must be known. On binding to a model-class all influencing elements must exist. Usually, the depending objects will be bound to the thermal mass via an Indirection Pattern (SimpleIndirection , ComplexIndirection , etc.).
self {amountOfHeat}: (self {temperature} * self {volume} * self {getHeatCapacity}). self {timeOfLastComputation}: Scheduler simSched simMillisecondClockValue.
| heatCapacity collectedHeatFlows timeNow | timeNow:= Scheduler simSched simMillisecondClockValue. heatCapacity := self {getHeatCapacity}. collectedHeatFlows := self {getHeatFlowsFor}: self. self {calculateTemperature}WithCapacity: heatCapacity withHeatFlows: collectedHeatFlows while: ((timeNow - self {timeOfLastComputation}) / 1000). self {timeOfLastComputation}: timeNow.
withHeatFlows: heatFlows while: passedTime self {amountOfHeat}: (self {amountOfHeat} + (heatFlows * passedTime)). self {temperature}: (self {amountOfHeat} / (self {volume} * capacity)).
Pattern ThermalMass Category simulation ObjectType use target Attribute use temperature Attribute use amountOfHeat Attribute use volume Attribute use preset timeOfLastComputation SingleMethod implement preset init SingleMethod implement compute SingleMethod implement preset calculateTemperature SingleMethod use getHeatCapacity SingleMethod use getHeatFlowFor End