Real support for multiple concurrent sensors..

Linus Torvalds torvalds at linux-foundation.org
Thu Aug 3 12:03:17 PDT 2017


On Thu, Aug 3, 2017 at 11:41 AM, Linus Torvalds
<torvalds at linux-foundation.org> wrote:
>
> The SAC rate might end up being more complex, but we've never done
> that correctly before, so it's not like it's all that noticeable.

Ok, the SAC rate thing is a nightmare.

There's two different pressures involved: there's the depth pressure,
and there we actually do want to use the pressure_time (and
accumulated pressure_time) to calculate expected SAC rate.

The pressures there are small enough that gas compressibility isn't
even a factor, and "pressure_time" is the right thing to use for the
interpolation factor.

Then there is the cylinder pressure, and there we would instead want
to use the gas _volume_ rather than pressure, because what we're
really trying to interpolate is how much gas volume we're using.

So in "pr_track_struct" and "pr_interpolate_struct", those start/end
fields - that are currently cylinder pressures - should be gas volumes
instead.

It *should* be straightforward to fix, but it just looks nasty to
really do. We don't even have a helper function to turn gas volume
into a pressure value.

The planner tries to do it in update_cylinder_pressure(), but I
actually think it is doing it slightly wrong (it does a "correction
factor", but I think it should probably iterate over that correction
factor until it converges, rather than just doing it once - it uses
the wrong initial pressure to calculate the compressibility factor,
rather than the actual resulting pressure).

I think the single-round correction probably gives the right answer in
practice (especially for small incremental pressure changes), but it
all feels wrong.

Robert Helling is already on the cc, he did that planner code.  Maybe
he has comments.

Anyway, I'll continue to think about this, and maybe I'll get the
energy to try to fix it.

In the meantime, I think the momentary SAC rate will just be slightly
wrong, because those calculations don't take gas compressibility into
account, and just interpolate the cylinder pressure instead.

                   Linus


More information about the subsurface mailing list