Cook the beans: Soak the beans in stock or water overnight or at least for several hours.
In a large flameproof bean pot or Dutch oven, sauté the onion and garlic in the oil until the onion is tender. Add the drained beans, broth, bay leaf, and pepper.
Bring the beans to a boil, add the oranges, salt to taste, and celery, and simmer, covered, for 2 to 3 hours. After the first hour, remove the lid and simmer uncovered.
When the beans are tender, remove about one-third of them and mash. Return the beans to the pot and continue cooking until the mashed beans thicken the mixture. Set aside.
Prepare the rice: Sauté the onion and garlic in the olive oil over medium heat until the onion is tender and golden, about 15 minutes. Add the tomatoes and simmer for a few minutes, then stir in the cooked rice and mix well. Keep warm over low heat until ready to serve (unless you make it far in advanc—-then just heat over medium heat shortly before serving).
Make the sauce: When ready to serve, put all the sauce ingredients, including salt to taste, in a blender and liquefy. Stir into the feijoada and serve over the rice.