About StillSim

What It Does

StillSim is a thermodynamically-accurate distillation simulator for ethanol-water mixtures. It models batch distillation processes using fundamental physical principles, tracking temperature, composition, and volume changes over time. The simulator supports both pot still and reflux still configurations with adjustable theoretical plates.

Unlike many simplified models, StillSim accounts for non-ideal mixture behavior, temperature-dependent properties, and energy balance constraints to provide realistic predictions of distillation performance.

Why Would You Use It

StillSim is designed for:

  • Educational purposes: Understanding the thermodynamic principles behind distillation and how various parameters affect separation efficiency
  • Design exploration: Comparing pot still vs. reflux configurations and determining optimal theoretical plate counts
  • Process prediction: Estimating how long a distillation run will take and what product concentrations to expect
  • Parameter optimization: Exploring the effects of reflux ratio, power input, and starting conditions on distillate quality and yield

The simulator strikes a balance between simplicity and accuracy, using straightforward, measurable inputs that make it accessible to users across many skill and education levels. While it avoids unnecessary complexity, it still incorporates fundamental thermodynamic principles to deliver results that are accurate enough for practical learning and exploration.

How It Works

StillSim uses a time-stepping energy-based model that calculates the state of the system at each moment. Here are the key thermodynamic calculations:

Mixture Boiling Point

The boiling point is calculated by finding the temperature where total vapor pressure equals atmospheric pressure. Uses the Antoine equation for pure component vapor pressures and Wilson activity coefficients to account for non-ideal mixture behavior, accurately modeling how the boiling point changes as ethanol is depleted.

Mixture Density

Calculates the density of ethanol-water mixtures based on temperature and composition using temperature-dependent polynomial correlations for each pure component. This enables accurate conversion between volume and mass throughout the simulation.

Evaporation Rates

Evaporation is driven by energy input: the power input (in watts) divided by the mass-weighted latent heat determines total evaporation rate. The composition of evaporated vapor is determined by vapor-liquid equilibrium using modified Raoult's law with Wilson activity coefficients. An alternative approach based on mass transfer coefficients was considered but found to be more complicated and less reliable.

Vapor Temperature (Dew Point)

The vapor temperature (dew point) is calculated by finding the temperature where the vapor mixture would begin to condense. Uses an iterative Newton-Raphson method with Antoine equations to determine the condensation temperature for the current vapor composition.

Vapor Composition

Vapor composition is determined by vapor-liquid equilibrium. The simulator uses modified Raoult's law with Wilson activity coefficients to calculate mole fractions in the vapor phase, accounting for the significant positive deviations from ideal behavior in ethanol-water mixtures, including the azeotrope at 95.6% ethanol.

Reflux/Vapor Enrichment

Reflux enrichment is modeled using theoretical plates (equilibrium stages) and reflux ratio. Each theoretical plate applies an equilibrium separation based on relative volatility, progressively enriching the ethanol content. The reflux ratio determines what fraction of vapor returns to the column versus what is collected as distillate.

Heat Capacity and Energy Balance

Mass-weighted heat capacities determine how quickly the mixture heats up. Below the boiling point, all input energy raises the temperature. At boiling, all energy goes to evaporation while temperature remains constant. Temperature-dependent correlations ensure accurate energy accounting throughout the run.

Latent Heat of Vaporization

The latent heat (enthalpy of vaporization) varies with temperature for both water and ethanol. The simulator uses temperature-dependent correlations and calculates an effective latent heat based on the mass fraction of each component in the vapor, ensuring accurate energy balance for evaporation.

Implementation

StillSim is built using Rust for the core simulation engine, compiled to WebAssembly for high-performance in-browser calculations. The web interface is built with Next.js and React, providing an interactive visualization of the distillation process without requiring any server-side processing.

Development and Use of AI

Generative AI tools were used extensively in the development of this website, including for background research, writing code, and creating content. However, this was not a simple case of AI generating everything automatically.

The use of AI was closely supervised and guided by domain expertise including a PhD in chemistry, years of experience in scientific programming and web development, and a genuine interest in distillation processes.

The AI served as a powerful tool to accelerate development and explore implementation approaches, but the scientific validity and correctness of the simulator required extensive human expertise to ensure the results are thermodynamically sound and practically useful.