Ad hoc wireless networks are self-generating and self-organizing networks consisting of mobile and static nodes, which are small and have limited power resources. In a typical setup, these nodes communicate with each other through wireless medium and may act as source, destination and/or relaying nodes. As the power of the remote nodes is depleted very quickly, it is important to have a renewable energy source to support the network operations and increase lifetime. The availability of energy from the environment is unpredictable, random and uncertain, therefore energy harvesting with appropriate management plays an important role in continuous operations of ad hoc networks. In this paper, an energy harvesting and management model is presented for ad hoc networks. Along with harvesting energy, the proposed model ensures the connectivity requirements of the network for its perpetual operation.