Let us define a rate constraint qc. The total rate of gas for each layer must equal qc.
Now, the total rate of gas for each layer depends on the pseudo pressure of the layer
now, as the gas properties for each layer are independant, the pseudo flowing pressure for each layer can be different, even if the flowing pressures are the same.
We respect the constant pressure drop, same as in the water rate constraint case.
We end up with the following equation that we can solve with a numerical root finding technique: