Last active
February 28, 2017 01:24
-
-
Save cbonsig/4460ed12efb6e5fce78a7e907e9a3338 to your computer and use it in GitHub Desktop.
calculating shear strain from max principal strain and min principal strain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tensors for loading and unloading frame of cycle | |
loadFieldLE = odb.steps[lastStepName].frames[0].fieldOutputs['LE'] | |
loadFieldS = odb.steps[lastStepName].frames[0].fieldOutputs['S'] | |
unloadFieldLE = odb.steps[lastStepName].frames[-1].fieldOutputs['LE'] | |
unloadFieldS = odb.steps[lastStepName].frames[-1].fieldOutputs['S'] | |
# calculate tensor mean and amplitude values | |
meanLE = 0.5*(loadFieldLE+unloadFieldLE) | |
ampLE = 0.5*(loadFieldLE-unloadFieldLE) | |
meanS = 0.5*(loadFieldS+unloadFieldS) | |
ampS = 0.5*(loadFieldS-unloadFieldS) | |
# loading max and min principal strains, shear | |
ldE1 = [] | |
ldE3 = [] | |
ldTau = [] | |
for v in loadFieldLE.values: | |
minPrincipalStrain = v.minPrincipal | |
maxPrincipalStrain = v.maxPrincipal | |
maxTau = abs(maxPrincipalStrain - minPrincipalStrain)/2 | |
ldE1.append(v.minPrincipal) | |
ldE3.append(v.maxPrincipal) | |
ldTau.append(maxTau) | |
# unloading max and min principal strains, shear | |
ulE1 = [] | |
ulE3 = [] | |
ulTau = [] | |
for v in unloadFieldLE.values: | |
minPrincipalStrain = v.minPrincipal | |
maxPrincipalStrain = v.maxPrincipal | |
maxTau = abs(maxPrincipalStrain - minPrincipalStrain)/2 | |
ulE1.append(v.minPrincipal) | |
ulE3.append(v.maxPrincipal) | |
ulTau.append(maxTau) | |
# cyclic strain amplitude, and update maxumum strain amplitude | |
cycEA = [] | |
for v in ampLE.values: | |
cycE3 = v.maxPrincipal | |
cycE1 = v.minPrincipal | |
if abs(cycE3) > abs(cycE1): | |
cycE3abs = cycE3 | |
else: | |
cycE3abs = cycE1 | |
cycEA.append(cycE3abs) | |
if abs(cycE3abs) > abs(cycEAmax): | |
cycEAmax = cycE3abs | |
# cyclic shear strain | |
cycTau = [] | |
for v in ampLE.values: | |
cycE3 = v.maxPrincipal | |
cycE1 = v.minPrincipal | |
tau = abs(cycE3 - cycE1)/2 | |
cycTau.append(tau) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment