When Johann and Daniel Bernoulli founded fluid dynamics they encountered several problems. To go beyond the vision of Newtonian particles, a new set of images was needed in order to deal with the spatial extensibility and lack of form of fluids. I point to evidence that analogy was an essential abductive strategy in the creation of this imagery. But its heuristic behavior is complex: analogy can provide an initial model or proto-model that establishes the starting point of a theoretical process, but it can play other roles as well. The historical genesis analyzed here shows that the participation of analogy in physicists' creativity is not so restricted and that its richness opens up the field for very different roles and strategies in model-based discovery processes. Analogies can crop up intermittently in the evolution of a theory; and they can cooperate with images, extreme case reasoning and thought experiments, and even activate these processes at origin. Although it may seem that the contributions of analogy are generative in the sense of helping to discover new aspects of reality, we must stress the evaluative function that sometimes is performed by analogical reasoning in order to gain confidence. The study of the Bernoulli's genesis of the foundations of fluid dynamics generates interesting hypotheses about the multiple roles that analogy can play in scientific model-based reasoning.