Hello and welcome to our community! Is this your first visit?
Register
Results 1 to 4 of 4
  1. #1
    TDF Member huwporter's Avatar
    Join Date
    Jan 2013
    Location
    Sydney, Australia
    Posts
    120
    Likes (Given)
    82
    Likes (Received)
    79

    Schreiner equations for CCR?

    I'm adding CCR functionality to my homemade deco software and I've hit a hurdle;

    The tissue loading equations are straightforward enough for a step at a constant depth. They are the same Buhlmann equations as for open circuit, you just need to work out your PN2 and PHe after taking account of the PPO2 and the proportions of inert gasses in the diluent (code is Python):

    [CODE]
    TissueN2[cntr] = TissueN2[cntr]+(PN2-TissueN2[cntr])*(1-math.pow(2,(-1*(TimeInterval/HalftimesN2[cntr]))))
    TissueHe[cntr] = TissueHe[cntr]+(PHe-TissueHe[cntr])*(1-math.pow(2,(-1*(TimeInterval/HalftimesHe[cntr]))))
    [/CODE]

    Equally, ascent and descent phases are simple enough on OC, using the Schreiner equations together with the fractions of inert gas inspired:

    [CODE]
    TissueN2[cntr] = (FN2*(CurrentPressure-WaterVapour))+(DepthRate*FN2)*(MoveTime-(1/(math.log(2)/HalftimesN2[cntr])))-((FN2*(CurrentPressure-WaterVapour))-TissueN2[cntr]-((DepthRate*FN2)/(math.log(2)/HalftimesN2[cntr])))*math.exp(-1*(math.log(2)/HalftimesN2[cntr])*MoveTime)
    TissueHe[cntr] = (FHe*(CurrentPressure-WaterVapour))+(DepthRate*FHe)*(MoveTime-(1/(math.log(2)/HalftimesHe[cntr])))-((FHe*(CurrentPressure-WaterVapour))-TissueHe[cntr]-((DepthRate*FHe)/(math.log(2)/HalftimesHe[cntr])))*math.exp(-1*(math.log(2)/HalftimesHe[cntr])*MoveTime)
    [/CODE]

    However this assumes FN2 and FHe remain the same throughout the stage - which would only be true OC.

    What I can't find are the equivalent equations for ascent/descent phases on CCR where not only is the pressure changing but so also are the FN2 and FHe - which are changing at a different rate to the pressure change...!

    Every description of Buhlmann I've come across so far (multiple online including the Baker decolessons.pdf, lizardland (thanks Stuart), Deco For Divers etc) only describe the OC equations. Yes, I could fudge it by dividing the stage in to small discrete steps but I'd prefer to use the exact equations if possible.

    To save me attempting to sweat it out with a pencil myself, does anyone happen to have the CCR equivalent for Schreiner?

    Thanks for any leads...
    Last edited by huwporter; 29-11-2017 at 10:04 AM. Reason: Edit - OK, so [CODE] blocks don't work on TDF...

  2. #2
    Established TDF Member nigel hewitt's Avatar
    Join Date
    Sep 2013
    Location
    Brighton, at the Marina end.
    Posts
    2,414
    Likes (Given)
    382
    Likes (Received)
    1634
    I used the Schreiner equations but just deriving the gas rates from the intended start and finish values and the time.
    I felt that as the one thing a rebreather doesn't do well is track the mix on ascent and descent that was near enough.
    I wondered about trying to model the real behaviour but as I tend to manually interfere to get it nearer it was pointless.

    // Process an CCR ascent or descent

    static double ccrtransition(double startDepth, double endDepth, double descentRate, double ppO2)
    {
    double segTime = (endDepth - startDepth)/descentRate; // time taken
    runTime += segTime;
    double startPressure = startDepth*m2b + atm;
    // OK so we need the pp
    double ppInert = startPressure-ppO2-ppWaterVapour;
    double rHe=gas[gtable[0].mix].he, rN2=gas[gtable[0].mix].n2(); // fractions
    // initial pressures
    double ppiHe=rHe*ppInert/(rHe+rN2);
    double ppiN2=rN2*ppInert/(rHe+rN2);
    // do that again for the end pressures
    double endPressure = endDepth*m2b + atm;
    double ppI = endPressure-ppO2-ppWaterVapour;
    double ppeHe=rHe*ppI/(rHe+rN2);
    double ppeN2=rN2*ppI/(rHe+rN2);

    double heliumRate = (ppeHe - ppiHe)/segTime; // rate in meters/min
    double nitrogenRate = (ppeN2 - ppiN2)/segTime;

    // now add it to the compartments using the Schreiner equation
    for(int i=0; i<COMPARTMENTS; i++){
    comp[i].he = ppiHe + heliumRate*(segTime - 1.0/helium[i].k) - (ppiHe - comp[i].he - heliumRate/helium[i].k)*exp(-helium[i].k*segTime);
    comp[i].n2 = ppiN2 + nitrogenRate*(segTime - 1.0/nitrogen[i].k) - (ppiN2 - comp[i].n2 - nitrogenRate/nitrogen[i].k)*exp(-nitrogen[i].k*segTime);
    }
    return segTime;
    }
    Helium, because I'm worth it.
    Waterboarding at Guantanamo Bay sounded like a radical holiday opportunity until I looked it up.

  3. #3
    TDF Member huwporter's Avatar
    Join Date
    Jan 2013
    Location
    Sydney, Australia
    Posts
    120
    Likes (Given)
    82
    Likes (Received)
    79
    Thanks Nigel - yeah, I agree that approximating would be totally fine for real world use (measure with a micrometer, mark with a pencil, cut with an axe...) I'd still like to do it 'properly'. I'm just wishing my calculus classes were slightly fewer decades ago.

    Edit - actually, continuing to think about it, the solution might be to ignore the actual ambient pressure change, and feed the existing Schreiner equations an effective pressure change derived from the rate of change of inert gasses in the dil.
    Last edited by huwporter; 29-11-2017 at 08:11 PM.

  4. #4
    TDF Member
    Join Date
    Jan 2013
    Location
    South of France
    Posts
    273
    Likes (Given)
    61
    Likes (Received)
    70


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •