Skip to main content
wastewater-optimization Specialized skill for biological and physical-chemical wastewater treatment process optimization with activated sludge modeling, nutrient removal, aeration efficiency, and energy minimization.
설치로 이동 Skills Marketplace 커뮤니티가 만든 AI 스킬을 발견하고 탐색하세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/a5c-ai/babysitter --skill wastewater-optimization명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Zip 다운로드 다운로드 중... 이 저장소의 다른 Skills Reference for querying the Atlas knowledge graph through its MCP tools — the SECONDARY enrichment/comparison layer that adds best-practice context to systems you have ALREADY scanned from your real sources (`az`, repos, dirs). Use when you need to look up nodes, edges, kinds, clusters, stats, or wiki pages in Atlas to compare against your real inventory. (atlas graph, query atlas, atlas mcp, search the graph, graph neighbors, atlas record, atlas kinds, enrichment layer)
Atlas turns your STATED NEED into a real systems atlas by SCANNING your actual sources (Azure via `az`, git repos, local dirs) and process/data mining them, THEN enriching against the Atlas knowledge graph. Use this skill when asked to inventory/map your real systems, scan your cloud + repos + directories, mine the real processes or data they contain, or collect their real constraints/gotchas. (atlas, scan my systems, inventory our azure account, map my repos, real systems atlas, process mining, data mining, collect nuances, system discovery)
assimilate-popular-workflows This skill should be used when the user asks to "find skills in the wild", "assimilate popular workflows", "discover SKILL.md files in repos", "research external skills", "find workflow patterns", "survey the skill landscape", "what skills exist out there", or wants to investigate public repositories for extractable processes, babysitter plugins, and reusable procedural insights. Searches GitHub for SKILL.md files, classifies repos by archetype, and maintains structured research under docs/reference-repos/.
name wastewater-optimization description Specialized skill for biological and physical-chemical wastewater treatment process optimization with activated sludge modeling, nutrient removal, aeration efficiency, and energy minimization. allowed-tools Read, Grep, Write, Bash, Edit, Glob category Water and Wastewater Treatment backlog-id SK-002 metadata {"author":"babysitter-sdk","version":"1.0.0"} graph {"domains":["domain:environmental-engineering"],"skillAreas":["skill-area:data-analysis","skill-area:statistical-analysis","skill-area:geospatial-data-analysis"],"workflows":["workflow:experiment-design"],"roles":["role:research-engineer"]}
Wastewater Treatment Optimization Skill
Biological and physical-chemical wastewater treatment process optimization for municipal and industrial applications.
Purpose This skill provides comprehensive capabilities for optimizing wastewater treatment processes, including activated sludge modeling, nutrient removal optimization, aeration efficiency analysis, and energy consumption minimization.
Capabilities
Activated Sludge Process Modeling
ASM1, ASM2d, ASM3 model implementation
Stoichiometric and kinetic parameter estimation
Model calibration with plant data
Steady-state and dynamic simulation
Sensitivity analysis for key parameters
BioWin and GPS-X Integration
Model input file generation
Simulation scenario configuration
Results parsing and analysis
Automated optimization runs
Comparative scenario analysis
Nutrient Removal Optimization
Biological Nutrient Removal (BNR) process design
Enhanced Biological Phosphorus Removal (EBPR) optimization
Nitrification/denitrification kinetics
Carbon source requirements
Recycle ratio optimization
Aeration Efficiency Analysis
Oxygen transfer efficiency (OTE) calculation
Alpha and beta factor determination
Diffuser performance assessment
Blower energy optimization
DO control strategy evaluation
Sludge Age and F/M Ratio Optimization
Solids Retention Time (SRT) optimization
Food-to-Microorganism (F/M) ratio analysis
MLSS concentration control
Sludge yield prediction
WAS flow optimization
Energy Consumption Minimization
Energy audit methodology
Aeration energy optimization
Pumping efficiency analysis
Process control optimization
Energy benchmarking
Chemical Dosing Optimization
Coagulant dose optimization
Polymer selection and dosing
pH adjustment requirements
Phosphorus precipitation
Chemical cost minimization
Secondary Clarifier Modeling
Settling velocity analysis
Solids flux theory application
State point analysis
Clarifier capacity evaluation
Return sludge optimization
Prerequisites
Installation pip install numpy scipy pandas matplotlib
Optional Dependencies
pip install python-control
pip install scipy pymoo
pip install plotly seaborn
Usage Patterns
Activated Sludge Mass Balance import numpy as np
from dataclasses import dataclass
from typing import Dict , Optional
@dataclass
class WastewaterCharacteristics :
"""Influent wastewater characteristics"""
flow_mgd: float
bod5_mg_l: float
tss_mg_l: float
tkn_mg_l: float
tp_mg_l: float
temperature_c: float = 20.0
@dataclass
class ActivatedSludgeParameters :
"""Kinetic and stoichiometric parameters"""
Y: float = 0.6
kd: float = 0.06
mu_max: float = 6.0
Ks: float = 60.0
theta_Y: float = 1.0
theta_kd: float = 1.04
class ActivatedSludgeModel :
"""Simplified activated sludge process model"""
def __init__ (self, influent: WastewaterCharacteristics,
params: ActivatedSludgeParameters ):
self .influent = influent
self .params = params
def calculate_srt_for_effluent (self, target_bod_eff: float ) -> float :
"""Calculate required SRT for target effluent BOD"""
S = target_bod_eff
S0 = self .influent.bod5_mg_l
Y = self .params.Y
kd = self .params.kd
mu_max = self .params.mu_max
Ks = self .params.Ks
mu = mu_max * S / (Ks + S)
srt_min = 1 / (mu - kd)
return srt_min * 1.5
def calculate_oxygen_requirement (self, srt_days: float , target_bod_eff: float ) -> Dict :
"""Calculate oxygen requirements"""
Q = self .influent.flow_mgd * 3.785
S0 = self .influent.bod5_mg_l
S = target_bod_eff
Y = self .params.Y
kd = self .params.kd
bod_removed = (S0 - S) * Q / 1000
Px = Y * bod_removed / (1 + kd * srt_days)
O2_bod = bod_removed - 1.42 * Px
O2_endo = 1.42 * kd * Px * srt_days
return {
'bod_removed_kg_day' : bod_removed,
'biomass_produced_kg_day' : Px,
'O2_for_bod_kg_day' : O2_bod,
'O2_for_endogenous_kg_day' : O2_endo,
'total_O2_kg_day' : O2_bod + O2_endo
}
def calculate_aeration_basin_volume (self, srt_days: float ,
mlss_mg_l: float ) -> float :
"""Calculate required aeration basin volume"""
Q = self .influent.flow_mgd * 3785.41
S0 = self .influent.bod5_mg_l
S = 10
Y = self .params.Y
kd = self .params.kd
Px = Y * (S0 - S) / (1 + kd * srt_days)
vss_tss_ratio = 0.8
mlvss = mlss_mg_l * vss_tss_ratio
volume_m3 = (Q * Px * srt_days) / mlvss
return volume_m3
influent = WastewaterCharacteristics(
flow_mgd=10.0 ,
bod5_mg_l=200 ,
tss_mg_l=220 ,
tkn_mg_l=40 ,
tp_mg_l=8 ,
temperature_c=18
)
params = ActivatedSludgeParameters()
model = ActivatedSludgeModel(influent, params)
srt = model.calculate_srt_for_effluent(target_bod_eff=10 )
print (f"Required SRT: {srt:.1 f} days" )
o2_req = model.calculate_oxygen_requirement(srt, target_bod_eff=10 )
print (f"Oxygen requirement: {o2_req['total_O2_kg_day' ]:.0 f} kg/day" )
volume = model.calculate_aeration_basin_volume(srt, mlss_mg_l=3000 )
print (f"Aeration basin volume: {volume:.0 f} m3" )
Aeration Efficiency Optimization import numpy as np
class AerationAnalysis :
"""Aeration system efficiency analysis"""
def __init__ (self, basin_depth_m: float , diffuser_type: str = 'fine_bubble' ):
self .basin_depth = basin_depth_m
self .diffuser_type = diffuser_type
self .sote_per_m = {
'fine_bubble' : 0.06 ,
'coarse_bubble' : 0.02 ,
'surface_aerator' : 0.015
}
def calculate_sote (self ) -> float :
"""Calculate Standard Oxygen Transfer Efficiency"""
base_sote = self .sote_per_m.get(self .diffuser_type, 0.04 )
return base_sote * self .basin_depth
def calculate_aote (self, temperature_c: float , do_mg_l: float ,
alpha: float = 0.5 , beta: float = 0.95 ,
altitude_m: float = 0 ) -> float :
"""Calculate Actual Oxygen Transfer Efficiency"""
Cs_20 = 9.09
Cs_T = 14.62 - 0.3898 * temperature_c + 0.006969 * temperature_c**2
P_ratio = np.exp(-altitude_m / 8500 )
theta = 1.024
sote = self .calculate_sote()
aote = sote * alpha * ((beta * Cs_T * P_ratio - do_mg_l) / Cs_20) * \
theta ** (temperature_c - 20 )
return aote
def calculate_air_flow (self, o2_required_kg_hr: float ,
aote: float ) -> float :
"""Calculate required air flow rate"""
o2_fraction = 0.23
air_density = 1.2
o2_per_m3_air = air_density * o2_fraction
air_flow_m3_hr = o2_required_kg_hr / (o2_per_m3_air * aote)
return air_flow_m3_hr
def calculate_blower_power (self, air_flow_m3_hr: float ,
inlet_pressure_kpa: float = 101.325 ,
discharge_pressure_kpa: float = 150 ,
efficiency: float = 0.70 ) -> float :
"""Calculate blower power requirement"""
gamma = 1.4
p_ratio = discharge_pressure_kpa / inlet_pressure_kpa
Q = air_flow_m3_hr / 3600
head_kj_kg = (gamma / (gamma - 1 )) * (inlet_pressure_kpa / 1.2 ) * \
((p_ratio ** ((gamma - 1 ) / gamma)) - 1 )
power_kw = (Q * 1.2 * head_kj_kg) / efficiency
return power_kw
aeration = AerationAnalysis(basin_depth_m=5.0 , diffuser_type='fine_bubble' )
sote = aeration.calculate_sote()
print (f"SOTE: {sote*100 :.1 f} %" )
aote = aeration.calculate_aote(temperature_c=18 , do_mg_l=2.0 , alpha=0.5 )
print (f"AOTE: {aote*100 :.1 f} %" )
air_flow = aeration.calculate_air_flow(o2_required_kg_hr=500 , aote=aote)
print (f"Air flow required: {air_flow:.0 f} m3/hr" )
power = aeration.calculate_blower_power(air_flow_m3_hr=air_flow)
print (f"Blower power: {power:.0 f} kW" )
Nutrient Removal Analysis class NutrientRemoval :
"""Nutrient removal process analysis"""
def __init__ (self ):
self .nitrification_rate_20c = 0.08
self .denitrification_rate_20c = 0.1
def calculate_nitrification_srt (self, temperature_c: float ,
safety_factor: float = 2.0 ) -> float :
"""Calculate minimum SRT for nitrification"""
mu_max_20 = 0.8
kd_n = 0.04
theta = 1.07
mu_max = mu_max_20 * theta ** (temperature_c - 20 )
srt_min = 1 / (mu_max - kd_n)
return srt_min * safety_factor
def calculate_carbon_for_denitrification (self, no3_to_remove_mg_l: float ,
flow_mgd: float ,
carbon_source: str = 'methanol' ) -> Dict :
"""Calculate external carbon requirement for denitrification"""
carbon_ratios = {
'methanol' : 3.0 ,
'ethanol' : 4.0 ,
'acetic_acid' : 3.5 ,
'raw_wastewater' : 4.5
}
ratio = carbon_ratios.get(carbon_source, 4.0 )
flow_m3_day = flow_mgd * 3785.41
n_mass_kg_day = no3_to_remove_mg_l * flow_m3_day / 1000
cod_kg_day = n_mass_kg_day * ratio
return {
'nitrate_removed_kg_day' : n_mass_kg_day,
'cod_required_kg_day' : cod_kg_day,
'carbon_source' : carbon_source,
'ratio_used' : ratio
}
def calculate_ebpr_capacity (self, vfa_mg_l: float , flow_mgd: float ) -> Dict :
"""Estimate EBPR phosphorus removal capacity"""
vfa_p_ratio = 12
flow_m3_day = flow_mgd * 3785.41
vfa_mass_kg_day = vfa_mg_l * flow_m3_day / 1000
p_removal_kg_day = vfa_mass_kg_day / (vfa_p_ratio / 1000 )
return {
'vfa_available_kg_day' : vfa_mass_kg_day,
'p_removal_potential_kg_day' : p_removal_kg_day,
'p_removal_concentration_mg_l' : (p_removal_kg_day * 1000 ) / flow_m3_day
}
nutrient = NutrientRemoval()
srt = nutrient.calculate_nitrification_srt(temperature_c=15 )
print (f"Minimum SRT for nitrification at 15C: {srt:.1 f} days" )
carbon = nutrient.calculate_carbon_for_denitrification(
no3_to_remove_mg_l=20 ,
flow_mgd=10 ,
carbon_source='methanol'
)
print (f"Methanol COD required: {carbon['cod_required_kg_day' ]:.0 f} kg/day" )
ebpr = nutrient.calculate_ebpr_capacity(vfa_mg_l=50 , flow_mgd=10 )
print (f"EBPR P removal potential: {ebpr['p_removal_concentration_mg_l' ]:.1 f} mg/L" )
Usage Guidelines
When to Use This Skill
Wastewater treatment process design and optimization
Energy efficiency improvement projects
Nutrient removal system upgrades
Process troubleshooting and capacity analysis
Chemical dosing optimization
Best Practices
Calibrate models with plant-specific data
Consider seasonal variations in temperature and loading
Account for diurnal variations in flow and load
Verify model predictions with plant performance data
Include safety factors for critical processes like nitrification
Optimize holistically considering interactions between processes
Process Integration
WW-002: Wastewater Process Optimization (all phases)
WW-001: Water Treatment Plant Design (optimization phases)
Dependencies
numpy: Numerical calculations
scipy: Optimization routines
pandas: Data analysis
References
Metcalf & Eddy, "Wastewater Engineering: Treatment and Resource Recovery"
Water Environment Federation, "Nutrient Removal" (MOP 34)
Henze et al., "Activated Sludge Models ASM1, ASM2, ASM2d and ASM3"