you don't have any idea how much current is passing through the MOSFET when it is turned on, so how would you know what the average current through your electrolyzer is?
I would suggest you move away from blind PWM generation and use a control method that will turn the FET off when the current through it reaches a certain level (peak current control). With a fixed frequency, you will be able to at least approximate the average current (I do not know what the electrical characteristic of an electrolyzer are, so I could not guess on what the current waveform will look like)