Day 1:
Virginia to St.Louis, MO (13hrs 850mi)
Sleep= Family (No Cost)
This is doable, but not in the time you have estimated. I have family in NoVA (Fairfax) and it's where we moved from, so it's a trip I make often (2-4 times a year by car) enough to say yes you can do it in a day, but not in 13 hours.....the fastest I've done it is 14.5 hours and that was brutal - stops only for gas, then right back on the highway.
One of the things I do now, to be there in the first day of our trip is to leave the night before and bang out 4-5 hours so in the morning, we're easily within striking distance within the day's driving and have some time to stop and do something. If you can get out the night before your first day - you can get yourself between Lexington, VA and Charleston, WV (if you take the southern route, which is the fastest route). Stay the night in a cheap hotel and then hit the road in the morning with arrival in STL sometime before dinner.
Day 2:
St.Louis to near Denver, CO (12hrs 855)
Sleep= Hotel/Motel outside of Denver (possibly Castle Rock) in order to keep price down.
I promise you this one is impossible in 12 hours unless you can maintain 72mph with no stops at all, not even for gas.
Doable from St. Louis = Hays, KS - and that's still long day to get to from St. Louis, but is doable if you're determined to bang out a large portion in two days. From there, Denver will be about 6 hours - a short enough distance and time to get in and enjoy some of Denver same day and you're rested enough for the drive starting in the morning.
Your route through NV to San Francisco - I'd suggest going the more southern route as there is more to see and do if you go via Las Vegas - but even then your driving timing is much more ambitious than you'll likely be able to do realistically each day. Is there a reason you're going to SF if you have little you want to see or do? You could eliminate it if it's not something you have to do, freeing up time and then you just go from Denver to Yosemite - and that leaves you a few different routes to consider.