Which of the following is a primary function of a generator?
A) To increase the pressure of fluids in a pipeline.
B) To convert mechanical energy into electrical energy.
C) To store electrical energy for future use.
D) To filter impurities from air and liquids