One of the challenges of opening up a new craft brewery is figuring out what to do with piles of gunk every new batch of beer leaves behind.

Spent grain is basically the malted barley residue left behind in the brewing process. It’s thick, like mushy oatmeal, and brewers produce so much of it they can’t just throw it in dumpsters.

“How do you get rid of your spent grains? I’m looking to unload at least a 1,000 pounds a week. Any ideas? I’m new.”

Cameron Pryor, cofounder of the new California Wild Ales brewery in Sorrento Valley, posted his question in a craft beer group on Facebook last month. It’s a query that comes up often among those opening new breweries across San Diego County.

Pryor did eventually hook up with a local farmer. Most San Diego breweries have ranchers pick up their spent grain for free. They use it to feed their animals.

Rawley Macias said he hadn’t yet figured out what to do with his spent grain when he opened the doors to his Rouleur Brewing Company in Carlsbad a month ago. He contacted several farmers, but he said he kept hearing that their livestock feed needs were met.

“The skids have been greased and breweries had been working on these relationships with farmers for a long time,” Macias said. “But for new brewers, a lot of farmers want you to be making a lot of grain. They also want you to be brewing a few times a week and stay on that schedule so the pickups can be consistent, but it’s hard as a new brewery because you don’t have the demand yet.”

Without finding a farmer, Macias opened his brewery. Huge barrels of spent grain started piling up. The smell of the rotting beer byproduct started becoming a pungent problem – his landlord and customers complained.

“I had like 16 trash cans of spent grain in my brewery just stinking up the place,” he said.

Eventually, Macias connected with a pig farmer from Valley Center. His spent grain is now picked up soon after it’s produced. He said he’s heard from plenty of other breweries in the region with the same spent grain problem on their hands. His next-door neighbor, in fact, Wiseguy Brewing Co., had a backlog of spent grain until Macias hooked them up with the pig farmer.

Tom Gent, who owns Wiseguy Brewing Co. with his son, said he thinks as more breweries open in a region that already has about 140, it’ll get harder and harder to find folks who want all the spent grain.

“It’s going to be a larger problem on a bigger scale as microbreweries become more and more popular,” he said.

Eric Larson, executive director of the San Diego County Farm Bureau, said he’s already heard from several farmers who say they turn new breweries away. He said while there are a lot of farms in the county, there aren’t many farms filled with animals.

“We have a relatively small amount of livestock because land is expensive here and livestock tends to be raised on inexpensive land,” he said. “So we’re producing a lot of beer here, but not enough animals to eat the spent grain.”

A few, small crafty San Diego companies have come up with creative things to do with spent grain. A homebrewing couple uses their spent grain to make soap. David Crane makes dog treats with spent grain from local breweries. And a new startup company called Upcycle & Company uses spent grain from Ballast Point as one of its main ingredients for fertilizer.

“We just launched but we are already scaling up,” said Upcycle’s director of operations James Griffin. “So we are working with multiple breweries, but we’re still in negotiation stages.”

Councilman Chris Cate, whose district is home to most of the city of San Diego’s breweries, has his eye on the spent grain problem. He said his office has been working on coming up with a more comprehensive solution, at least for breweries within city limits.

Cate said his office is partnering with the Center for Sustainable Energy and UC San Diego. The coalition is working to secure grant funding and eventually build an anaerobic digester at the UCSD campus that could turn the spent grain from city breweries into renewable energy. Essentially, waste creates methane gas, and that gas can be used to power the very same breweries that supplied the spent grain.

“We’ll be powering beer with beer,” Cate said.

He said his office has heard from breweries having a hard time figuring out what to do with spent grain, but there’s another issue – too many breweries are relying on far-away farmers, even some outside the county, to pick up the beer waste. Those long-distance trips don’t align well with the carbon-cutting goals in the city’s Climate Action Plan.

Cate’s office has given a few presentations to the San Diego Brewers Guild to let local brewers know about the future plans for spent grain, and to talk about other sustainable practices, like onsite composting, that breweries can do with the waste. He said they’re also getting ready to survey San Diego brewers to get a better idea of the amount of spent grain being produced.

“We want to come up with a creative solution to address the Climate Action Plan and address the problem our brewers are having when it comes to offloading spent grain,” Cate said.