Process simulation

Two-way forced aeration composting simulation using Python

A programming-based extension of a forced-aeration composting model that reverses airflow direction through a six-layer pile and tracks the resulting thermal, moisture, oxygen and solids behavior.

6 layers28-day example simulation1-hour time stepPython · NumPy · Matplotlib

Why reverse the airflow?

In a one-way forced-aeration pile, air repeatedly enters from the same side. That can produce vertical differences in temperature, oxygen availability and moisture. This project explores a two-way configuration in which the airflow direction is periodically reversed so the calculation order through the pile also reverses.

The kinetic framework is based on the forced-aeration composting model reported by Bari & Koenig (2012), with the computational project designed as an extension for alternating airflow.

UPFLOW PHASE DOWNFLOW PHASE ↑ ↓ Layer 6 Layer 6 Layer 5 Layer 5 Layer 4 ⇄ cycle ⇄ Layer 4 Layer 3 Layer 3 Layer 2 Layer 2 Layer 1 Layer 1 ↑ ↓ air inlet air inlet

Computational structure

The pile is represented as six vertical layers. At each simulation hour, the code determines the active airflow direction, sets the layer calculation order, processes each layer using information passed along the airflow path, updates state variables, stores outputs and repeats for the full simulation.

01

Initialize

Define mass, layer count, time step, temperature, moisture, solids, airflow and environmental/kinetic parameters.

02

Set airflow order

Switch programmatically between Layer 1→6 and Layer 6→1 using the user-defined reversal cycle.

03

Update coupled states

Calculate layer-wise heat, moisture, oxygen and degradation responses for each hour.

04

Compare outcomes

Store time-series outputs and compare the two-way scenario with the previously established one-way implementation.

Simulated variables

TemperatureBiological heat generation and aeration-related heat transfer
MoistureWater-content change during composting and aeration
OxygenLayer-wise oxygen availability and consumption
Volatile solidsOrganic-matter degradation through the simulation
MassTotal compost and component mass balance
Aeration cycleUser-controlled reversal interval

Key comparison from the implemented scenario

Under the example conditions documented in the repository, the two-way simulation produced a lower final compost mass and lower final water content than the one-way model. The layer-wise behavior was also reported as comparable between opposite layers, consistent with the intended alternating-flow logic.

ParameterOne-way aerationTwo-way aeration
Initial mass750 kg750 kg
Final compost mass357.9 kg332.2 kg
Final total solids240.5 kg236.9 kg
Final volatile solids80.6 kg76.6 kg
Final water content117.4 kg95.3 kg
Research connection: related forced-aeration work was presented in the 8th International Conference on Civil Engineering for Sustainable Development (ICCESD 2026), where I am a co-author.

Scope & limitations

This is a mathematical/computational model, not a substitute for full-scale compost-pile measurements. Its value is in reproducing and extending a published kinetic framework, testing airflow-reversal logic, and understanding how coupled state variables respond in a layered system. Model validation against dedicated two-way experimental data would be an important next step.