Dynamic modeling of the interaction of gas and solid phases in multistep reactive micropyretic synthesis