OpenWQ

BGC Templates Library
Pre-built biogeochemical reaction frameworks for NATIVE_BGC_FLEX and PHREEQC
— ready to use, easy to customize

Contents

• Templates Library Overview

Section 01: Individual Chemicals

• Nitrogen & Phosphorus Templates

• Dissolved Oxygen & Carbon

• Phytoplankton/Algae Dynamics

• Plant Uptake Module

• Emerging Contaminants

• Groundwater Age Tracking

• New Advanced Templates

Section 02: Popular Model Frameworks

• SWAT, QUAL2K, HYPE, WASP8

Section 03: Thermodynamic Templates

• FT Factor Templates

• Redox Ladder

Section 04: PHREEQC Templates

• Equilibrium Templates

• Kinetic Templates (.pqi)

• Template Summary

Templates Library Overview

🧪 NATIVE_BGC_FLEX Templates

JSON-based kinetic reaction frameworks

  • Individual Chemicals — N, P, C, DO, metals
  • Popular Models — SWAT, QUAL2K, HYPE, WASP8
  • Thermodynamic — Redox ladder, diagenesis
  • v2.0 New — Algae, plant uptake, PFAS

⚗️ PHREEQC Templates

Equilibrium + kinetic geochemistry (.pqi)

  • Equilibrium — Major ions, minerals
  • v2.0 Kinetic — DO, algae, plant uptake, ECs
Location:
supporting_scripts/Model_Config/config_support_lib/BGC_templates/

How to Use

  1. Select template(s) for your application
  2. Copy to your project folder
  3. Customize parameters as needed
  4. Reference in master config
Tip: Templates can be merged! Combine species and frameworks from multiple templates.
01

Individual Chemicals

Nitrogen & Phosphorus Templates

nitrogen_simple.json

Basic 3-pool nitrogen cycle

  • NH₄ ↔ NO₃ ↔ N₂
  • Mineralization, nitrification, denitrification
  • Temperature-dependent (Q10)

nitrogen_full.json

Complete N cycle with advanced processes

  • O₂ limitation on all reactions
  • N₂O emissions pathway
  • Plant uptake with seasonal dynamics
  • Immobilization under high C:N

phosphorus_simple.json

Basic 3-pool phosphorus cycle

  • SRP ↔ Organic-P ↔ Particulate-P
  • Mineralization, sorption

phosphorus_full.json

Full P cycle with redox control

  • Fe-bound P release under anoxia
  • Sediment P flux
  • Labile vs refractory pools

Dissolved Oxygen & Carbon v2.0

dissolved_oxygen.json Updated

Complete DO budget with 12 transformations

🌊 Reaeration 4 formulas (Owens, O'Connor-Dobbins...)
🌿 Photosynthesis Steele light model
🔥 BOD decay Fast + slow fractions
⚗️ NOD 4.57 mg O₂/mg NH₄-N
🏔️ SOD Sediment oxygen demand

carbon_organic.json

DOC/POC cycling

  • DOC mineralization → CO₂
  • POC hydrolysis → DOC
  • Photochemical degradation
  • Flocculation (DOC → POC)
DO_BALANCE_SIMPLE — Included framework for Streeter-Phelps screening (3 transformations)
// Reaeration example (O'Connor-Dobbins)
"kinetics": [
  "(ka_20 * 1.024^(T-20)) * (DO_sat - DO)",
  "mg-O2/L/day"
]
                        

Phytoplankton/Algae Dynamics v2.0 NEW

phytoplankton_algae.json

WASP8-style eutrophication model — 11 transformations

ProcessDescription
GrowthLight (Steele) + Nutrient (MM)
N uptakePreferential NH₄, then NO₃
P uptakeRedfield C:N:P = 106:16:1
RespirationTemperature-dependent
MortalityNon-predatory death
SettlingGravitational sinking
GrazingZooplankton (Ivlev model)
8 Chemical Species:
PHYTO, ZOO, Chla, NO3_N, NH4_N, PO4_P, DOC, DO
// Steele photoinhibition model
"kinetics": [
  "mu_max * PHYTO * (I/I_opt) * exp(1 - I/I_opt)
   * (TIN/(Ks_N + TIN)) * (PO4_P/(Ks_P + PO4_P))
   * theta^(T - 20)"
]

// Ivlev grazing formulation
"kinetics": [
  "g_max * ZOO * (1 - exp(-lambda * PHYTO))"
]
                        
Chlorophyll-a proxy: Chla:C ratio for biomass tracking

Plant Uptake Module v2.0 NEW

plant_uptake.json

SWAT/HYPE-style vegetation cycling — 3 frameworks, 15 transformations

PLANT_UPTAKE_FULL (8 transforms)

  • NO₃ uptake — Mobile, easily transported
  • NH₄ uptake — Preferred (less energy cost)
  • PO₄ uptake — Diffusion-limited
  • Senescence — Litterfall with retranslocation
  • Litter N/P/C mineralization

RIPARIAN_BUFFER (3 transforms)

  • Enhanced NO₃ uptake in riparian zone
  • Denitrification in saturated soil
  • P retention via sedimentation
Seasonal Modulation:
f_season = sin(π × (DOY - 60) / 240) for growing season
// NO3 uptake with seasonal factor
"kinetics": [
  "k_uptake_no3 * NO3_N / (Ks_N + NO3_N + NH4_N)
   * f_growth * f_temp * f_moisture"
]

// Litter N mineralization
"kinetics": [
  "k_litter_N * LITTER_N * theta^(T - 293)"
]
                        

PLANT_UPTAKE_SIMPLE (4 transforms)

Lumped N and P uptake for screening models

Emerging Contaminants v2.0 NEW

emerging_contaminants.json

Micropollutants framework — 6 cycling frameworks, 32 transformations

FrameworkCompoundsTransforms
PHARMACEUTICALSAntibiotics, analgesics, hormones8
PPCPSFragrances, UV filters, triclosan6
PFASPFOA, PFOS, GenX5
MICROPLASTICSFibers, fragments, beads6
ENDOCRINE_DISRUPTORSEstrogens, BPA4
EMERGING_SIMPLEGeneric screening3
Key Processes:
  • Biodegradation (T-dependent)
  • Photolysis (light + depth)
  • Sorption to sediments
  • Volatilization (fragrances)
  • Settling/aggregation (MPs)
// PFAS - extremely persistent
"kinetics": [
  "k_sorp_pfoa * PFAS_PFOA * (1 - PFAS_PFOA/Smax)"
]
// Only sorption - no biodegradation!

// Microplastic settling
"kinetics": [
  "v_settle * MP_fiber / depth"
]
                        

Groundwater Age Tracking v2.0 NEW

groundwater_age.json

Environmental tracers for residence time — 7 frameworks

TracerHalf-lifeAge Range
³H-³He (Tritium)12.32 yr0-50 years
CFC-11, CFC-121940s-1990s
SF₆Post-1990
¹⁴C5,730 yr100-40,000 yr
Mean Age: Tracks water age directly (1 day/day accumulation)
// Tritium decay: 3H -> 3He
"kinetics": [
  "lambda_H3 * TRITIUM"
]
// lambda = ln(2)/12.32yr = 0.0562/yr

// 3H-3He apparent age
// Age = ln(1 + 3He_trit/3H) / lambda

// Carbon-14 age
"kinetics": [
  "lambda_C14 * CARBON14"
]
// Age = -8267 × ln(14C/100)
                        

Applications

  • Aquifer vulnerability assessment
  • Recharge rate estimation
  • Flow path delineation
  • Mixing model calibration

New Advanced Templates v2.0 NEW

sediment_diagenesis.json

Multi-G OM, redox cascade, P/N cycling, CH₄

wetland_processing.json

N/P/TSS removal, k-C* design model

tile_drainage.json

NO₃ leaching, P transport, snowmelt flush

pH_alkalinity.json

Carbonate system, ALK budget, AMD

heavy_metals.json

Cu, Zn, Pb, Cd, Hg speciation and sorption

pathogens.json

E. coli, fecal coliforms, virus decay

pesticides.json

Generic pesticide fate with hydrolysis

silica.json

Dissolved silica for diatom modeling

iron_manganese.json

Fe/Mn redox cycling in sediments

All templates include:
  • Complete CHEMICAL_SPECIES definitions
  • Mobile species configuration
  • Parameter values with literature-based ranges
  • Inline documentation (underscore keys)
02

Popular Model Frameworks

SWAT, QUAL2K, HYPE, WASP8 Frameworks

SWAT_full_nutrients.json

Complete SWAT-style N/P/C cycling

  • 3 organic N pools (fresh, active, stable)
  • 3 organic P pools
  • Soil layer decomposition
  • Erosion-linked P transport

QUAL2E_stream.json

Classic stream water quality

  • DO-BOD dynamics
  • Algae + nutrients
  • SOD, reaeration

HYPE_nutrients.json

Nordic-style large-scale modeling

  • Wetland retention processes
  • Tile drainage N loss
  • Snow-melt nutrient flush

WASP8_eutrophication.json

Lake/estuary eutrophication

  • Multi-algae groups (diatoms, greens, cyano)
  • Sediment diagenesis
  • Zooplankton grazing
03

Thermodynamic Templates

FT Factor Templates — Redox Ladder

TemplateΔG° (kJ/mol)
aerobic_respiration.json−125
nitrification.json−119 to −79
denitrification_thermodynamic.json−119
anammox.json−357
manganese_reduction.json−95
iron_reduction.json−50
sulfate_reduction.json−25
methanogenesis.json−20

full_sediment_diagenesis.json

Complete redox cascade — 13 reactions

Combines all TEAPs (Terminal Electron Accepting Processes) with automatic FT enforcement

// F_T auto-enforces redox sequence
"kinetics": [
  "k * X * (NO3/(Km+NO3)) * (DOC/(Km_DOC+DOC))
   * (1 - exp(-((119-45)/(2*R*(T+273)))))"
]
//        ^^^^^ F_T term ^^^^^^
                        
04

PHREEQC Templates

PHREEQC Templates (.pqi files)

Equilibrium Templates

  • major_ions_equilibrium.pqi
    Ca, Mg, Na, K, Cl, SO₄, HCO₃
  • nitrogen_speciation.pqi
    NH₄/NH₃, NO₂, NO₃ with redox
  • phosphorus_minerals.pqi
    PO₄ speciation + mineral SI
  • trace_metals.pqi
    Fe, Mn, Cu, Zn complexation

Kinetic Templates v2.0

  • dissolved_oxygen_kinetics.pqi
    BOD, NOD, SOD with RATES
  • phytoplankton_kinetics.pqi
    Algae growth, grazing
  • plant_uptake_kinetics.pqi
    N/P uptake, litter cycling
  • emerging_contaminants_kinetics.pqi
    Pharma, PFAS, EDCs
  • groundwater_age_kinetics.pqi
    ³H-³He, ¹⁴C, CFCs, SF₆
  • sediment_diagenesis_kinetics.pqi
    Multi-G OM, redox cascade
  • wetland_processing_kinetics.pqi
    N/P/TSS/pathogens removal
  • tile_drainage_kinetics.pqi
    NO₃ leaching, P transport
  • pH_alkalinity_kinetics.pqi
    Carbonate, ALK, AMD
Note: Use NATIVE_BGC_FLEX for complex biological processes. PHREEQC kinetics best for coupled geochemical-biological systems.

Template Summary

Category Templates Key Features Status
Nutrients nitrogen, phosphorus (simple/full) N & P cycling, plant uptake, redox Stable
Dissolved Oxygen dissolved_oxygen 12 transforms, 4 reaeration formulas v2.0
Algae phytoplankton_algae Steele + MM, zooplankton, Chla v2.0
Vegetation plant_uptake 3 frameworks, riparian buffer v2.0
Micropollutants emerging_contaminants PFAS, PPCPs, microplastics, EDCs v2.0
Popular Models SWAT, QUAL2K, HYPE, WASP8 Complete model frameworks Stable
Thermodynamic 10 redox templates + diagenesis FT factor, automatic ladder Stable
Groundwater Age groundwater_age ³H-³He, ¹⁴C, CFCs, SF₆ tracers v2.0
Sediment Diagenesis sediment_diagenesis Multi-G OM, redox cascade, P/N cycling v2.0
Wetland/BMP wetland_processing N/P/TSS removal, k-C* model v2.0
Tile Drainage tile_drainage NO₃ leaching, P transport, snowmelt v2.0
pH/Alkalinity pH_alkalinity Carbonate system, ALK budget, AMD v2.0
PHREEQC 4 equilibrium + 9 kinetic Full geochemistry + bio processes Mixed

BGC Templates Library

Ready to use • Easy to customize