Virginia Democrats, embroiled in a bitter leadership struggle that has all but eclipsed presidential politics this year, open their state party convention in Richmond tomorrow.And even the most Pollyanna-ish party members are forecasting trouble.

With Jimmy Carter virtually assured of 59 of the state's 64 delegates to the national convention in New York, the focus of the state party gathering has shifted to filling four spots on the Democratic National Committee.

The agenda for the Richmond convention -- expected to attract more than 4,500 delegates and alternates -- gives an indication of how heated the battle for the four posts has become. Just before the convention gets down to the balloting for two national committeemen and two national committeewomen, Northern Virginia's firebrand, Rep. Herbert E. Harris, will be unleashed on the assembly to deliver an aptly timed call for party unity.

The choice of Harris, an avowed liberal, is not without irony, since those familiar with the party infighting say this year's troubles focus on a conservative-led "purge" of party liberals.

"It's like inviting the Christians to the speak before throwing them to the lions," observed State Sen. Frederick C. Boucher, a liberal lawmaker from southwest Virginia.

Although Boucher says he won't make a decision on the committee posts until he gets to the convention, he concedes "the real contest" is between two incumbent committee members -- both liberal -- and four moderates who are being backed as a slate by a committee of 24 influential party members.

Should the committee slate triumph, the losers would be George Rawlings, a Fredericksburg lawyer who lives near Lorton, and Ruth Harvey Charity, of Danville. Both are aligned with the liberal faction of the party that seized control in 1972 -- the George McGovern year -- and have continued to push state Democrats for a liberal approach to party policy-making.

The committee-backed slate, observers say, is considered more moderate than either Rawlings or Charity and more amenable to working with a broader segment of the party.

The slate includes Louis Cunningham, of Lynchburg; state delegates Alan Diamonsteing, of Newport News, and Benjamin Lamber III, of Richmond. The only incumbent committee member on the slate is Fairfax County Supervisor Sandra Duckworth.

Rawlings, according to several Democratic officials, has antagonized many party members and has shown little leadership in building the party organization. The string of Republican gubernatorial and congressional victories in recent years, they say, also hasn't helped advance the liberal banner.

Until recently, Charity was considered less vulnerable to defeat, primarily because Democrats were reluctant to eliminate its first and only black committee member. But with the challenge from Lambert, a black legislator, supporters of the moderate slate believe they can defeat Charity.

Rawlings and Charity both added to the party friction last year, say other Democrats, when they helped organize the liberal Virginia National Democratic Caucus -- just after Portsmouth Mayor Richard Davis, a moderate, was elected state party chairman.

"People look at the leadership Dick Davis has given, while they see Rawlings as having presided over a declining party," said state Sen. Edward M. Holland of Arlington.

Holland aid he had served in the legislature for six years without receiving any party help in his campaigns, until Davis was elected.

Rawlings, for his part, resents those who try to blame the liberals for the party's election defeats. But he admits that the brewing hostilites in the party have left him with only "a 50-50 chance" of keeping his committee post.

"The way to go is to keep pushing ahead," he argued recently, pointing to Northern Virginia's 8th and 10th congressional districts as examples where persistence paid off. "We kept putting up liberals, and they kept getting defeated, until finally we got two good congressmen elected (Harris and 10th District incumbent Joseph L. Fisher)."

At the state convention, Rawlings says, he expects to get the support of most delegates who back Edward M. Kennedy, roughly 20 percent of the delegates. And he's counting on friends in the Carter camp to help him, too, just as they did at regional party caucus last month when he won a seat on the 8th District central committee.

One state party official admits that Rawlings has a certain following among "good liberals" in both the Carter and Kennedy campaigns. But the same official predicts that many liberals will end up voting against Rawlings "because they are tired of the continuous hassle. It's a case of the messenger becoming more of an issue than the message.

The other major convention business of course, will be selection of national convention delegates. In the regional voting so far, Carter has picked up 39 delegates, and Kennedy, five. The remaining 20 at-large delegates, to be elected this weekend, are expected to go to Carter.

Despite the overwhelming support for the president, the unenthusiastic in the Carter camp are becoming more and more concerned about Carter's chances for reelection.

"I'm waving the flag like everybody else," said one legislator, smiling nervously, "but it's crossed my mind to vote for Anderson."