Capacitor quenching circuit across Brush and Commutator of DC motor
The device you have drawn is called an RC snubber. Since you have a mechanical engineering background, I'll explain it as a mechanical analogy.

If there was some current in the inductor, and then the switch opens, the current must keep flowing. An inductor is like a flywheel: as a flywheel's speed can not change instantaneously (as that would require infinite force), and the current through an inductor can not change instantaneously (as that would require infinite voltage).

So to avoid very high voltages (which usually result in undesirable arcing, melting semiconductors, etc), we must gently, not abruptly decrease the current. The capacitor provides a path for that to happen.

The capacitor and resistor across the switch are like a spring and some friction. If you connect a spinning flywheel to a torsion spring, you end up with an oscillation between kinetic energy in the flywheel and elastic potential energy in the spring. Friction dampens the oscillation, producing heat.

The energy that was stored in the inductor draws a current through the two, and as current passes through the capacitor, the voltage across the capacitor increases, and so the energy that was stored in the inductor is transferred to the capacitor.

Eventually all the inductor's energy has been transferred to the capacitor, and now the voltage built up in the capacitor drives a current (this time in the opposite direction) through the inductor. This process repeats, and so the energy oscillates between the capacitor and inductor.

This would continue forever, but the resistor adds a loss of energy to heat, and so the oscillation is damped.

The resistor, capacitor, and inductor make a series RLC circuit, and you can read more about the math there. If you are familiar with any kind of damped mechanical oscillation, you'll see it's essentially the same differential equations.