* Goldman Sachs says 23 pct of U.S. refining capacity is shut
* Crude dips on expected fall in demand from refineries
* Gasoline hits more than two-year high
* API says U.S. crude inventories fell, EIA report due (Updates prices, adds quote para 7)
LONDON, Aug 30 (Reuters) - Crude oil slid and gasoline futures hit their highest since mid-2015 on Wednesday as flooding and damage from Tropical Storm Harvey shut nearly a fifth of U.S. refineries, curbing demand for crude while raising the risk of fuel shortages.
Refineries with output of 4.1 million barrels per day (bpd) were offline on Tuesday, representing 23 percent of U.S. production, Goldman Sachs said. Restarting plants even under the best conditions can take a week or more.
"It will be a while before operations can return to normal and the U.S. refining industry is bracing itself for an extended shutdown," Stephen Brennock of oil broker PVM said.
Brent oil, the international benchmark for crude trading, was down 43 cents at $51.57 a barrel by 1017 GMT. U.S. crude fell 25 cents to $46.19.
In refined products, price movement was more dramatic. The largest refinery in the United States was shutting because of flooding, sources familiar with operations said.
U.S. gasoline futures were up 2.8 percent at $1.8339 a gallon. Prices had touched $1.8422, the highest since July 2015. Diesel futures advanced by 0.9 percent to $1.6805 a gallon, having touched their highest since Jan. 9 at $1.6966.
"Crude is always easier to replace than products," said Olivier Jakob, analyst at Petromatrix. "If the refineries stay shut for more than a week or 10 days, it's going to be very problematic."
Harvey made landfall on Friday as the most powerful hurricane to hit Texas in more than 50 years, resulting in the death of at least 17 people.
In addition to shutting oil refineries, about 1.4 million bpd of U.S. crude production has been disrupted, equivalent to 15 percent of total output, Goldman Sachs said.
The impact of the storm overshadowed the latest weekly figures on U.S. oil supplies from the American Petroleum Institute (API).
U.S. crude inventories fell by 5.78 million barrels last week, the API industry group reported on Tuesday, suggesting a gradual tightening of the U.S. oil market. The figures, however, do not reflect the impact from Harvey.
Traders are awaiting the latest U.S. government inventory report, due at 1430 GMT from the Energy Information Administration, to compare with the API figures.
(Additional reporting by Henning Gloystein; Editing by Dale Hudson)