K-factors for gradual contraction and enlargement
The publication Flow of fluids through valves, fittings, and pipe (Crane)1 is the bible of hydraulics, and many of us use it daily for pressure drop calculations. It’s probably worked into the templates you’ve used a thousand times. More than likely however there has been some simplification and your tool probably assumes you are using sudden enlargements/reducers. This is more conservative in terms of frictional pressure loss of course, but it situations where we want to be more accurate we can start to look at the angle of divergence.
Here is a brief extract from the Crane method on calculation of K-factor for gradual enlargement/reduction:

Info
Where subscript 1 for diameter indicates the smaller diameter, and 2 the larger diameter.
To determine K-factor we are required to calculate the angle of divergence

Angle of divergence
Re-arranged to find reducer length
Footnotes
-
Technical paper 410M (Crane’s website) ↩