This paper presents a free and open source micro-grid simulation framework for better understanding of power flow behavior in smart microgrids with renewable sources. It is able to simulate grid-connected or standalone microgrids with solar, wind or other renewable energy sources. The proposed software calculates the power generated by each source in the microgrid and can conduct a power flow analysis. This software is helpful for optimal placement of distributed generation units in a micro grid. The software RAPSim is designed for use in science and classroom with a simple to use graphical interface. It is an easily extendable framework that supports users in implementation of their own gridobject models and grid controlling algorithms.