here more option is given to the user to select from damask python package itself.
Author: Yang Bai
Date : 23.02.2022
from pyiron_continuum import Project
from damask import Rotation # this will be used in material configuration
pr = Project('isotropic')
pr.remove_jobs_silently(recursive=True) # automatically delete the existing project folder
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 21.97it/s]
job = pr.create.job.DAMASK('damask_job')
elasticity = pr.continuum.damask.Elasticity(type= 'Hooke', C_11= 106.75e9,
C_12= 60.41e9, C_44=28.34e9)
plasticity = pr.continuum.damask.Plasticity(type='isotropic',dot_gamma_0=0.001,
n=20.,xi_0=0.3e+6,
xi_inf=0.6e+6,a=2.,
h_0=1.e+6, # hardening modulus
M=1.,h=1.,
dilatation=True,output=['xi'])
# for the details of isotropic model, one is referred to https://doi.org/10.1016/j.scriptamat.2017.09.047
phase = pr.continuum.damask.Phase(composition='Aluminum', lattice= 'cF',
output_list=['F', 'P', 'F_e', 'F_p', 'L_p', 'O'],
elasticity=elasticity,plasticity=plasticity)
rotation = pr.continuum.damask.Rotation(Rotation.from_random, 4)
homogenization = pr.continuum.damask.Homogenization(method='SX',
parameters={'N_constituents': 1,
"mechanical": {"type": "pass"}})
# now you can define your material.yaml configuration
material = pr.continuum.damask.Material([rotation],['Aluminum'], phase, homogenization)
# now you can save your material to your job
job.material = material
grid = pr.continuum.damask.Grid.via_voronoi_tessellation(box_size=1.0e-5, grid_dim=16, num_grains=4)
# save the geometry information to your job
job.grid = grid
load_step =[{'mech_bc_dict':{'dot_F':[1e-3,0,0, 0,'x',0, 0,0,'x'],
'P':['x','x','x', 'x',0,'x', 'x','x',0]},
'discretization':{'t': 40.,'N': 20},
'additional': {'f_out': 5}
},{'mech_bc_dict':{'dot_F':[1e-3,0,0, 0,'x',0, 0,0,'x'],
'P':['x','x','x', 'x',0,'x', 'x','x',0]},
'discretization':{'t': 60.,'N': 20},
'additional': {'f_out': 5}
}]
solver = job.list_solvers()[0] # choose the mechanis solver
job.loading = pr.continuum.damask.Loading(solver=solver, load_steps=load_step)
job.run() # running your job, if you want the parallelization you can modify your 'pyiron/damask/bin/run_damask_3.0.0.sh file'
The job damask_job was saved and received the ID: 15
██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00 ██████████████████████████████████████████████████ 100% ETA 0:00:00
# plot the strain_xx vs stress_xx profile
job.plot_stress_strain(component='xx')
(<Figure size 432x288 with 1 Axes>, <AxesSubplot:xlabel='$\\varepsilon_x$$_x$', ylabel='$\\sigma_x$$_x$(Pa)'>)
# plot the vonMises-strain vs vonMises-stress profile
job.plot_stress_strain(von_mises=True)
(<Figure size 432x288 with 1 Axes>, <AxesSubplot:xlabel='$\\varepsilon_{vM}$', ylabel='$\\sigma_{vM}$ (Pa)'>)
job.writeresults2vtk() # you can also save all the field quantities to vtk files
██████████████████████████████████████████████████ 100% ETA 0:00:00