A numerical wave flume to study the functionality and stability of coastal structures