CAFO Footprint Simulator - business-as-usual material, nitrogen, carbon and water footprints of concentrated animal feeding operations, by the W2R lab at the Technion
Graph engine for context assembly. Object-storage native. Agents work with graph data the way engineers work with code: branched, typed, reviewed, merged, audited, and governed.
Busabase is an open-source (MIT) database and workspace for AI agents — data, docs, skills, and apps in one place. Run it locally, self-host it inside your network, or use Busabase Cloud, and turn age
AI data analyst for transparent, reproducible analysis. Works step by step in Python, verifies the evidence behind its reports, and supports a wide selection of models, including local open-weight mod
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Organization repository · verify with a repository file
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Loading the full README. The saved excerpt is shown below.
A browser tool for estimating the annual inputs, outputs and greenhouse-gas emissions of a
concentrated animal feeding operation (CAFO) run as business as usual (BAU).
You choose the operation type and farm size. The tool estimates:
A browser tool for estimating the annual inputs, outputs and greenhouse-gas emissions of a
concentrated animal feeding operation (CAFO) run as business as usual (BAU).
You choose the operation type and farm size. The tool estimates:
Inputs: feed (as fed, dry matter, crude protein), drinking and service water, electricity, diesel, LPG and purchased animals
Outputs: products (milk, eggs, live weight), mortalities, manure (wet mass, TS, VS, N), wastewater and gaseous emissions
Emissions (CO2 equivalent): enteric CH4, manure CH4, manure N2O (direct and indirect), N2O from land application, feed production, fuels, electricity and water supply
Water footprint: green, blue and grey water (Water Footprint Network method) from feed crops, on-farm water use and manure nitrate leaching
Material-flow (MFA) diagrams: whole-farm mass, nitrogen, carbon and water flows drawn as Sankey diagrams
How it works
Opening page. The first screen is kept visual: a large live counter of global livestock greenhouse-gas emissions since local midnight (FAO GLEAM 3: about 6.2 Gt CO2 equivalent per year, or about 196 t per second) and a Start the simulator button. Supporting numbers sit on icon cards that flip over when tapped, and the notes and references open from the ⓘ icon. The counter covers all livestock supply chains, because there is no reliable worldwide estimate for CAFOs alone. Change GLOBAL_CLOCK in js/data.js if a CAFO-only figure becomes available.
Animal category. Select one of 7 CAFO types.
Farm size. Set the number of animal places with the slider, the presets or by typing a number. A scale shows where the farm falls against the US EPA Small / Medium / Large CAFO thresholds.
Manure management and climate. Choose the manure system (the BAU default is tagged) and the climate.
Energy and system boundary. Choose the electricity grid, which emission sources to include (feed production, manure land application) and the GWP set.
Calculate. An animated Sankey diagram appears, with four perspectives:
Material flows: feed, water and animals in; products, manure, wastewater and respiration out
Nitrogen balance: feed N through the herd and manure to air, water and soil
Carbon footprint: emission sources → GHG Protocol scopes → total CO₂ equivalent, plus a breakdown by source
Water footprint: feed crops, drinking water, service water and manure nitrate → green / blue / grey → total, plus an inventory table
Saving figures. On a computer, Save PDF creates an A4 landscape sheet: a header with the W2R Lab badge, lab details and link, and the Technion logo, the figure, scenario, key numbers, notes, and a dated footer. Save JPEG saves the same sheet as an image. On a phone, Save to gallery creates a JPEG and opens the share sheet, where "Save Image" adds it to the photo gallery. The W2R badge and Technion logo are loaded from w2r-lab.vercel.app, and PDFs use jsPDF from cdnjs.
The results screen shows one headline number, the Sankey diagram and three icon cards with the other key numbers (tap to flip). The ⓘ icon on the diagram shows how it is calculated. The detailed data opens in a side sheet from the icons under the diagram: the inventory or emissions breakdown table, Assumptions (edit every coefficient; results update immediately) and Methods & sources (each calculation step and its references). Clicking any citation opens its reference.
Open index.html in any modern browser. There is no build step and no server. The only external resource is the Figtree web font; without internet the page falls back to the system font.
Edited assumptions are stored in the browser's localStorage.
Model check from the command line (Node ≥ 18):
node tests/sanity.js
Operation types
Type
Size unit
BAU manure system
Functional unit
Dairy cows
mature cows
uncovered anaerobic lagoon
kg FPCM
Beef feedlot
head capacity
open dry lot
kg LW gain
Swine finishing
pig spaces
deep pit (> 1 month)
kg LW gain
Swine sow farm
sows
deep pit (> 1 month)
kg weaned piglet
Broiler chickens
bird places
poultry litter
kg LW gain
Laying hens
hen places
high-rise / manure belt
kg eggs
Turkeys
bird places
poultry litter
kg LW gain
Farm size is also classified against the US EPA CAFO thresholds (40 CFR 122.23).
Project layout
index.html page markup and the in-app "Methods" section
css/styles.css styles (light and dark themes, W2R Lab palette)
js/data.js all default coefficients and their sources <- edit defaults here
js/model.js calculation engine (pure functions; runs in browser and Node)
js/charts.js emission bar chart and Sankey renderer (no libraries)
js/icons.js inline line-icon set (Lucide-style SVG)
js/export.js branded PDF / JPEG export of the current figure
js/app.js UI wiring, assumptions editor, CSV export
tests/sanity.js runs every operation type and checks mass/N balances
scripts/generate-docs.js regenerates docs/CAFO-Footprint-Simulator.md
docs/CAFO-Footprint-Simulator.md full technical documentation (methods, all defaults, results, references)
Method summary
The model works on one animal place for one year, then multiplies by the number of places.
Herd dynamics. Dairy and sow herds are continuous (replacement, mortality, yield per head).
Batch systems use cycles = 365 / (days on farm + downtime) and live animal-days
= 365 × occupancy × (1 − mortality/2). For growers, DMI = FCR × average daily gain.
Manure CH4 (eq. 10.23): VS × Bo × 0.67 × MCF(system, climate).
N excretion:Nex = DMI × CP/6.25 − N retained. N retained is the N in milk, eggs and net live-weight change.
Manure N2O: direct Nex × EF3; indirect via FracGasMS × EF4 and FracLeachMS × EF5.
N left after FracLossMS is land-applied, giving direct N2O (EF1) plus indirect N2O (FracGASM, FracLEACH).
Energy and water: activity × emission factor (grid, diesel, LPG and water supply).
Water footprint: feed green/blue/grey = DMI (t DM) × ration crop water footprint (m³/t DM). On-farm blue = drinking + service water. Manure grey = nitrate-N leached in storage and fields ÷ 10 mg N/L (natural background 0).
GWP100: AR6 by default (CH4 27, N2O 273). AR5 and AR4 can be selected.
Mass balance: feed + water + purchased animals − (products + mortalities + manure + wastewater).
The remainder is reported as respiration (CO2 and water vapour) plus evaporation.
Sources
Every default value carries a source tag in the app (Advanced settings) and in the CSV export:
✔ From source: copied from the cited document.
≈ Approximated: derived or rounded from the cited document. Check it against the original table before publishing.
✎ Assumption: the model author's estimate of a typical US BAU value. Replace it with site data.
Source of each coefficient group
Coefficients
Source
Equations (enteric CH4, VS, manure CH4, N2O, N excretion)
[12, 13] assumption — Indicative value within published feed LCA ranges; excludes land-use change
Diesel and LPG emission factors
[8] from source — Combustion CO2, converted from per-gallon to per-litre
Water-supply emission factor
assumption — Pumping & treatment energy assumption
Feed water footprint (green, blue, grey)
[19] assumption — Ration-weighted from global-average crop water footprints of maize, soybean and wheat (per t DM); forage assumed 400 / 50 / 50 m³/t DM
Grey-water nitrate limit (10 mg N/L)
[21] from source
Grid factor, United States avg. (0.37 kg CO2 equivalent/kWh)
References
IPCC (2019). 2019 Refinement to the 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Vol. 4: Agriculture, Forestry and Other Land Use — Ch. 10 "Emissions from Livestock and Manure Management" and Ch. 11 "N2O Emissions from Managed Soils, and CO2 Emissions from Lime and Urea Application". Calvo Buendia, E., Tanabe, K., Kranjc, A., Baasansuren, J., Fukuda, M., Ngarize, S., Osako, A., Pyrozhenko, Y., Shermanau, P. & Federici, S. (eds). IPCC, Switzerland. https://www.ipcc-nggip.iges.or.jp/public/2019rf/vol4.html
IPCC (2006). 2006 IPCC Guidelines for National Greenhouse Gas Inventories. Vol. 4: Agriculture, Forestry and Other Land Use, Ch. 10 "Emissions from Livestock and Manure Management" (incl. Annex 10A.2). Eggleston, H.S., Buendia, L., Miwa, K., Ngara, T. & Tanabe, K. (eds). IGES, Japan. https://www.ipcc-nggip.iges.or.jp/public/2006gl/vol4.html
Forster, P. et al. (2021). The Earth’s Energy Budget, Climate Feedbacks, and Climate Sensitivity. In: Climate Change 2021: The Physical Science Basis. Contribution of Working Group I to the Sixth Assessment Report of the IPCC. Cambridge University Press. Table 7.15 (GWP100: CH4 non-fossil 27.0, N2O 273). https://www.ipcc.ch/report/ar6/wg1/
Myhre, G. et al. (2013). Anthropogenic and Natural Radiative Forcing. In: Climate Change 2013: The Physical Science Basis. Contribution of Working Group I to the Fifth Assessment Report of the IPCC. Cambridge University Press. Table 8.7 (GWP100: CH4 28, N2O 265). https://www.ipcc.ch/report/ar5/wg1/
Forster, P. et al. (2007). Changes in Atmospheric Constituents and in Radiative Forcing. In: Climate Change 2007: The Physical Science Basis. Contribution of Working Group I to the Fourth Assessment Report of the IPCC. Cambridge University Press. Table 2.14 (GWP100: CH4 25, N2O 298). https://www.ipcc.ch/report/ar4/wg1/
ASABE (2005, reaffirmed). ASAE D384.2: Manure Production and Characteristics. American Society of Agricultural and Biological Engineers, St. Joseph, MI.
The defaults are indicative and need checking. The IPCC-derived values (Ym, Bo, MCF, EF3, Frac*)
are approximations of the IPCC 2019 Refinement tables. Production, water and energy values are
typical US BAU assumptions. For publication, check each value against the original tables and
your country's inventory, or replace it with site data. Use the Assumptions panel to edit them.
Boundary: cradle to farm gate for the CAFO stage only. Upstream animal rearing (heifers,
nursery, hatchery, cow-calf), bedding, buildings, carcass disposal, manure transport and
land-use change are excluded.
No co-product allocation. All emissions go to the functional unit. A per-kg-protein figure
covering all products is also shown.
Manure system: one system per farm receives all excreted manure. Solid separation and
mixed systems are not modelled.
BAU scope: mitigation options (digesters, covers, additives) are deliberately not included.
This keeps BAU as the clean baseline for later comparison with mitigation scenarios.
US EPA. Emissions & Generation Resource Integrated Database (eGRID) — US national average output emission rate. https://www.epa.gov/egrid
European Environment Agency. Greenhouse gas emission intensity of electricity generation in Europe (indicator).
WRI & WBCSD (2004). The Greenhouse Gas Protocol: A Corporate Accounting and Reporting Standard, revised edition (Scope 1/2/3 definitions). https://ghgprotocol.org/corporate-standard
Gerber, P.J., Steinfeld, H., Henderson, B., Mottet, A., Opio, C., Dijkman, J., Falcucci, A. & Tempio, G. (2013). Tackling climate change through livestock — A global assessment of emissions and mitigation opportunities. FAO, Rome (GLEAM results).
Vellinga, Th.V., Blonk, H., Marinussen, M., van Zeist, W.J., de Boer, I.J.M. & Starmans, D. (2013). Methodology used in FeedPrint: a tool quantifying greenhouse gas emissions of feed production and utilization. Wageningen UR Livestock Research, Report 674.
International Dairy Federation (2022). The IDF global Carbon Footprint standard for the dairy sector. Bulletin of the IDF No. 520/2022 (fat- and protein-corrected milk as functional unit).
Jones, D.B. (1931). Factors for converting percentages of nitrogen in foods and feeds into percentages of proteins. USDA Circular No. 183 (N × 6.25; milk N × 6.38).
USDA National Agricultural Statistics Service. Milk Production; Poultry — Production and Value; Quarterly Hogs and Pigs; Cattle on Feed (orientation for typical US production levels only). https://www.nass.usda.gov/
USDA Agricultural Research Service. FoodData Central — Egg, whole, raw, fresh (protein ≈ 12–13 %). https://fdc.nal.usda.gov/
Hoekstra, A.Y., Chapagain, A.K., Aldaya, M.M. & Mekonnen, M.M. (2011). The Water Footprint Assessment Manual: Setting the Global Standard. Earthscan, London (green, blue and grey water footprint definitions).
Mekonnen, M.M. & Hoekstra, A.Y. (2011). The green, blue and grey water footprint of crops and derived crop products. Hydrology and Earth System Sciences 15, 1577–1600 (global averages, e.g. maize ≈ 1,222 m³/t; soybean ≈ 2,145 m³/t; wheat ≈ 1,827 m³/t).
Mekonnen, M.M. & Hoekstra, A.Y. (2012). A global assessment of the water footprint of farm animal products. Ecosystems 15, 401–415 (benchmark product water footprints by production system).
Franke, N.A., Boyacioglu, H. & Hoekstra, A.Y. (2013). Grey water footprint accounting: Tier 1 supporting guidelines. Value of Water Research Report Series No. 65, UNESCO-IHE, Delft (grey WF = pollutant load ÷ (c_max − c_nat)).
FAO (2023). Pathways towards lower emissions — A global assessment of the greenhouse gas emissions and mitigation options from livestock agrifood systems. Food and Agriculture Organization of the United Nations, Rome (GLEAM 3: livestock supply chains ≈ 6.2 Gt CO2 equivalent in 2015, ≈ 12 % of anthropogenic emissions).
United Nations Environment Programme & Climate and Clean Air Coalition (2021). Global Methane Assessment: Benefits and Costs of Mitigating Methane Emissions. UNEP, Nairobi (livestock ≈ 32 % of anthropogenic methane).