The easiest way to prevent use in swamps would probably be either limiting them to only producing power if you have 3-4 in a row, or somehow having it check if there are more than a certain number of water tiles in a certain area. Neither of those make any difference to trying to use one in a lake or something though.
Something that would be worth discussing is how will these actually work? Will they just act as a normal vehicle part, perhaps with an excessively high weight to try to prevent them from being mobile? If they’re a construction, is there any way for them to actually produce usable power?
One thing I suggested in another thread was the inclusion of a concrete base as a vehicle part. It could make the attached vehicle immobile, but would provide stability for much larger parts to attach to it, things like waterwheels or wind turbines comes to mind, but there are probably other things too.