00001
00002
00003
00004
00005
00006
00007 #include <Intrepid_MiniTensor.h>
00008 #include <Teuchos_TestForException.hpp>
00009 #include <Phalanx_DataLayout.hpp>
00010
00011 namespace LCM
00012 {
00013
00014
00015
00016
00017
00018
00019
00020 template<typename EvalT, typename Traits>
00021 TvergaardHutchinsonModel<EvalT, Traits>::
00022 TvergaardHutchinsonModel(Teuchos::ParameterList* p,
00023 const Teuchos::RCP<Albany::Layouts>& dl) :
00024 LCM::ConstitutiveModel<EvalT, Traits>(p, dl),
00025 delta_1(p->get<RealType>("delta_1", 0.5)),
00026 delta_2(p->get<RealType>("delta_2", 0.5)),
00027 delta_c(p->get<RealType>("delta_c", 1.0)),
00028 sigma_c(p->get<RealType>("sigma_c", 1.0)),
00029 beta_0(p->get<RealType>("beta_0", 1.0)),
00030 beta_1(p->get<RealType>("beta_1", 1.0)),
00031 beta_2(p->get<RealType>("beta_2", 1.0))
00032 {
00033
00034
00035 this->dep_field_map_.insert(std::make_pair("Vector Jump", dl->qp_vector));
00036 this->dep_field_map_.insert(std::make_pair("Current Basis", dl->qp_tensor));
00037
00038
00039 this->eval_field_map_.insert(std::make_pair("Cohesive_Traction", dl->qp_vector));
00040 this->eval_field_map_.insert(std::make_pair("Normal_Traction", dl->qp_scalar));
00041 this->eval_field_map_.insert(std::make_pair("Shear_Traction", dl->qp_scalar));
00042 this->eval_field_map_.insert(std::make_pair("Normal_Jump", dl->qp_scalar));
00043 this->eval_field_map_.insert(std::make_pair("Shear_Jump", dl->qp_scalar));
00044
00045
00046
00047
00048 this->num_state_variables_++;
00049 this->state_var_names_.push_back("Cohesive_Traction");
00050 this->state_var_layouts_.push_back(dl->qp_vector);
00051 this->state_var_init_types_.push_back("scalar");
00052 this->state_var_init_values_.push_back(0.0);
00053 this->state_var_old_state_flags_.push_back(false);
00054 this->state_var_output_flags_.push_back(p->get<bool>("Output Cohesive Traction", false));
00055
00056
00057 this->num_state_variables_++;
00058 this->state_var_names_.push_back("Normal_Traction");
00059 this->state_var_layouts_.push_back(dl->qp_scalar);
00060 this->state_var_init_types_.push_back("scalar");
00061 this->state_var_init_values_.push_back(0.0);
00062 this->state_var_old_state_flags_.push_back(true);
00063 this->state_var_output_flags_.push_back(p->get<bool>("Output Normal Traction", false));
00064
00065
00066 this->num_state_variables_++;
00067 this->state_var_names_.push_back("Shear_Traction");
00068 this->state_var_layouts_.push_back(dl->qp_scalar);
00069 this->state_var_init_types_.push_back("scalar");
00070 this->state_var_init_values_.push_back(0.0);
00071 this->state_var_old_state_flags_.push_back(true);
00072 this->state_var_output_flags_.push_back(p->get<bool>("Output Shear Traction", false));
00073
00074
00075 this->num_state_variables_++;
00076 this->state_var_names_.push_back("Normal_Jump");
00077 this->state_var_layouts_.push_back(dl->qp_scalar);
00078 this->state_var_init_types_.push_back("scalar");
00079 this->state_var_init_values_.push_back(0.0);
00080 this->state_var_old_state_flags_.push_back(true);
00081 this->state_var_output_flags_.push_back(p->get<bool>("Output Normal Jump", false));
00082
00083
00084 this->num_state_variables_++;
00085 this->state_var_names_.push_back("Shear_Jump");
00086 this->state_var_layouts_.push_back(dl->qp_scalar);
00087 this->state_var_init_types_.push_back("scalar");
00088 this->state_var_init_values_.push_back(0.0);
00089 this->state_var_old_state_flags_.push_back(true);
00090 this->state_var_output_flags_.push_back(p->get<bool>("Output Shear Jump", false));
00091
00092 }
00093
00094 template<typename EvalT, typename Traits>
00095 void TvergaardHutchinsonModel<EvalT, Traits>::
00096 computeState(typename Traits::EvalData workset,
00097 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > dep_fields,
00098 std::map<std::string, Teuchos::RCP<PHX::MDField<ScalarT> > > eval_fields)
00099 {
00100
00101
00102 PHX::MDField<ScalarT> jump = *dep_fields["Vector Jump"];
00103 PHX::MDField<ScalarT> basis = *dep_fields["Current Basis"];
00104
00105
00106 PHX::MDField<ScalarT> traction = *eval_fields["Cohesive_Traction"];
00107 PHX::MDField<ScalarT> traction_normal = *eval_fields["Normal_Traction"];
00108 PHX::MDField<ScalarT> traction_shear = *eval_fields["Shear_Traction"];
00109 PHX::MDField<ScalarT> jump_normal = *eval_fields["Normal_Jump"];
00110 PHX::MDField<ScalarT> jump_shear = *eval_fields["Shear_Jump"];
00111
00112 for (std::size_t cell(0); cell < workset.numCells; ++cell) {
00113 for (std::size_t pt(0); pt < num_pts_; ++pt) {
00114
00115
00116 Intrepid::Vector<ScalarT> g_0(3, &basis(cell, pt, 0, 0));
00117 Intrepid::Vector<ScalarT> g_1(3, &basis(cell, pt, 1, 0));
00118 Intrepid::Vector<ScalarT> n(3, &basis(cell, pt, 2, 0));
00119
00120
00121 Intrepid::Vector<ScalarT> t_0(0.0,0.0,0.0), t_1(0.0,0.0,0.0);
00122 t_0 = g_0 / norm(g_0);
00123 t_1 = cross(n,t_0);
00124
00125
00126 Intrepid::Tensor<ScalarT> Q(3, Intrepid::ZEROS);
00127
00128 Q(0,0) = t_0(0); Q(1,0) = t_0(1); Q(2,0) = t_0(2);
00129 Q(0,1) = t_1(0); Q(1,1) = t_1(1); Q(2,1) = t_1(2);
00130 Q(0,2) = n(0); Q(1,2) = n(1); Q(2,2) = n(2);
00131
00132
00133 Intrepid::Vector<ScalarT> jump_global(3, &jump(cell, pt, 0));
00134 Intrepid::Vector<ScalarT> jump_local(3);
00135 jump_local = Intrepid::dot(Intrepid::transpose(Q), jump_global);
00136
00137
00138
00139 ScalarT JumpNormal, JumpShear;
00140 JumpNormal = jump_local(2);
00141 JumpShear = sqrt(jump_local(0)*jump_local(0) + jump_local(1)*jump_local(1));
00142
00143
00144 Intrepid::Tensor<ScalarT> beta(3, Intrepid::ZEROS);
00145 beta(0,0) = beta_0; beta(1,1) = beta_1; beta(2,2) = beta_2;
00146
00147
00148 ScalarT jump_eff;
00149 jump_eff =
00150 std::sqrt(Intrepid::dot(jump_local,Intrepid::dot(beta,jump_local)));
00151
00152
00153 ScalarT sigma_eff;
00154
00155 if(jump_eff <= delta_1)
00156 sigma_eff = sigma_c * jump_eff / delta_1;
00157 else if(jump_eff > delta_1 && jump_eff <= delta_2)
00158 sigma_eff = sigma_c;
00159 else if(jump_eff > delta_2 && jump_eff <= delta_c)
00160 sigma_eff = sigma_c * (delta_c - jump_eff) / (delta_c - delta_2);
00161 else
00162 sigma_eff = 0.0;
00163
00164
00165 Intrepid::Vector<ScalarT> traction_local(3);
00166 traction_local.clear();
00167 if(jump_eff != 0)
00168 traction_local = Intrepid::dot(beta,jump_local) * sigma_eff / jump_eff;
00169
00170
00171 ScalarT TractionShear;
00172 TractionShear = sqrt(traction_local(0)*traction_local(0) + traction_local(1)*traction_local(1));
00173
00174
00175 Intrepid::Vector<ScalarT> traction_global(3);
00176 traction_global = Intrepid::dot(Q, traction_local);
00177
00178 traction(cell,pt,0) = traction_global(0);
00179 traction(cell,pt,1) = traction_global(1);
00180 traction(cell,pt,2) = traction_global(2);
00181
00182
00183 traction_normal(cell,pt) = traction_local(2);
00184 traction_shear(cell,pt) = TractionShear;
00185 jump_normal(cell,pt) = JumpNormal;
00186 jump_shear(cell,pt) = JumpShear;
00187
00188
00189
00190 }
00191 }
00192 }
00193
00194 }
00195