We present an explicit finite-difference method to simulate the nonideal multiphase fluid flow. The local density and momentum transport are modeled by the Navier-Stokes equationsand the pressure is computed by the van der Waals equationof the state. The static droplet and the dynamics of liquid-vapor separation simulations are performed as validations of this numerical scheme. In particular, to maintain the thermodynamic consistency, we propose a general wetting energy boundary condition at the contact line between fluids and the solid boundary. We conduct a series of comparisons between the current boundary condition and the constant contact angle boundary condition as well as the stress-balanced boundary condition. This boundary condition alleviates the instability induced by the constant contact angle boundary condition at θ≈0 and θ≈π. Using this boundary condition, the equilibrium contact angle is correctly recovered and the contact line dynamics are consistent with the simulation by applying a stress-balanced boundary condition. Nevertheless, unlike the stress-balanced boundary condition for which we need to further introduce the interface thickness parameter, the current boundary condition implicitly incorporates the interface thickness information into the wetting energy.