Equilibrium structures and flows of polar and nonpolar liquids in different carbon nanotubes