15 #include "libmesh/edge_edge2.h" 16 #include "libmesh/serial_mesh.h" 17 #include "libmesh/mesh_tools.h" 29 "mesh and uses fracture integrals to determine growth");
31 "Length to grow crack if k>k_critical or stress>stress_threshold");
32 params.
addParam<
Real>(
"k_critical",
"Critical fracture toughness.");
33 params.
addParam<
Real>(
"stress_threshold",
"Stress threshold for growing crack");
34 params.
addParam<VectorPostprocessorName>(
35 "ki_vectorpostprocessor",
"II_KI_1",
"The name of the vectorpostprocessor that contains KI");
36 params.
addParam<VectorPostprocessorName>(
"kii_vectorpostprocessor",
38 "The name of the vectorpostprocessor that contains KII");
39 params.
addParam<VectorPostprocessorName>(
40 "stress_vectorpostprocessor",
41 "The name of the vectorpostprocessor that contains crack front stress");
42 params.
addParam<std::string>(
"stress_vector_name",
44 "The name of the stress vector in the stress_vectorpostprocessor");
45 params.
addParam<VectorPostprocessorName>(
46 "k_critical_vectorpostprocessor",
47 "The name of the vectorpostprocessor that contains critical fracture toughness at crack tip");
49 "k_critical_vector_name",
50 "The name of the k_critical vector in the k_critical_vectorpostprocessor");
56 _growth_increment(getParam<
Real>(
"growth_increment")),
57 _use_k(isParamValid(
"k_critical") || isParamValid(
"k_critical_vectorpostprocessor")),
58 _use_stress(isParamValid(
"stress_threshold")),
59 _k_critical(isParamValid(
"k_critical") ? getParam<
Real>(
"k_critical")
61 _stress_threshold(_use_stress ? getParam<
Real>(
"stress_threshold")
63 _ki_vpp(_use_k ? &getVectorPostprocessorValue(
64 "ki_vectorpostprocessor",
65 getParam<VectorPostprocessorName>(
"ki_vectorpostprocessor"))
67 _kii_vpp(_use_k ? &getVectorPostprocessorValue(
68 "kii_vectorpostprocessor",
69 getParam<VectorPostprocessorName>(
"kii_vectorpostprocessor"))
71 _stress_vpp(_use_stress
72 ? &getVectorPostprocessorValue(
"stress_vectorpostprocessor",
73 getParam<
std::string>(
"stress_vector_name"))
76 isParamValid(
"k_critical_vectorpostprocessor")
77 ? &getVectorPostprocessorValue(
"k_critical_vectorpostprocessor",
78 getParam<
std::string>(
"k_critical_vector_name"))
83 "Must set crack extension criterion with k_critical, k_critical_vectorpostprocessor " 84 "or stress_threshold.");
88 "Fracture toughness cannot be specified by both k_critical and " 89 "k_critical_vectorpostprocessor.");
115 mooseError(
"ki_vectorpostprocessor and kii_vectorpostprocessor should have the same number of " 116 "crack tips as CrackFrontDefinition.",
121 "\n cracktips in MeshCut2DFractureUserObject = ",
125 mooseError(
"stress_vectorpostprocessor should have the same number of crack front points as " 126 "CrackFrontDefinition. If it is empty, check that CrackFrontNonlocalStress " 127 "vectorpostprocess has execute_on = TIMESTEP_BEGIN",
128 "\n stress_vectorpostprocessor size = ",
130 "\n cracktips in MeshCut2DFractureUserObject = ",
134 mooseError(
"k_critical_vectorpostprocessor must have the same number of crack front points as " 135 "CrackFrontDefinition.",
136 "\n k_critical_vectorpostprocessor size = ",
138 "\n cracktips in MeshCut2DFractureUserObject = ",
150 if (k_squared > (k_crit * k_crit) &&
_ki_vpp->at(i) > 0)
156 Real sqrt_k = std::sqrt(ki * ki + kii * kii);
157 Real theta = 2 * std::atan((ki - sqrt_k) / (4 * kii));
159 dir_cfc(0) = std::cos(theta);
160 dir_cfc(1) = std::sin(theta);
166 Point dir_global_pt(dir_global(0), dir_global(1), dir_global(2));
178 Point dir_global_pt(dir_global(0), dir_global(1), dir_global(2));
void isCutterModified(const bool is_cutter_modified)
Set the value of _is_cutter_modified.
MeshCut2DFractureUserObject(const InputParameters ¶meters)
const std::vector< Real > *const _kii_vpp
Pointer fracture integral kii if available.
const Real & _growth_increment
amount to grow crack by for each xfem update step
const bool _use_k
are fracture integrals used for growing crack
virtual void findActiveBoundaryGrowth() override
Find growth direction at each active node
static InputParameters validParams()
const std::vector< Real > *const _stress_vpp
Pointer to crack front stress if available.
std::vector< std::pair< dof_id_type, dof_id_type > > _original_and_current_front_node_ids
This vector of pairs orders crack tips to make the order used in this class the same as those for the...
virtual void initialize() override
void updateNumberOfCrackFrontPoints(const std::size_t num_points)
Change the number of crack front nodes.
auto max(const L &left, const R &right)
registerMooseObject("XFEMApp", MeshCut2DFractureUserObject)
bool isParamValid(const std::string &name) const
RealVectorValue rotateFromCrackFrontCoordsToGlobal(const RealVectorValue vector, const std::size_t point_index) const
Rotate a vector from crack front cartesian coordinate to global cartesian coordinate.
static InputParameters validParams()
MeshCut2DUserObjectBase: (1) reads in a mesh describing the crack surface, (2) Fills xfem cut element...
void paramError(const std::string ¶m, Args... args) const
MeshCut2DFractureUserObject: (1) reads in a mesh describing the crack surface (2) uses the mesh to do...
const bool _use_stress
is stress used to grow crack
void addNucleatedCracksToMesh()
Calls into MeshCutNucleation UO to add cracks.
const std::vector< Real > *const _ki_vpp
Pointer fracture integral ki if available.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _stress_threshold
Maximum stress criterion threshold for crack growth.
bool _is_mesh_modified
Indicator that shows if the cutting mesh is modified or not in this calculation step.
void mooseError(Args &&... args) const
const std::vector< Real > *const _k_critical_vpp
Pointer to crack front critical k if available.
void growFront()
grow the cutter mesh
const Real _k_critical
critical k value for crack growth
std::vector< std::pair< dof_id_type, Point > > _active_front_node_growth_vectors
contains the active node ids and their growth vectors
CrackFrontDefinition * _crack_front_definition
user object for communicating between solid_mechanics interaction integrals and xfem cutter mesh ...