Demo workflows#
These workflow templates are included in MatFlow as demonstrations. You can copy a demo workflow template to somewhere accessible using the CLI like this:
matflow demo-workflow copy WORKFLOW_NAME DESTINATION
where WORKFLOW_NAME
is the name of one of the demo workflows, and DESTINATION
is the
target copy location, which can be a directory (e.g. "."
for the current
working directory, or a full file path).
In the Python API, we can copy a demo workflow template file like this:
import matflow as mf
mf.copy_demo_workflow(name, dst)
fit_yield_funcs#
A workflow to fit yield functions to crystal plasticity simulations.
fit_yield_funcs.yaml
tasks:
- schema: generate_volume_element_from_voronoi
inputs:
homog_label: SX
VE_grid_size: [8, 8, 8]
orientations::from_random:
number: 4
microstructure_seeds::from_random:
box_size: [1, 1, 1]
num_seeds: 4
phase_label: Al
- schema: define_load_case
element_sets:
- inputs:
load_case::uniaxial:
total_time: 100
num_increments: 200
direction: x
target_def_grad_rate: 1.0e-3
- inputs:
load_case::random_3D:
total_time: 100
num_increments: 200
target_def_grad: 1.0e-1
groups:
- name: multiaxial_load_cases
repeats: 6
- schema: simulate_VE_loading_damask
inputs:
homogenization:
SX:
mechanical: {type: pass}
N_constituents: 1
damask_phases:
Al:
lattice: cF
mechanical:
output: [F, P, F_e, F_p, L_p, O]
elastic:
type: Hooke
C_11: 106750000000
C_12: 60410000000
C_44: 28340000000
plastic:
type: phenopowerlaw
N_sl: [12]
a_sl: 2.25
atol_xi: 1
dot_gamma_0_sl: 0.001
h_0_sl-sl: 75.0e+6
h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4]
n_sl: 20
output: [xi_sl]
xi_0_sl: [31.0e+6]
xi_inf_sl: [63.0e+6]
damask_post_processing:
- name: add_stress_Cauchy
args: {P: P, F: F}
opts: {}
- name: add_strain
args: {F: F_p, t: U, m: 0}
opts: {}
VE_response_data:
volume_data:
- out_name: vol_avg_stress
field_name: sigma
transforms: [mean_along_axes: 1]
- out_name: vol_avg_plastic_strain
field_name: epsilon_U^0(F_p)
transforms: [mean_along_axes: 1]
damask_viz:
- schema: fit_yield_function
inputs:
yield_function_name: Hill1948
yield_point_criteria:
threshold: equivalent_plastic_strain
values: [2.0e-3, 1.0e-2]
input_sources:
VE_response[uniaxial]:
- source_type: task
task_ref: simulate_VE_loading_damask
where:
path: inputs.load_case.type
condition:
value.equal_to: uniaxial
VE_response[multiaxial]:
- source_type: task
task_ref: simulate_VE_loading_damask
where:
path: inputs.load_case.type
condition:
value.equal_to: random_3D
tension_DAMASK_Al#
A simple crystal plasticity simulation using DAMASK. A volume element is loading uniaxially.
tension_DAMASK_Al.yaml
tasks:
- schema: generate_microstructure_seeds_from_random
inputs:
VE_size: [1, 1, 1]
num_grains: 4
phase_label: Al
- schema: generate_volume_element_from_voronoi
inputs:
homog_label: SX
VE_grid_size: [8, 8, 8]
- schema: simulate_VE_loading_damask
inputs:
load_case::uniaxial:
total_time: 50
num_increments: 100
direction: x
target_def_grad_rate: 1.0e-3
homogenization:
SX:
mechanical: {type: pass}
N_constituents: 1
damask_phases:
Al:
lattice: cF
mechanical:
output: [F, P, F_e, F_p, L_p, O]
elastic:
type: Hooke
C_11: 106750000000
C_12: 60410000000
C_44: 28340000000
plastic:
type: phenopowerlaw
N_sl: [12]
a_sl: 2.25
atol_xi: 1
dot_gamma_0_sl: 0.001
h_0_sl-sl: 75.0e+6
h_sl-sl: [1, 1, 1.4, 1.4, 1.4, 1.4, 1.4]
n_sl: 20
output: [xi_sl]
xi_0_sl: [31.0e+6]
xi_inf_sl: [63.0e+6]
damask_post_processing:
- name: add_stress_Cauchy
args: {P: P, F: F}
opts: {add_Mises: true}
- name: add_strain
args: {F: F, t: V, m: 0}
opts: {add_Mises: true}
- name: add_strain
args: {F: F_p, t: V, m: 0}
opts: {add_Mises: true}
- name: add_IPF_color
args: {l: [0, 0, 1]}
VE_response_data:
phase_data:
- field_name: sigma_vM
phase_name: Al
out_name: vol_avg_equivalent_stress
transforms: [mean_along_axes: 1]
- field_name: epsilon_V^0(F)_vM
phase_name: Al
out_name: vol_avg_equivalent_strain
transforms: [mean_along_axes: 1]
- field_name: epsilon_V^0(F_p)_vM
phase_name: Al
out_name: vol_avg_equivalent_plastic_strain
transforms: [mean_along_axes: 1]
field_data:
- field_name: phase
- field_name: O
grain_data:
- field_name: O
increments: [values: [0, -1]]
damask_viz:
fields: [F, F_p, P, sigma_vM, IPFcolor_(0 0 1), phase]
increments: [{start: 10, stop: 20, step: 2}]