Foam Application
Quick Start
Knowing your foam application rate, application time, diameter of the test tank and foam expansion ratio, it's handy to know the theoretical thickness of foam covering the fuel and a few other parameters.
Credits
The app is part of the work of the LASTFIRE team working towards improved on-site knowledge of foam properties relevant to fighting fires.
Foam Application
//One universal basic required here to get things going once loaded
window.onload = function () {
//restoreDefaultValues(); //Un-comment this if you want to start with defaults
Main();
};
//Any global variables go here
//Main is hard wired as THE place to start calculating when input changes
//It does no calculations itself, it merely sets them up, sends off variables, gets results and, if necessary, plots them.
function Main() {
saveSettings();
//Send all the inputs as a structured object
//If you need to convert to, say, SI units, do it here!
const inputs = {
Rate: sliders.SlideRate.value,
E: sliders.SlideExpansion.value,
tmax: sliders.Slidetmax.value,
D: sliders.SlideD.value,
BubbleD: sliders.SlideBubbleD.value/1000, //μm to mm
}
//Send inputs off to CalcIt where the names are instantly available
//Get all the resonses as an object, result
const result = CalcIt(inputs)
//Set all the text box outputs
document.getElementById('Depth').value = result.Depth
document.getElementById('Bubbles').value = result.Bubbles
document.getElementById('Area').value = result.Area
document.getElementById('Volume').value = result.Volume
document.getElementById('VolumeF').value = result.VolumeF
document.getElementById('Pump').value = result.Pump
//Do all relevant plots by calling plotIt - if there's no plot, nothing happens
//plotIt is part of the app infrastructure in app.new.js
if (result.plots) {
for (let i = 0; i < result.plots.length; i++) {
plotIt(result.plots[i], result.canvas[i]);
}
}
//You might have some other stuff to do here, but for most apps that's it for CalcIt!
}
//Here's the app calculation
//The inputs are just the names provided - their order in the curly brackets is unimportant!
//By convention the input values are provided with the correct units within Main
function CalcIt({ Rate, E, D, tmax, BubbleD }) {
let HPlot = [], t=0, h=0
const Area=Math.PI*(D/2)**2
const Volume=Area*Rate*tmax
const VolumeF=Volume*E
for (t=0; t<=tmax; t+=0.1){
h=t*Rate*E
HPlot.push({x:t,y:h})
}
h=tmax*Rate*E
HPlot.push({x:tmax,y:h})
const Bubbles=h/BubbleD
const Pump=Rate*Area
//Now set up all the graphing data detail by detail.
let plotData = [HPlot]
let lineLabels = ["h cm"] //An array of labels for each dataset
const prmap = {
plotData: plotData,
lineLabels: lineLabels,
hideLegend: true,
xLabel: "t& min", //Label for the x axis, with an & to separate the units
yLabel: "h& mm", //Label for the y axis, with an & to separate the units
y2Label: undefined, //Label for the y2 axis, null if not needed
yAxisL1R2: [], //Array to say which axis each dataset goes on. Blank=Left=1
logX: false, //Is the x-axis in log form?
xTicks: undefined, //We can define a tick function if we're being fancy
logY: false, //Is the y-axis in log form?
yTicks: undefined, //We can define a tick function if we're being fancy
legendPosition: 'top', //Where we want the legend - top, bottom, left, right
xMinMax: [0,], //Set min and max, e.g. [-10,100], leave one or both blank for auto
yMinMax: [0,], //Set min and max, e.g. [-10,100], leave one or both blank for auto
y2MinMax: [,], //Set min and max, e.g. [-10,100], leave one or both blank for auto
xSigFigs: 'F2', //These are the sig figs for the Tooltip readout. A wide choice!
ySigFigs: 'F1', //F for Fixed, P for Precision, E for exponential
};
//Now we return everything - text boxes, plot and the name of the canvas, which is 'canvas' for a single plot
return {
Area: Area.toFixed(1),
Depth: h.toFixed(0),
Bubbles: Bubbles.toFixed(0),
Volume: Volume.toFixed(1),
VolumeF: VolumeF.toFixed(0),
Pump: Pump.toFixed(1),
plots: [prmap],
canvas: ['canvas'],
};
}
It's simple
The calculations are simple, but it's nice to have all relevant values in one place. You know what your application rate should be for a test, you measure your expansion ratio, you know the size of your test tank. So what thickness of foam would float on the surface if none was destroyed - your theoretical maximum. And how many bubbles does that represent - the more bubbles the more barrier to fuel migration. [If you don't know your bubble size, you should! See Bubble Size]. And what's the pool area, and actual pump rate and the total volume of the foam solutions pumped and the foam created?
Although we could add a "foam temperature" slider which could then be used to calculate the expansion from heating, the effect is relatively small (15% for a 30 °C increase in temperature).
One more measure
You've put out the fire. Now measure the thickness of foam floating on the fuel. How? That's tricky. But assuming you can measure it, you can compare with the theoretical amount and see how much has been lost by the combined effects of heat as the foam flies through the flames, and destruction of the foam via contact with the fuel. This "fraction of foam remaining" is not typically reported in the literature, but it is arguably an important parameter.