Quantities and costs
packages/costing adds up what's drawn. It's pure, so the same numbers come out wherever it runs.
Quantities
Everything but one number comes from the design itself.
- Pipe: length by size and material, with how much of each is lateral, submain or main. The size is the one the pipe is sold as, which is what it's bought by.
- Fittings: an end cap at the upstream end of each new drain (where no pipe arrives in the full drawing). Where pipes come together into a single new pipe leaving the node, all pipes arriving in the full drawing—existing and new—set the connection: the largest coming in is the run, each of the others is a tee off the size leaving, and a reducer goes wherever the run changes size. Existing pipes get no fittings of their own, so a new pipe draining into an existing main counts only the tie-in structure, while a tie-in fed by existing pipe gets no end cap and a junction where old and new pipe feed a new main counts its tee. These go by the sizes the pipes are sold as, so a 4 in pipe that measures 3.94 in inside meeting one that measures 4 in needs no reducer. Couplings aren't counted, since they depend on what length the pipe comes in.
- Structures: outlets, surface inlets, lift stations, control structures and tie-ins.
- Trench: length by depth from the ground to the bottom of the pipe, in bands of 0 to 4, 4 to 6, 6 to 8, 8 to 10 and over 10 ft. These are only for sorting what's measured, since depth is what changes how a trench gets dug. Takeoff and the deep-trench surcharge share one interval walker: each sample interval is split at intervening invert grade breaks and threshold crossings so lengths are exact for linear depth (adding an intermediate ground sample on a straight profile does not move them), and any stretch with missing ground samples or no elevations is never bridged or guessed—it is left out of bands, excavation volume, and deep-trench footage and counted as unmeasured length.
Digging is the exception. How much ground gets dug and put back depends on the trench's width, which isn't in the design, so 2 ft is assumed and it says so. A plow digs none at all.
Estimates
Every price starts as a placeholder. They're made up so that the estimate adds up, and aren't anyone's quote. The estimate counts how many it's using and says so at the top, until someone enters their own. A price that's entered is kept per project and copied with it, and clearing one makes it a placeholder again. A zero that's entered counts as a price.
| What | How it's charged | Kind |
|---|---|---|
| Pipe | Per foot, by product, or else by size | Material |
| Fittings | Each, by size | Material |
| Structures | Each, by kind | Material |
| Labor | Hours at the rate it goes in, times the hourly rate | Labor |
| Equipment | The same hours, times its hourly rate | Equipment |
| Past 6 ft deep | Per foot of trench deeper than that | Equipment |
A pipe is priced as the product it is. Single wall and dual wall pipe of one size are two prices, and comparing product lines means nothing if they share one. So each product in a design has a line of its own, named for its size and product line, and a price entered there applies to that product alone. A pipe with no product is priced by its size.
A product with no price of its own takes the first of these that someone has entered:
- A price entered under its inside diameter, where that differs from the size it's sold as. Prices used to be kept that way, so one of these was entered for exactly this pipe.
- The price for the size it's sold as, such as "4 in pipe". This is how every price was entered before products had their own, and it still covers any product that doesn't.
- Failing those, the placeholder for its size.
The list of prices shows the size's price first and each product under it. A product's row says what it's using while it's empty, and a placeholder is labeled as one on every row it applies to.
Size means the size a pipe is sold as, not what it measures inside. A product's comes from the catalog. A pipe with no product, or one the catalog no longer has, is read from its inside diameter: within 5% of a whole inch, it's that size, and otherwise it's priced by its own diameter to a tenth of an inch. The 5% is our judgment, not a standard's. Tile is sold by the whole inch and a bore is a few percent off it, while the nearest two sizes, 5 and 6 in, are 20% apart. Fittings are priced by the same sizes. Before this, a 4 in pipe that measured 3.94 in was priced as "3.9 in pipe" and missed the price entered for 4 in.
Prices are kept by key, one row per project and key, so none of this changed how they're stored:
| Key | What it prices |
|---|---|
pipe_product:<product id> |
A foot of one catalog product |
pipe:<inches> |
A foot of any pipe sold as that size |
end_cap:<inches>, tee:<run>x<branch>, reducer:<a>x<b> |
A fitting, by the sizes of the pipe it's on |
outlet, inlet, lift_station, control_structure, tie_in |
One of each |
install_ft_per_hour, labor_per_hour, equipment_per_hour, deep_per_ft |
How it goes in |
A pipe with no size has no price for its material, though putting it in still counts. So an estimate for an unsized design is low, and sizing it raises the total.
Every dollar lands on one line, one field and one phase, so adding it up any of those ways comes to the same total. A pipe counts toward the field its middle is in and a fitting toward the one it's in, and anything outside the fields shows as that.
The per-acre figure is over what's drained, not the field's whole area.
Metrics
These are what designs get compared by.
- Meets the target water table: the share of the land within half a spacing of a drain, at the spacing its soil calls for. That spacing is what's worked out to meet the target, so this is the share that does, assuming the soil's what NRCS's estimates say.
- Lateral per acre: feet of lateral for each acre drained, as a measure of how intense the system is.
- Outlet pipe can carry: what the pipes into the outlets can carry when flowing full, over what's drained, as a drainage coefficient. It's blank if any of them has no capacity yet, since a total missing one would read too low.
- Deepest pipe: from the ground to the bottom of the pipe, at the deepest point of any.
Following edits
The design panel keeps the total in view, with how much the last edit moved it. It goes by what the total settles at once sizes and grades have caught up with an edit, and a change of price doesn't count as one. A selected pipe says what it comes to in the ground: pipe, labor, equipment and any deep trench, but not the fittings it shares with the pipes it meets.
Returns
The spec asks for "estimated yield benefits and return calculations using explicit, user-editable assumptions", so all of the assumptions are the person's own and none has a default: extra yield, price, extra costs from growing more, years to count, and a discount rate. Results appear once they're all entered.
From the investment, which is the estimate as it stands, and the land the design drains:
- A year's net is drained acres × extra yield × price, less drained acres × extra costs and any pumping cost worked out for a lift station.
- Payback is the investment over a year's net, not discounted.
- Net present value is the steady net discounted over the years counted, less the investment.
- Rate of return is the discount rate where that comes to zero, found by bisection. It says "none" if the design doesn't get back what it cost in the years counted, rather than a negative rate.
It's a steady return every year, starting the year after it goes in. It leaves out taxes, financing, yield that takes time to build, and years where tile makes no difference, any of which could change the answer. It says when the investment rests on placeholder prices.
Comparing scenarios
"Compare" works out every scenario as it was saved, by the same engine with the same fields, soils, criteria, prices and assumptions, and sets them side by side: cost, capacity, performance, what's wrong with each and what it returns. Bold marks the best of a row, where lower or higher is plainly better, and nothing is bold where they're all level or it's a matter of taste, like how much pipe there is. It's a snapshot from when it was opened, not something that follows every edit.