An assembly comprises a wet compartment (100) having at least one inlet opening for allowing water to enter the wet compartment (100), a functional unit (2) located in the wet compartment (100), a dry area (200) which cannot be reached by water and which is outside of the wet compartment (100), a barrier (110) situated between the dry area (200) and the wet compartment (100), and at least one energy source (20) which is arranged and configured to emit energy for preventing biofouling of at least an exterior surface (17) of the functional unit (2), wherein the energy source (20) is arranged in the dry area (200), a path (112) being present between the dry area (200) and the wet compartment (100) for allowing energy emitted by the energy source (20) during operation thereof to reach the wet compartment (100), through the barrier (110).