NOVELTY - Apparatus comprises (a) a digester chamber, (b) a gas generating zone for accommodation of the organic material which when accommodated in the gas generating zone generates the biogas by anaerobic digestion of the organic material, and (c) a gas collecting zone which is located above the gas generating zone in the digester chamber to collect the biogas generated in the gas generating zone.    USE - The apparatus is used for production of a biogas from organic material (claimed) used in production of electricity and/or heat. The organic material is sludge from treatment of industrial or municipal wastewater, waste from farms and agriculture, energy crops, household waste, and waste from industrial productions.    ADVANTAGE - The collecting unit is arranged such that the collected gas cooling liquid flows into the liquid based safety valve and the collected gas cooling liquid is prevented from flowing into the organic material. This is desirable as such entry of the collected gas cooling liquid would cause the organic material to be diluted with the result that the organic material would reside in the gas generating zone for a shorter period of time. The result of the latter would be that a lower percentage of the organic material would be digested and thus the gas production would decrease. The collected gas cooling liquid is guided into the liquid based safety valve, and it is ensured that the liquid based safety valve does not run dry by evaporation. If the latter happened, the liquid based safety valve would cease to function. Depending on the design of the system this could cause the biogas to escape the apparatus in an uncontrolled manner and thus increase the risk of explosions. The liquid sprayed into the gas collection chamber by nozzles may be used to prevent fire and/or explosions, thus the nozzles function as flame/explosion arrestors. Foam is prevented from passing between the collecting unit and the liquid based safety valve, and/or may pass between the inner wall and the highest point of the collecting unit. The liquid is prevented from flowing from the first to the second liquid zone through the by-pass valve, when the by-pass valve is in a closed state.    DETAILED DESCRIPTION - Apparatus comprises (a) a digester chamber, (b) a gas generating zone for accommodation of the organic material which when accommodated in the gas generating zone generates the biogas by anaerobic digestion of the organic material, and (c) a gas collecting zone which is located above the gas generating zone in the digester chamber to collect the biogas generated in the gas generating zone, where a biogas outlet is defined in the gas collecting zone, the biogas outlet is arranged such that biogas exits the gas collecting zone through the biogas outlet, one or more nozzles is/are arranged in the gas collecting zone, the nozzles are adapted to spray a gas cooling liquid into the gas accommodated in the gas collecting zone to cool the gas, a collecting unit is arranged in the gas collecting zone to collect the gas cooling liquid when sprayed from the nozzles towards the collecting unit to prevent the gas cooling liquid from entering the organic material, one or more safety valves are arranged in the gas collecting zone, each safety valve defining an inlet which is fluidly connected to the interior of the gas collecting zone and an outlet which is fluidly connected to air outside the apparatus, and at least one of the safety valves is a liquid based safety valve and the collecting unit is arranged to cause the collected gas cooling liquid to flow into the liquid based safety valve (thus a predetermined water level in the water based safety valve is maintained).