To charge a battery with a solar panel connect a charge connector to the solar panel.
Charging battery direct from solar panel.
Add a blocking diode on the positive rail between the battery and the panel or as previously suggested and the best solution imho use a small solar charge controller.
The position of the sun in the sky can impact a panel s charging speed.
Voltage drop in a single panel system as you can see in the calculation the voltage drop is 4 09 which will reduce the overall power delivered to the charge controller.
When sunlight shines directs on a panel the charging speed gets a boost and charging cycles slow down on a cloudy day.
This first stage starts when the sun shines or when the generator is turned on.
For example your solar panel delivers 18 volts dc and 5 8 amps to the charge controller and the wire length is 40 feet.
Generally a fully discharged 12 volt 100ah battery needs 1200 watts of energy to be 100 recharged.
Then run wires from the battery to the charge connector making sure to match the positive and negative poles.
Charge 100ah battery standard size solar panel is 58 inches by 27 inches 2 solar panel for 150 watts 12 volt each for 5 sunshine light hour takes to recharge 100ah 12 volt battery.
If you keep the panel connected as shown in your diagram it will absorb some power when it is not getting sunlight.
The bulk phase will initiate when the battery reaches a low charge stage and that is usually when the charge is below 80.