Using CFD and mathematical optimization to investigate air pollution due to stacks