def test_minersum(self): """ Test that correct fatigue Miner sum is calculated using bilinear S-N curve. """ c_sea = self.sn_c_sea start, stop = c_sea.fatigue_strength(1e7), c_sea.fatigue_strength(1e5) srange = np.linspace(start, stop, 20) # stress range histogram d = 0.5 # target damage count = np.array([c_sea.n(s) for s in srange]) / srange.size * d self.assertAlmostEqual(minersum(srange, count, c_sea), d, places=8, msg="Wrong fatigue life (damage) from minersum()")
def test_minersum_scf(self): """ Test that correct fatigue Miner sum is calculated using bilinear S-N curve. """ studless = self.sn_studless start, stop = studless.fatigue_strength(1e7), studless.fatigue_strength(1e5) srange = np.linspace(start, stop, 20) # stress range histogram d = 0.5 # target damage (excl. SCF) scf = 1.15 # stress concentration factor d_scf = d * scf ** studless.m # damage incl. SCF count = np.array([studless.n(s) for s in srange]) / srange.size * d self.assertAlmostEqual(minersum(srange, count, studless, scf=scf), d_scf, places=8, msg="Wrong fatigue life (damage) from minersum() with SCF specified")
from math import pi from qats import TsDB from qats.fatigue.sn import SNCurve, minersum # load time series db = TsDB.fromfile(os.path.join("..", "..", "..", "data", "simo_p_out.ts")) # initiate SN-curve: DNVGL-OS-E301 curve for studless chain sncurve = SNCurve(name="Studless chain OS-E301", m1=3.0, a1=6e10) # Calculate fatigue damage for all mooring line tension time series (kN) for ts in db.getl(names='tension_*_qs'): # count tension (discarding the 100s transient) cycles = ts.rfc(twin=(100., 1e12)) # unpack cycle range and count as separate lists (discard cycle means) ranges, _, counts = zip(*cycles) # calculate cross section stress cycles (118mm studless chain) area = 2. * pi * (118. / 2.)**2. # mm^2 ranges = [r * 1e3 / area for r in ranges] # MPa # calculate fatigue damage from Palmgren-Miner rule (SCF=1, no thickness correction) damage = minersum(ranges, counts, sncurve) # print summary print(f"{ts.name}:") print(f"\t- Max stress range = {max(ranges):12.5g} MPa") print(f"\t- Total number of stress ranges = {sum(counts)}") print(f"\t- Fatigue damage = {damage:12.5g}\n")