[PULL REQUEST] VPM-B Attempt 2.

Dirk Hohndel dirk at hohndel.org
Sat Jul 4 05:56:14 PDT 2015


On Sat, Jul 04, 2015 at 10:29:17AM +0200, Jan Darowski wrote:
> Thanks for checking it.
> 
> > But then I checked the configuration parameters adopted, and there are
> > differences.  I altered vpmb_config to match what was used in the Fortran
> > code.
> > critical radius of N2 was 0.6, changed to 0.8 microns
> > critical radius of He was 0.5, changed to 0.7 microns
> > critical volume of lambda was 250, changed to 231.021 bar (=7500 fsw-min)
> 
> eh... from deepocean.net: "7500 fsw min = 250 bar min"
> It's not the first mistake I found there. And it seems that the author
> of existing
> c code based his implementation on this site also.

I cannot begin to tell you how scary that is. People's lifes potentially
depend on these algorithms. And if the author got something as basic as this
wrong, what else is wrong?

> > Using these configuration parameters, we get total dive times of 101 and 125
> > minutes, respectively.  I.e.within 1 minute (which is nothing) of the
> > example dives.  It would be a huge coincidence if the calculations weren't
> > being performed correctly.
> 
> That's nice to hear.

Yes, this is one of the things that I want to make sure we get right.
We have to test things against known good answers.

The challenge is to find a set of "given this profile, here is how the
deco schedule should look. Once we have that it would be fairly easy to
add tests to our existing test framework that simply verify that these
deco schedules are still calculated correctly.

> > I can't claim these configuration parameters are 'better', but with them, we
> > can match the benchmark.  A patch is attached.  You may or may not want to
> > take it: when the Boyles Law adjustment is made, I think the critical radii
> > should be reduced back to how they were, but the lambda parameter should
> > also be reduced to ~200 bar.
> >
> > I also attached a patch to include the units in the config structure, to
> > make it marginally easier to understand what the parameters represent.
> 
> Thanks for the patch, units can be in fact pretty useful.

Yes, I really want us to AT LEAST document units. When Linus started
subsurface he introduced data types that forced you to realize what units
you are working with. That might be something to consider (even though it
makes for longer expressions when typing things in). But it often helps
when reading the code.

I made the mistake of not doing that when I wrote the very first deco plan
implementation (which was based on code from Heinrich & Weikamp). And ever
since we have continued on like that. But I think it would be preferable
to use variable types that are explicit about the units used.

> I guess I need to implement Boyle's law as soon as possible and only
> test against
> the original fortran code...

If there are more known good profiles that can be found to compare with,
that may be what it takes.

/D


More information about the subsurface mailing list