In general to model charging a capacitor in Simulink I would think about it this way.
Go back to fundamentals
The voltage on a capacitor is a function of the total charge it has accumulated. This is the integrated current flowing into the capacitor. So the heart of your capacitor is just an integrator block. So put an integrator block into your model. The input of the integrator block, will be the current feeding the capacitor. I'll get to how you calculate that later. The output of the integrator will be the charge. For a linear capacitor, the voltage will just be the charge divided by the capacitance, C. So connect a gain block to the output of your integrator, and give it a value 1/C. The output of that gain block will now be your voltage. (You could put in some non-linear function, to give v as function of charge if it is not a simple linear capacitor)
Now you have to ask yourself, what determines this current that feeds your integrator. Let's say the current comes out of some kind of voltage source. So put a constant block in your model to represent the voltage source. Let's also assume that the source has some internal losses, represented by a series resitance, Rint. Now lets imagine what happens when we put the capacitor across the battery terminals. The current into the capacitor will be given (by Ohms law) as the ideal source voltage minus the capacitor voltage divided by the resistance. So now back to the Simulink model. To get the current flowing into the capacitor (integrator) you subtract the capacitor voltage (output of the gain block) from the voltage source (constant block) using a summer block (with inputs +-) take the output of that and connect it to a gain with a value of 1/R. The output of that will be the current into the capacitor so connect that to the input to your integrator.
Suppose instead that you want to discharge your capacitor into a load. In that case the current "into" the integrator will be negative. Assuming you discharge into a simple resistive load it will be given by -Vc/Rload (where Vc is the capacitor voltage). So you could do this on your Simulink diagram by connecting the output of your capacitor blocks (the 1/C gain block) which gives the capacitor voltage to a gain block with a value of (-1/Rload). This gives the current and you connect the output of that block to the input of your integrator.
Now if you want to swich from charging to discharging, you could use a Simulink Switch block to select either the output of the source load resistor gain (1/Rint) or the load resitor gain (1/Rload). Note you can keep both resistors connected to the output of the capacitor 1/C gain block.
You can then I think see how to further elaborate this with a second charging source.