The preteen boy, who has lived his whole life on a spaceship, discovers that food is delivered to a hidden door and that the journey is research.
This sounds very much like "Thirteen to Centaurus", a classic short story by J.G. Ballard, first published in April 1972 in Amazing Stories.
The story takes place in a mysterious living environment simply called "The Station", which holds a crew of 13, including the protagonist of the story, Abel, who assume they are living on a space station. Abel suffers from recurring nightmares as he approaches his 16th birthday, which lead the doctor to reveal to him that the Station is a generational starship travelling to Alpha Centauri. In fact this is a lie; the doctor is part of a team observing the effect of isolation on such a trip, and the Station is in fact a dome on Earth.
Abel indeed sees food being delivered from outside though a hole in the outer dome, and the hypnotic conditioning he is subject to begins to break down. In the end he becomes the de facto captain of the crew.