TL;DR: You're defending coastal medieval fortress with help of about 1000 people from attack of zombies.
Long version: In my fantasy world, I'm dealing with problem of how would you defend city against zombies. Defenders are very limited in terms of magic and thus, for the purpose of the scenario, it can be treated as medieval defence.
Zombies on the other hand, are low tier magical undead. They are basically corpses, who are reanimated and conserved with magic. Their principle of reanimation uses original muscles of the body, but they feel no pain. To stop them you need to either destroy their head (which is used by magic as core of reanimation) or at least destroy the muscles. In terms of strength, they might be somewhat stronger than normal human, but not by much, and with limited movement coordination, they actually pose threat only due to large numbers.
I'm thinking about what kind of defensive siege weapons could be used to defend against them? For example: Is heated sand hot enough to cause serious damage to muscles, or does it only do surface damage that wouldn't affect such zombies? Are there any wise strategies that you could employ in event of such castle defence?
In this scenario, we're talking about a case where a castle built on a small peninsula, which only needs to be defended from the land-side. About a thousand of defenders is forced to deal with around three thousand zombies a night, for a few days. While zombies aren't fast nor smart, and tall walls of the castle are barrier they can't break, they can actually climb on the walls, with principle similar to geckos.
Additional Details: City wasn't built to defend against zombie invasion. Weapons it has are meant to deal with mortal demihuman invaders, so are the walls. Firearms are not a thing. Niche ideas based on modern knowledge are useful, but provided it's something that can be done quickly improvised.
Thank you in advance.