The development of marine renewable energy is attracting increasing attention due to its great potential in meeting human energy demands with limited negative environment impact. Various wave energy converter concepts have been proposed in attempt to convert wave energy into usable energy. Both experimental and numerical methods have been widely used to investigate the hydrodynamic performance of these devices in operational conditions and their survival characteristics in extreme sea states. This study focuses on developing a numerical procedure that can predict wave loads and run-up on fixed and moving offshore and coastal structures more accurately. The wave induced motions of flap-type wave energy converter (WEC) and its efficiencies are also investigated. The ultimate objectives of the study are to develop a rigorous approach for the safe and cost efficient design of general offshore structures and leading to the better design of wave energy converters with increased efficiency, and provide best practice guideline to the wave energy converter developers and researchers and engineers in the field. Non-linear hydrodynamic modelling in viscous flow has been used in the simulations. Even for moderate waves, nonlinear effects are important due to wave-structure interaction and also the expected large motions under operational conditions. It seems likely that estimates of performance will be unreliable unless the nonlinear effects associated with such large amplitude motions are properly accounted for. Extreme conditions are also be analysed to ensure device integrity.OpenFOAM, a free, open-source CFD package, has been applied in this work due to its strong capability in coastal and offshore engineering. The built-in viscous solvers interFoam and interDyMFoam have been selected and extended to model wave interactions with fixed and moving offshore and coastal structures, respectively. The solvers have been firstly extended to generate various wave conditions, including regular waves, focused wave groups and tsunami waves etc. New module has also been developed to advance the wave absorption capability in attempt to reduce computational cost of the numerical model by using smaller computational domain. In order to simulate the motion of WECs in waves, the code has been further developed to have functions on determining the wave-induced motions of WECs and on updating the computational domain automatically according to the motion of the WEC. By comparing with published experimental data, theoretical and numerical results on various physical problems, including wave interactions with varied seabed, a fixed vertical circular cylinder, a rotating half-submerged rectangular barge and a flap-type wave energy converter etc. it is confident to say that OpenFOAM is very capable of modelling nonlinear wave interactions with coastal and offshore structures accurately.