Cellar calculations
How the BrewForge cellar works out stay dates, free vessels, packaging volumes and loss, estimated beer in a brew, empty containers, stock totals, keg scale litres and timeline colours.
The cellar does little maths, but the rules behind it decide what you see as free, full or left over. All volumes are stored in millilitres and shown in litres rounded to 0.1 L.
Stay dates
A stay runs from its start day up to, but not including, its end day: [Starts on, Leaves on).
- Planned:
Starts on > today - Finished:
Leaves on ≤ today - Now: everything else, including stays that run Until freed (no end day)
Because the end day is excluded, a stay leaving on 15 Nov and the next one starting on 15 Nov hand over without overlapping. A stay that runs until freed overlaps every later day.
Days left in a current stay are Leaves on − today in whole days. "Today" is your local calendar day, not the server's.
Free now, free soon, needs you
Start at today and walk through the vessel's stays that aren't finished, oldest first. When a stay starts after the current day, the vessel is free on that day. Otherwise jump to the stay's end day. A stay that runs until freed means no free day.
The free window lasts until the next stay starts. Example: a fermenter whose stay ends on 2 Nov and whose next stay starts on 9 Nov is free 2 Nov–9 Nov · 7 days.
- Free now: no current stay today. If a stay is planned, the chip shows until its start day.
- Free soon: busy today, and the next free day is at most 14 days away.
- Needs you: a serving stay that runs until freed, is current, and has a known volume below 1 L (1000 ml). Kegs with an unknown volume are never flagged.
Overlaps and pushing
- A vessel never holds two overlapping stays.
- A brew is never in two fermenting or conditioning stays at once. Serving stays (kegs) of the same brew don't clash with its tank stays.
- Push following stays too moves later stays back by the overlap, only as far as needed, along the same vessel and along the same brew's later stays, and repeats until nothing overlaps. Stays that have started never move, and a stay that runs until freed in the way makes pushing impossible.
- A new stay that overlaps is blocked, never pushed.
Packaging
kegs = Σ litres per keg
bottles & cans = Σ (count × container volume in L)
packaged = kegs + bottles & cans
left = available − (packaged + loss)
Example: 24 L in a fermenter, one keg with 5 L, 38 × 0.5 L bottles, no loss → 5 + 19 = 24 L packaged, 0 L left.
- Rest as loss sets
loss = max(0, available − packaged). - When the source is marked empty, a difference of 0.5 L or more warns: positive means litres not accounted for, negative means more packaged than recorded (or estimated).
- When the source is not marked empty, a tank keeps
max(0, left)litres. Taking more than it holds is blocked. - A keg can't be filled above its capacity. More bottles than
owned − fullonly warns. - New target rows are prefilled: a keg with
min(keg size, left)(a full keg if nothing is left), bottles withfloor(left × 1000 / container volume in ml). - An emptied tank stay ends today, so the vessel is free today. A stay that only started today ends tomorrow, because a stay lasts at least one day.
estimate = fermenter volume − fermenter loss
The fermenter volume is the measured one once you've entered it, otherwise the planned volume from the brew's water plan. The fermenter loss comes from the brew's equipment. Example: 23 L in the fermenter, 1.5 L fermenter loss → 21.5 L to package. This is the same volume the brew page uses for bottling. It's marked (est.) and you can overwrite it.
Stock
empty = owned − Σ count of all stock lines in this container
Negative means more are full than you own: a shortage that warns but never blocks packaging.
total = Σ litres left in serving kegs + Σ (count × container volume)
Unknown keg volumes count as 0.
- A pour (−0.5 L, −1 L, Custom…) subtracts from the keg and never goes below 0 L. A keg at 0 L is not freed.
- Typed litres are rounded to 0.1 L and clamped to
0 … keg capacity. Typed counts must be whole numbers.
litres = (weight in kg − empty weight in kg) / FG
FG is the brew's final gravity as shown for the brew (measured, imported or calculated); external beer and brews without an FG use 1.010. The result is clamped to 0 … keg capacity. Example: (24.8 − 5.0) / 1.012 = 19.6 L. Volume sensors report litres directly. More in Keg sensors.
Timeline colours
A bar's colour is the beer's colour, calculated from the recipe's fermentables (SRM). External beer and brews without fermentables use a neutral grey. Very dark beers are lightened and very pale ones darkened just enough to stay visible on light and dark backgrounds (relative luminance kept between 0.1 and 0.5); the hue stays the same.
Calendar
With Vessels checked in the Filter menu of the calendar, each stretch a beer spends in a vessel becomes an "occupied" event on its first day and a "free" event on its end day. Back-to-back stays of the same beer in the same vessel (fermenting, then conditioning) count as one stretch. Stays that run until freed have no "free" event.