Lets try and analyze this circuit.
You don't say what the amplitude or bias of your square wave is. Lets assume that you have a unipolar square wave between 0 and 10 volts. Lets also assume that the voltage source is ideal.
Lets assume for now that immediately prior to t=0 everything was at 0 and that at t=0 the square wave goes to 10 volts.
each half-cycle lasts \$\frac{1}{120\times10^3}\$ seconds or approximately 8 microseconds.
The diode is reverse biased, so current flow in the diode is negligible. The capacitor starts to charge through the resistor with a current of \$\frac{10}{39*10^3}\$ amps.
If this current was constant then at the end of the first half cycle there would be \$\frac{10}{39*10^3}\times\frac{1}{120*10^3} = \frac{V_\mathrm{peakin}}{4.68\times10^9}\$ colombs of charge in the capacitor. This would result in a voltage of
\$\frac{\frac{10}{4.68\times10^9}}{0.39\times10^{-9}} = \frac{10}{1.8252} \approx 5.47\$ volts.
In practice the voltage will be lower than this and the upslope will not be linear, because as the voltage on the capacitor increases the charge current will decrease. Taking account of this the voltage on our capacitor is actually \$10 \times (1 - e^{-\frac{\frac{1}{120\times10^3}}{39 * 10^3 \times 0.39 \times 10^-9 }}) \approx 4.22\$ volts.
Now the source switches back to zero. The diode is now subject to a forward of 4.22 volts. This will result in a large forward current.
We can model a strongly forward biased diode as a voltage source in series with a resistor. from figure 6 in https://www.mouser.co.uk/datasheet/2/308/1N4148-1118184.pdf we see that a current of 200mA results in a voltage of about 1.05V and a current of 800mA results in a voltage of about 1.45V. Drawing a line through these points gives us an equation of \$V=0.67I+0.95\$
So we have a very large current in the diode, this will rapidly discharge the capacitor. A rule of thumb is that a capacitor is almost completely discharged after 5 time constants. With an effective resistance of about 0.67 ohm our time constant is 0.26 nanoseconds, so within a couple of nanoseconds the capacitor would be mostly discharged.
However the diode can't discharge the capacitor to zero as the current will drop rapidly as the voltage drops through 0.7 volt or so. At this point we will just have the slow discharge from the resistor.
So we have a slightly non-linear upslope, followed by a very rapid downslope to 0.7 volts or so caused by the diode and then a gradual drop-off until the next pulse. In other words we have a crude approximation of a sawtooth wave.