This portcullis is at Edinburgh Castle (above). A castle dungeon was a room used to hold prisoners, usually underground. St Andrews Castle has a famous dungeon which is shaped like a bottle.
Valestein Castle, one of the grandest and most complex dungeons in Ys Memoire The Oath ... Be cautious as you navigate the first few rooms, as they feature spike traps and formidable enemies.