Device (1; 21; 30; 50; 100; 200), comprising: - a channel (5; 25; 201), comprising an inlet (3; 23; 40; 101; 202) at a first end of the channel (5; 25; 201) and an outlet (4; 24; 42; 102; 203) at a second end of the channel (5; 25; 201); - a cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105; 207, 208), arranged in the channel (5; 25; 201), which cathode 10 (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105, 207, 208) comprises a first segment (9; 26; 38; 56; 207) selected from titanium, stainless steel and titanium provided with a mixed metal oxide coating layer comprising ruthenium oxide and iridium oxide - an anode (11; 29; 34; 54; 105; 209), arranged in the channel (5; 25; 201), selected from titanium, stainless steel and titanium provided with a mixed metal oxide coating layer comprising ruthenium oxide and/or iridium oxide, which coating layer faces the cathode; and - a power source, electrically connected to the cathode and the anode, wherein the anode (11; 29; 34; 54; 105, 209) and cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 207, 208) are arranged in the channel (5; 25; 201) substantially parallel to the direction of flow in the channel (5; 25; 201) and wherein the anode (11; 29; 34; 54; 209) is arranged at a distance from the cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 207, 208) in a direction perpendicular to the length of both the cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 207, 208) and the anode (11; 29; 34; 54; 209) characterized in that the cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105, 207, 208) further comprises a second segment (10; 27; 39; 57; 208) comprising carbon, such as a felt carbon segment, arranged downstream of the first segment (9; 26; 38; 56; 207), wherein the surface area of the first segment (9; 26; 38; 56; 207) of the cathode and the second segment (10; 27; 39; 57; 208) of the cathode is substantially equal, wherein a first zone is defined, in which the anode (11; 27; 34; 54; 209) faces the first segment (9; 26; 38; 56; 207) of the cathode and wherein a second zone is defined, in which the anode (11; 29; 34; 54; 209) faces the second segment (10; 27; 39; 57; 208) of the cathode and the surface area of the cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105, 207, 208) and the anode (11; 29; 34; 54; 105, 209) that face each other is substantially equal. - a channel (5; 25; 201), comprising an inlet (3; 23; 40; 101; 202) at a first end of the channel (5; 25; 201) and an outlet (4; 24; 42; 102; 203) at a second end of the channel (5; 25; 201); - a cathode (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105; 207, 208), arranged in the channel (5; 25; 201), which cathode 10 (9, 10; 26, 27; 36, 38, 39; 55, 56, 57; 105, 207, 208) comprises a first segment (9; 26; 38; 56; 207) selected from titanium, stainless steel and titanium provided with a mixed metal oxide coating layer comprising ruthenium oxide and iridium oxide - an anode (11; 29; 34; 54; 105; 209), arranged in the channel (5; 25; 201), selected from titanium, stainless steel and titanium provided with a mixed metal oxide coating layer comprising ruthenium oxide and/or iridium oxide, which coating layer faces the cathode; and - a power source, electrically connected to the cathode and the anode,