Yes the story is mentioned at various places but it is not Shiva's energy but that of a rishi Aurva that turns into the Vadavagni.
SECTION CLXXX of the Adi Parva of Mahabharat gives the detailed story:
There was a celebrated king of the name of Kritavirya. That bull among the kings of the earth was the disciple of the Veda-knowing Bhrigus. That king, O child, after performing the Soma sacrifice, gratified the Brahmanas with great presents of rice and wealth. After that monarch had ascended to heaven, an occasion came when his descendants were in want of wealth. And knowing that the Bhrigus were rich, those princes went unto those best of Brahmanas, in the guise of beggars. Some amongst the Bhrigus, to protect their wealth, buried it under earth; and some from fear of the Kshatriyas, began to give away their wealth unto (other) Brahmanas; while some amongst them duly gave unto the Kshatriyas whatever they wanted. It happened, however, that some Kshatriyas, in digging as they pleased at the house of particular Bhargava, came upon a large treasure. And the treasure was seen by all those bulls among Kshatriyas who had been there. Enraged at what they regarded as the deceitful behaviour of the Bhrigus, the Kshatriyas insulted the Brahmanas, though the latter asked for mercy. And those mighty bowmenbegan to slaughter the Bhrigus with their sharp arrows. And the Kshatriyas wandered over the earth, slaughtering even the embryos that were in the wombs of the women of the Bhrigu race.
And while the Bhrigu race was thus being exterminated, the women of that tribe fled from fear to the inaccessible mountains of Himavat. And one amongst these women, of tapering thighs, desiring to perpetuate her husband's race, held in one of her thighs an embryo endued with great energy. A certain Brahmana woman, however, who came to know this fact, went from fear unto the Kshatriyas and reported the matter unto them. And the Kshatriyas then went to destroy that embryo. Arrived at the place, they beheld the would-be mother blazing with inborn energy, and the child that was in her thigh came out tearing up the thigh and dazzling the eyes of those Kshatriyas like the midday sun.
This child was called Aurva since he came out of the thigh of his mother. He is the one who gave rise to the Vadavagni as mentioned in the next section:
And that best of Brahmana Rishis, in consequence of his having been born after tearing open his mother's thigh, came to be known throughout the three worlds by the name of Aurva (thigh-born). And those princes regaining their eye-sight went away. But the Muni Aurva of the Bhrigu race resolved upon overcoming the whole world. And the high-souled Rishi set his heart, O child, upon the destruction of every creature in the world. And that scion of the Bhrigu race, for paying homage (as he regarded) unto his slaughtered ancestors, devoted himself to the austerest of penances with the object of destroying the whole world. And desirous of gratifying his ancestors, the Rishi afflicted by his severe asceticism the three worlds with the celestials, the Asuras and human beings.
The next section of the text tells us that he is stopped from causing all this destruction by the Pitris or ancestors who advise him to cast the Vadava fire in the waters:
The Pitris replied saying, O, throw this fire that is born of thy wrath and that desireth to consume the worlds, into the waters. That will do thee good. The worlds, indeed, are all dependent on water (as their elementary cause). Every juicy substance containeth water, indeed the whole universe is made of water. Therefore, O thou best of Brahmanas, cast thou this fire of thy wrath into the waters. If, therefore, thou desirest it, O Brahmana, let this fire born of thy wrath abide in the great ocean, consuming the waters thereof, for it hath been said that the worlds are made of water. In this way, O thou sinless one, thy word will be rendered true, and the worlds with the gods will not be destroyed.'
"Vasishtha continued, 'Then, O child, Aurva cast the fire of his wrath into the abode of Varuna. And that fire which consumeth the waters of the great ocean, became like unto a large horse's head which persons conversant with the Vedas call by the name of Vadavamukha. And emitting itself from that mouth it consumeth the waters of the mighty ocean. Blest be thou! It behoveth not thee, therefore, to destroy the worlds. O thou Parasara, who art acquainted with the higher regions, thou foremost of wise men!'"
The story of how the fire actually reaches the ocean via Saraswati is detailed in the Skanda Purana Section VII.1. 33. 11-100 & Chapter 34:
Ganga said: 11. O Lord, O master of the worlds, I do not have the
strength to carry Aurva. He is huge and terrific in form. This
Anala (Fire) burns excessively. 12. Thereupon the liberal-minded Lord spoke to Yamuna first, to Sindhu thereafter, and to various rivers severally.
13-15. They were asked by the excellent one among Suras
and they proved unable to take (Aurva). Then Janardana, the
Lord of Devas, spoke to Sarasvati: “O auspicious one, you yourself
go over to the west of the briny sea. If this is carried out, all
the Suras will be rid of their fear. Otherwise they will be burned
by the Vadava through its refulgence. So, save Vibudhas (Suras)
from this terrible fear. O lady of excellent waist, like a mother
^ou alone can bestow freedom from fear on the Suras.”
16-18. On being told thus by Visnu, the powerful one, she
said: “I am not free. My father, the ancient one, is waiting.
Being a daughter and having Vratas to be performed, I can
only do what he orders. A daughter is never independent in
the past, present and future. So learned men say. O Hari,
without the specific command of my father, I will not move
even a step, . So, may some other means be thought of.”
19-20. Having known her attitude, Vasudeva approached
Pitamaha (Brahma) and said: “This is the task of Devas. Carry
it out. Excepting this virgin daughter of yours, without any
apparent defect, no one else can carry the Vadava fire of great
21-23. On hearing the words uttered by Visnu, the Great-
grandfather sniffed the head of his virgin daughter and said
lovingly: “O fair lady, do go. Save all the Devas caught in the
midst of fearful danger. Take this Vadava with you and cast it
into the salt sea.” On hearing her father’s words she said:
Sarasvati said: At your instance, O dear father, I am now setting out
undoubtedly. This Vadava fire is very horrendous. He will consume
24-30. It is the advent of the terrible Kali Age now on the
earth. O Lord, folks of evil conduct will be coming into contact
with me. What can be more painful than contact with sinners!
Brahma said: If you do not like the earth’s surface fully infested with
sinful folks, do take the Vahni (Fire) to the great ocean con-
fining yourself to the Patalatala (nether worlds). If you find yourself exceedingly over-burdened and weary and get scorched by the Vahni pierce through the ground, O dear daughter, and reveal yourself. O lady of wide eyes and excellent waistline, turn your face eastwards. Thereupon, the (other) Tirthas will approach you in that weary state of yours, O lady of charming smiles. O lady of excellent countenance, they will come to you for help. At my bidding thirty-three crores of them will render you help. Do proceed ahead, dear daughter. Do not be worried at any cost. Let your path be free from misfortune and loss. May there be no antagonists.
- On being told thus by Brahma, Sarasvati got rid of her
nervousness and trepidation. Delighted in her mind, she got
ready to go ahead.
The goddess then turns into a river and reached the mountain Himavan and emerging from a PLaksha tree and holding the Vadavagni she rushes towards the ocean:
44-48 With the rapidity of her current, she pierced the ground
and came to the surface of the Earth. Whenever she (the river)
became weary and got scorched by the Vadava fire, the river
became visible in the mortal world. Thereupon, Praci (Eastern quarter) became scorched by the Vadava. Thereat all the Tirthas glorified by the ancient
seers, O beautiful woman, the Tirthas of heaven, intermediate
space and the earth asserted their presence there. On being
consoled by them, the river Sarasvati went over to the nether
worlds to the ocean, the abode of sharks and
crocodiles. O beautiful woman among the Suras, she (river) reached
Khadiramoda and there saw the ocean. Afterwards she took up
the Vahni and began to proceed onwards. She thought of the fact that it was at the behest of the Lord that she had herself taken up the burden and was there-
fore delighted. With a clear conscience, she went ahead facing
Many more adventures happen on the way but by the end of it she is able to deposit the Vadava fire into the ocean at Prabhas.