Whipping with a granary in place translates food into hammers at a ratio of 30 hammers for (10+city size) food... this is the average size when regrowing, not the final size.
Whether you want to sink everything into the whip or not depends a lot on circumstances. for example, let's assume you have a city with generally poor land and you need longer than the 10 turns to regrow to your old size of 8 (so you aren't limited by the happiness concerns of the whip and are probably working all food-efficient tiles. This means your 'marginal citizens' to whip away are probably specialists).
Over your regrowth cycle, 1 food whipped is translated into approximately 1.7
. Whipping later slows your regrowth cycle and makes you exchange 2 food usable for whipping (worth 3.4
in our example) for the output of a SpecialistTurn. If your marginal specialists are Representation-boosted scientists you just need to consider what is worth more to you in this city: 6
(and 3GPP) or 3.4
.
If you prefer the specialist output, whip away only when you need the production immediately. If the hammers sound good but you lack hammer tiles (note: plains/grassland mines give a better conversion of food to hammers) whip every 10 rounds and move towards a more efficient equilibrium at a smaller city size.
***
If your land is actually decent but lacks good production tiles, you might want to use the resource to grow your first generation of cities to their caps, then found filler cities that work nothing but food resources and regularly-whipped specialists. Or have multiple hybrid cities whipping in turn, always changing the food resource to one that needs to regrow... if you can stand the micromanagement.
In the late game, relatively small cities with a food surplus are awesome with the Kremlin. At size 10 (average during regrowth again), a 2-
-farm gives the equivalent of 4.5 hammers when geared towards whipping. You won't be able to keep this up indefinitely if you stack whip anger, but there's no reason you can't divert some of it towards whipping and set up stable cycles supporting specialists in the regrowth time as normal. You'll still get a combination of hammers/whatever-the-specialists-get-you that you could not achieve with a combination of farms and those awesome State Property workshops.