diff --git a/PRIVATE b/PRIVATE index 79929319c..c6536a004 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 79929319c0756bdff58dd69cf4969774a880c1bf +Subproject commit c6536a004dcd9bd883e1dbd38a3a1265b0eda53d diff --git a/examples/config/Kinematics_Thermal_Expansion.config b/examples/config/Kinematics_Thermal_Expansion.config deleted file mode 100644 index 0cedff049..000000000 --- a/examples/config/Kinematics_Thermal_Expansion.config +++ /dev/null @@ -1,2 +0,0 @@ -(kinematics) thermal_expansion -thermal_expansion11 0.0000231 diff --git a/examples/config/Phase_Phenopowerlaw_Aluminum.yaml b/examples/config/Phase_Phenopowerlaw_Aluminum.yaml deleted file mode 100644 index 2a4afb219..000000000 --- a/examples/config/Phase_Phenopowerlaw_Aluminum.yaml +++ /dev/null @@ -1,16 +0,0 @@ -Aluminum: - lattice: cF - mechanical: - output: [F, P, F_e, F_p, L_p, O] - elastic: {C_11: 106.75e9, C_12: 60.41e9, C_44: 28.34e9, type: Hooke} - plastic: - N_sl: [12] - a_sl: 2.25 - dot_gamma_0_sl: 0.001 - h_0_sl-sl: 75e6 - h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4] - n_sl: 20 - output: [xi_sl, gamma_sl] - type: phenopowerlaw - xi_0_sl: [31e6] - xi_inf_sl: [63e6] diff --git a/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.pdf b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.pdf new file mode 100644 index 000000000..c7735b378 Binary files /dev/null and b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.pdf differ diff --git a/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.png b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.png new file mode 100644 index 000000000..1fe54da91 Binary files /dev/null and b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5.png differ diff --git a/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_001.txt b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_001.txt new file mode 100644 index 000000000..fc558c4ec --- /dev/null +++ b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_001.txt @@ -0,0 +1,22 @@ +epsilon sigma +0.0 0.0 +0.0031774515415435856 1.3241572946800098 +0.007632690314496565 1.8769627028448532 +0.012710579645127867 2.398519561282736 +0.01965255325402597 2.7954689602895897 +0.02846634593072725 3.1295345203656986 +0.03852543972278516 3.4011029809878863 +0.05046408737218261 3.671511223179614 +0.062387265442507306 3.8184722243707725 +0.0730612750027072 3.9970685147657115 +0.08749052488281794 4.142482558049593 +0.10065900406849931 4.226946459786829 +0.11382748325418066 4.311410361524061 +0.12824899834475503 4.395100784307658 +0.14705227170768684 4.4452222205033785 +0.16774283371749454 4.555907058768929 +0.1834173847129619 4.638824002598888 +0.19846541775598284 4.722127685905665 +0.21288693284655721 4.805818108689262 +0.23107142304657893 4.918049904862087 +0.24674984143681447 5.031828658942189 diff --git a/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_111.txt b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_111.txt new file mode 100644 index 000000000..cced3b632 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/HosfordEtAl1960_Fig5_111.txt @@ -0,0 +1,21 @@ +epsilon sigma +0.0 0.0 +0.0014874000278452676 2.8375462153674764 +0.004705072474977964 3.514572343486533 +0.008549262874557206 4.191211732128767 +0.013023838621351133 4.898326191544326 +0.016871896415698542 5.605827390436705 +0.022599508067385504 6.312168370898625 +0.028327119719072452 7.018509351360548 +0.036556935785777275 7.692441563665051 +0.0454171371996968 8.396848846742879 +0.0555187723342048 9.00789722011664 +0.06562040746871278 9.6189455934904 +0.07697894590288198 10.260082298160665 +0.08831814736321025 10.746909951580216 +0.09964187924446577 11.110290363999194 +0.112849032377829 11.503372368237859 +0.12291199356465513 11.805802639110189 +0.13548489395603547 12.137547762325386 +0.1461666383057717 12.37786767322061 +0.15810141856040097 12.617414105162197 diff --git a/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.pdf b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.pdf new file mode 100644 index 000000000..0e3688b23 Binary files /dev/null and b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.pdf differ diff --git a/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.png b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.png new file mode 100644 index 000000000..6468f597a Binary files /dev/null and b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b.png differ diff --git a/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_001.txt b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_001.txt new file mode 100644 index 000000000..b5dfb2e37 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_001.txt @@ -0,0 +1,20 @@ +epsilon sigma +0.0 0.0 +0.7843137254901968 12.379237409249356 +1.5686274509803937 24.900436365022188 +2.1568627450980387 35.38463004249314 +2.9411764705882355 46.15655786123972 +3.5294117647058805 55.766115970197575 +4.313725490196077 66.8295889784485 +5.196078431372548 77.30806608357625 +5.980392156862745 86.03917757579222 +6.862745098039216 94.47683835438937 +8.235294117647054 105.23733302844946 +9.411764705882355 113.6692772347034 +10.686274509803923 121.22468034832983 +12.352941176470587 127.89782579698544 +14.215686274509803 134.2756150079079 +16.176470588235293 140.65149869471597 +18.235294117647054 145.2762057203834 +20.392156862745093 148.4412812744145 +22.843137254901958 150.72600468758932 diff --git a/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_111.txt b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_111.txt new file mode 100644 index 000000000..944c9e656 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/Takeuchi1975_Fig3b_111.txt @@ -0,0 +1,22 @@ +epsilon sigma +0.0 0.0 +0.39215686274509665 11.803769126698228 +0.6862745098039191 24.33449570304316 +1.2745098039215677 38.02568646506222 +1.6666666666666679 50.262962327788216 +2.0588235294117645 62.50023819051427 +2.5490196078431353 77.35951523466525 +3.0392156862745097 91.92724708931189 +3.6274509803921546 109.11698012538346 +4.313725490196077 128.34562396387125 +5 144.65881590731527 +5.882352941176471 160.09356123401741 +6.666666666666664 174.94712170582517 +7.6470588235294095 191.8376874559347 +8.627450980392155 208.14516282703556 +9.6078431372549 222.70336706111016 +10.784313725490193 236.0915794889384 +12.549019607843139 251.21762990910648 +14.803921568627448 265.4595171401894 +16.862745098039216 276.498218334953 +20.098039215686274 284.01551096629123 diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.py b/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.py new file mode 100755 index 000000000..22948b3f6 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import os + +import numpy as np +from scipy import interpolate +from matplotlib import pyplot as plt + +import damask + + +# material.yaml +example_dir = Path.home()/'DAMASK/examples/config/phase' + +phase = damask.ConfigMaterial.load(example_dir/'Al.yaml') +phase['mechanical'] = {'output': ['F','P']} +phase['mechanical']['elastic'] = damask.ConfigMaterial.load(example_dir/'mechanical/elastic/Hooke_Al.yaml') +phase['mechanical']['plastic'] = damask.ConfigMaterial.load(example_dir/'mechanical/plastic/phenopowerlaw_Al.yaml') + +mat = damask.ConfigMaterial() +mat['phase']['Al'] = phase +mat['homogenization']['SX'] = {'N_constituents': 1,'mechanical': {'type': 'pass'}} + +# load +load = damask.Config() +load['solver'] = {'mechanical': 'spectral_basic'} +load['loadstep'] = [{'boundary_conditions': {'mechanical': {'dot_F': [[4.5e-3,'x','x'],[0,'x','x'],[0,0,'x']], + 'P': [['x',0,0],['x',0,0],['x','x',0]]}}, + 'discretization': {'t': 65, 'N': 100}}] + +# grid +grid = damask.Grid(np.zeros([2,2,2],int),np.ones(3)*1e-5) + +# crystallographic directions +samples = {'001':[[0,0,1],[0,1,0]],'111':[[1,1,1],[0,1,-1]]} + +# reference results +reference = {} +for label,directions in samples.items(): + ref_data = damask.Table.load('HosfordEtAl1960_Fig5_'+label+'.txt') + reference[label] = [ref_data.get('epsilon')[:,0],ref_data.get('sigma')[:,0]*6894.76e3] # kpsi to Pa + +results = {} +for label,directions in samples.items(): + + os.makedirs(label, exist_ok=True) + + grid.save('/'.join([label,'2x2x2.vti'])) + load.save('/'.join([label,'tensionX.yaml'])) + + ori = damask.Orientation.from_directions(directions[0],directions[1],lattice='cF') + mat_c = mat.material_add(O=ori,phase='Al',homogenization='SX') + mat_c.save('/'.join([label,'material.yaml'])) + + damask.util.execute(f'DAMASK_grid -l tensionX.yaml -g 2x2x2.vti --wd {label}') + + r = damask.Result('/'.join([label,'2x2x2_tensionX.hdf5'])) + r.add_strain() + r.add_stress_Cauchy() + results[label] = [np.array([np.average(epsilon[:,0,0]) for epsilon in r.get('epsilon_V^0.0(F)').values()]), + np.array([np.average(sigma[:,0,0]) for sigma in r.get('sigma').values()])] + + + color = 'tab:blue' if label == '111' else 'tab:orange' + plt.plot(results[label][0],results[label][1],label=label+'_sim',color=color,linestyle=':') + plt.plot(reference[label][0],reference[label][1],label=label+'_exp',color=color,linestyle='-') + plt.savefig('HosfordEtAl1960_Fig5.pdf') diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.yaml b/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.yaml new file mode 100644 index 000000000..729b9352f --- /dev/null +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Al.yaml @@ -0,0 +1,15 @@ +type: phenopowerlaw +references: + - W.F. Hosford et al., + Acta Metallurgica, 8(3), 187-199, 1960, + 10.1016/0001-6160(60)90127-9, + fitted from Fig. 5 +output: [xi_sl, gamma_sl] +N_sl: [12] +h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4] +n_sl: 20 +a_sl: 3.1 +h_0_sl-sl: 1.7e8 +xi_0_sl: [5.0e6] +xi_inf_sl: [37.5e6] +dot_gamma_0_sl: 4.5e-3 diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.py b/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.py new file mode 100755 index 000000000..854a92613 --- /dev/null +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 + +from pathlib import Path +import os + +import numpy as np +from scipy import interpolate +from matplotlib import pyplot as plt + +import damask + + +# material.yaml +example_dir = Path.home()/'DAMASK/examples/config/phase' + +phase = damask.ConfigMaterial.load(example_dir/'Cu.yaml') +phase['mechanical'] = {'output': ['F','P']} +phase['mechanical']['elastic'] = damask.ConfigMaterial.load(example_dir/'mechanical/elastic/Hooke_Cu.yaml') +phase['mechanical']['plastic'] = damask.ConfigMaterial.load(example_dir/'mechanical/plastic/phenopowerlaw_Cu.yaml') + +mat = damask.ConfigMaterial() +mat['phase']['Cu'] = phase +mat['homogenization']['SX'] = {'N_constituents': 1,'mechanical': {'type': 'pass'}} + +# load +load = damask.Config() +load['solver'] = {'mechanical': 'spectral_basic'} +load['loadstep'] = [{'boundary_conditions': {'mechanical': {'dot_F': [[3e-3,'x','x'],[0,'x','x'],[0,0,'x']], + 'P': [['x',0,0],['x',0,0],['x','x',0]]}}, + 'discretization': {'t': 100, 'N': 100}}] + +# grid +grid = damask.Grid(np.zeros([2,2,2],int),np.ones(3)*1e-5) + + +# crystallographic directions +samples = {'001':[[0,0,1],[0,1,0]],'111':[[1,1,1],[0,1,-1]]} + +# reference results +reference = {} +for label,directions in samples.items(): + ref_data = damask.Table.load('Takeuchi1975_Fig3b_'+label+'.txt') + reference[label] = [ref_data.get('epsilon')[:,0]*.01,ref_data.get('sigma')[:,0]*1e6] + +results = {} +for label,directions in samples.items(): + os.makedirs(label, exist_ok=True) + + grid.save('/'.join([label,'2x2x2.vti'])) + load.save('/'.join([label,'tensionX.yaml'])) + + ori = damask.Orientation.from_directions(directions[0],directions[1],lattice='cF') + mat_c = mat.material_add(O=ori,phase='Cu',homogenization='SX') + mat_c.save('/'.join([label,'material.yaml'])) + + damask.util.execute(f'DAMASK_grid -l tensionX.yaml -g 2x2x2.vti --wd {label}') + + r = damask.Result('/'.join([label,'2x2x2_tensionX.hdf5'])) + results[label] = [np.array([np.average(F[:,0,0]-1) for F in r.get('F').values()]), + np.array([np.average(P[:,0,0]) for P in r.get('P').values()])] + + color = 'tab:blue' if label == '111' else 'tab:orange' + plt.plot(results[label][0],results[label][1],label=label+'_sim',color=color,linestyle=':') + plt.plot(reference[label][0],reference[label][1],label=label+'_exp',color=color,linestyle='-') + plt.savefig('Takeuchi1975_Fig3b.pdf') diff --git a/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.yaml b/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.yaml new file mode 100644 index 000000000..a51aa42cf --- /dev/null +++ b/examples/config/phase/mechanical/plastic/phenopowerlaw_Cu.yaml @@ -0,0 +1,15 @@ +type: phenopowerlaw +references: + - T Takeuchi, + Transactions of the Japan Institute of Metals 16(10), 629-640, 1975, + 10.2320/matertrans1960.16.629, + fitted from Fig. 3b +output: [xi_sl, gamma_sl] +N_sl: [12] +h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4] +n_sl: 20 +a_sl: 1.0 +h_0_sl-sl: 2.4e8 +xi_0_sl: [1.5e6] +xi_inf_sl: [112.5e6] +dot_gamma_0_sl: 3e-3