Novel formulation for the effects of sloshing with capillarity on elastic structures in linear dynamics