Exemple #1
0
 public void setParamDefaults()
 {
     stressDrop = StressDrop.SD_140;
     siteType   = HazardCalculation.ThisScenario.SiteType;
     mag        = HazardCalculation.ThisScenario.Magnitude;
     rRup       = HazardCalculation.ThisScenario.RuptureDistance;
     updateCoeffs();
 }
Exemple #2
0
        private static readonly double facv2     = -0.9295360; // ln(v2/vref)

        private double getMean(int iper, SiteType st, StressDrop sd, double rRup, double mag)
        {
            double vs30 = (st == SiteType.HARD_ROCK) ? 2000 : 760;

            // double sigma = 0.3 * sfac;
            // double sigmaf = 1.0 / SQRT_2 / sigma;

            double period = pd[iper];

            // double H1 = Doubles.max(dtor(kk),2.0);
            // double H1sq = H1*H1;

            // if (magType == LG_PHASE) mag = Utils.mblgToMw(magConvCode, mag);

            double gndm = c1[24] + c2[24] * mag + c3[24] * mag * mag; // pga
                                                                      // reference
            double gndmp = c1[iper] + c2[iper] * mag + c3[iper] * mag * mag;

            double sf2;// , ie; ie apparantly not used

            // if (ir > 2) { // 200 bar
            if (sd == StressDrop.SD_200)
            {
                double diff = Math.Max(mag - m1[iper], 0.0);
                // c sf2 is supposed to be eqn(6) of AB06 paper. Note use of Mw.
                sf2 = stressfac *
                      Math.Min(del[iper] + 0.05, 0.05 + del[iper] * diff /
                               (mh[iper] - m1[iper]));
                // ie = 2;
            }
            else
            {
                sf2 = 0.0;
                // c default stress factor, use ie=1
                // ie = 1;
            }

            // R=sqrt(rjb**2+H1sq)
            // use rRup - NOTE min 2km for gridded, 5km for faults

            // pga calculations
            double rfac = Math.Log10(rRup);
            double f0   = Math.Max(1.0 - rfac, 0.0);
            double f1   = Math.Min(rfac, fac70);
            double f2   = Math.Max(rfac - fac140, 0.0);

            double gnd, S = 0;

            // why this check; is there a NSHMP flag for negative vs?
            if (vs30 > 0)
            {
                // compute pga on rock
                gnd = gndm + (c4[24] + c5[24] * mag) * f1 +
                      (c6[24] + c7[24] * mag) * f2 + (c8[24] + c9[24] * mag) * f0 +
                      c10[24] * rRup + sf2;
                // apply stress factor before nonlinear adjustments, which occur
                // in eqn (7) of ab paper
                double bnl;

                if (vs30 <= v1)
                {
                    bnl = b1[iper];
                }
                else if (vs30 <= v2)
                {
                    bnl = (b1[iper] - b2[iper]) * Math.Log(vs30 / v2) / facv1 +
                          b1[iper];
                }
                else if (vs30 <= vref)
                {
                    bnl = b2[iper] * Math.Log(vs30 / vref) / facv2;
                }
                else
                {
                    bnl = 0.0;
                }

                double pga_bc = Math.Pow(10, gnd);

                if (st == SiteType.HARD_ROCK)
                {
                    S = 0.0;
                }
                else if (pga_bc <= 60.0)
                {
                    S = bln[iper] * Math.Log(vs30 / vref) + bnl * tfac;
                }
                else
                {
                    S = bln[iper] * Math.Log(vs30 / vref) + bnl *
                        Math.Log(pga_bc / 100.0);
                }
                // need to take alog10(exp(S)) according to eqns. 7a and 7b
                // AB2006. p. 2200 BSSA (new nov 26 2007)
                S = Math.Log10(Math.Exp(S));
            }
            gnd = gndmp + (c4[iper] + c5[iper] * mag) * f1 +
                  (c6[iper] + c7[iper] * mag) * f2 + (c8[iper] + c9[iper] * mag) *
                  f0 + c10[iper] * rRup + sf2 + S;
            if (iper < 26)
            {
                gnd = gnd * sfac - gfac;
            }
            else
            {
                // pgv?
                gnd = gnd * sfac;
            }



            return(gnd);
        }