Well, I once put this down in another thread, but I will see what I can remember at put it all down here.
In my happiness model, a city's happiness runs from 0-100%. Each 10% increment also has an 'adjective' to describe that mood-so 0-9% might be rebellious, 10-19% might be riotous, 20-29% might be defiant, 30-39% might be angry, 40-49% might be unhappy, and so on up to 100%. The interesting thing is that you would never KNOW eaxactly how happy the people in the city are, just their overall 'mood' (so you might know the people are Defiant, but are they almost riotous or are they merely VERY angry?) In addition, a city's OVERALL mood would be made up of the mood of each 'group' in that city-its labourers, farmers, civil servants, entertainers, merchants and scientists. So, for instance, the merchants may simply be unhappy with you, but the workers might be downright rebellious. what degree each groups mood contributes to the 'city mood' will depend on the 'degree of specialisation' of said city. So, for instance, if your city is an industrial heart, then it is highly likely that you have greater than 50% workers in that city. Thus, their happiness will have the greatest bearing on the city's mood. Lastly, the mood of each 'social caste' will have a bearing on how the city functions and the nature of any revolt (if it occurs), wheras the overall mood effects things like the chance of improvements or units getting damaged, the chance of a civil war or the chance of geurilla units being spawned. So, for instance, if your workers are angry with you, then shield production will fall accordingly. If the scientists are angry with you, then the beaker output of the city will be lower etc.
I agree with Fekka that placing units in a city should only work in improving mood up to a point, wheras too many would push mood back down! Your culture, culture group and government/religion type should also have a strong effect on how quickly a captured city's mood improves.
Anyway, hope that makes sense to everyone. Any thoughts, ideas? I'd love to hear them!
Yours,
Aussie_Lurker