Differential Equations
SaunaModel relies on the excellent DifferentialEquations.jl to solve the sauna state. One particular challenge of modelling a sauna is the jump condition of throwing steam. DifferentialEquations handled it beautifully with a VariableRateJump
problem. The ordinary differential equation part of the problem is described in build_sauna_model
.
SaunaModel.build_sauna_model
— Function.build_sauna_model(du, u, scenario, raw_time)
describes how the system evolves smoothly through time (not including steam throwing) This is fed to the ODESolver of Differential Equations. The first argument is the derivative, and must be updated to match how the system is evolving. There are many interactions, driven by radiance, convection, conduction, advection, and phase change.
The jump problem posed by steam throwing is handled by throw_steam!
.
SaunaModel.throw_steam!
— Function.throw_steam!(integrator)
gets its argument integerator from DifferentialEquations It updates the current mass of water that is on the stove, and adjusts the average temperature of water on the stove accordingly.
The rate of steam throwing is determined by steam_throwing
.
SaunaModel.steam_throwing
— Function.steam_throwing(u,p,t)
u, p, and t are inputs from the Differential Equations solver. u is the state, p is the solution paramenters, and t is the time. The steam throwing rate is determined by if the experinced temperature is higher than the cutoff to start taking steam.
Relations used
There are 6 differential equations modelling sauna dynamics. 4 of them are temperature (stove, air, room, thrown water), 1 of them is room humidity, and 1 is the mass of unboiled water that was thrown on the stove. There is also a jump step, which causes steam to be thrown. The mass of water suddenly increases on the stove, and rebalances the average temperature of the thrown water.
Interaction | Fire | Stove | Air | Room | Thrown water | Human (not interacting) |
---|---|---|---|---|---|---|
Fire | - | Convection and | ||||
Radiation | - | - | - | - | ||
Stove | - | - | Convection | Radiation | Convection | Radiation |
Air | - | - | Convection | Phase Change | Convection Phase Change | |
Room | - | - | - | - | Radiation |