00001
00002
00003
00004
00005
00006 #include "ThermoPoroPlasticityProblem.hpp"
00007
00008 #include "Intrepid_FieldContainer.hpp"
00009 #include "Intrepid_DefaultCubatureFactory.hpp"
00010 #include "Shards_CellTopology.hpp"
00011
00012 #include "Albany_Utils.hpp"
00013 #include "Albany_ProblemUtils.hpp"
00014
00015 #include "Albany_EvaluatorUtils.hpp"
00016 #include "PHAL_AlbanyTraits.hpp"
00017
00018
00019 Albany::ThermoPoroPlasticityProblem::
00020 ThermoPoroPlasticityProblem(const Teuchos::RCP<Teuchos::ParameterList>& params_,
00021 const Teuchos::RCP<ParamLib>& paramLib_,
00022 const int numDim_) :
00023 Albany::AbstractProblem(params_, paramLib_, numDim_ + 2),
00024
00025
00026 haveSource(false),
00027 numDim(numDim_)
00028 {
00029
00030 std::string& method = params->get("Name", "Total Lagrangian ThermoPoroPlasticity ");
00031 *out << "Problem Name = " << method << std::endl;
00032
00033 haveSource = params->isSublist("Source Functions");
00034
00035 matModel = params->sublist("Material Model").get("Model Name", "Neohookean");
00036
00037
00038
00039 #ifdef NUMBER_T_FIRST
00040 T_offset=0;
00041 TEMP_offset = 1;
00042 X_offset=2;
00043 #else
00044 X_offset=0;
00045 T_offset=numDim;
00046 TEMP_offset = numDim + 1;
00047 #endif
00048
00049
00050
00051
00052 int numScalar = 2;
00053 int nullSpaceDim = 0;
00054 if (numDim == 1) {nullSpaceDim = 0; }
00055 else {
00056 if (numDim == 2) {nullSpaceDim = 3; }
00057 if (numDim == 3) {nullSpaceDim = 6; }
00058 }
00059
00060 rigidBodyModes->setParameters(numDim + 2, numDim, numScalar, nullSpaceDim);
00061
00062 }
00063
00064 Albany::ThermoPoroPlasticityProblem::
00065 ~ThermoPoroPlasticityProblem()
00066 {
00067 }
00068
00069 void
00070 Albany::ThermoPoroPlasticityProblem::
00071 buildProblem(
00072 Teuchos::ArrayRCP<Teuchos::RCP<Albany::MeshSpecsStruct> > meshSpecs,
00073 Albany::StateManager& stateMgr)
00074 {
00075
00076 TEUCHOS_TEST_FOR_EXCEPTION(meshSpecs.size()!=1,std::logic_error,"Problem supports one Material Block");
00077 fm.resize(1);
00078 fm[0] = Teuchos::rcp(new PHX::FieldManager<PHAL::AlbanyTraits>);
00079 buildEvaluators(*fm[0], *meshSpecs[0], stateMgr, BUILD_RESID_FM,
00080 Teuchos::null);
00081 constructDirichletEvaluators(*meshSpecs[0]);
00082 }
00083
00084 Teuchos::Array<Teuchos::RCP<const PHX::FieldTag> >
00085 Albany::ThermoPoroPlasticityProblem::
00086 buildEvaluators(
00087 PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
00088 const Albany::MeshSpecsStruct& meshSpecs,
00089 Albany::StateManager& stateMgr,
00090 Albany::FieldManagerChoice fmchoice,
00091 const Teuchos::RCP<Teuchos::ParameterList>& responseList)
00092 {
00093
00094
00095 ConstructEvaluatorsOp<ThermoPoroPlasticityProblem> op(
00096 *this, fm0, meshSpecs, stateMgr, fmchoice, responseList);
00097 boost::mpl::for_each<PHAL::AlbanyTraits::BEvalTypes>(op);
00098 return *op.tags;
00099 }
00100
00101 void
00102 Albany::ThermoPoroPlasticityProblem::constructDirichletEvaluators(
00103 const Albany::MeshSpecsStruct& meshSpecs)
00104 {
00105
00106 std::vector<std::string> dirichletNames(neq);
00107 dirichletNames[X_offset] = "X";
00108 if (numDim>1) dirichletNames[X_offset+1] = "Y";
00109 if (numDim>2) dirichletNames[X_offset+2] = "Z";
00110 dirichletNames[T_offset] = "T";
00111 dirichletNames[TEMP_offset] = "TEMP";
00112 Albany::BCUtils<Albany::DirichletTraits> dirUtils;
00113 dfm = dirUtils.constructBCEvaluators(meshSpecs.nsNames, dirichletNames,
00114 this->params, this->paramLib);
00115 }
00116
00117 Teuchos::RCP<const Teuchos::ParameterList>
00118 Albany::ThermoPoroPlasticityProblem::getValidProblemParameters() const
00119 {
00120 Teuchos::RCP<Teuchos::ParameterList> validPL =
00121 this->getGenericProblemParams("ValidThermoPoroPlasticityProblemParams");
00122 validPL->sublist("Material Model", false, "");
00123 validPL->set<bool>("avgJ", false, "Flag to indicate the J should be averaged");
00124 validPL->set<bool>("volavgJ", false, "Flag to indicate the J should be volume averaged");
00125 validPL->set<bool>("weighted_Volume_Averaged_J", false, "Flag to indicate the J should be volume averaged with stabilization");
00126 validPL->sublist("Porosity", false, "");
00127 validPL->sublist("Biot Coefficient", false, "");
00128 validPL->sublist("Biot Modulus", false, "");
00129 validPL->sublist("Thermal Conductivity", false, "");
00130 validPL->sublist("Kozeny-Carman Permeability", false, "");
00131 validPL->sublist("Shear Modulus", false, "");
00132 validPL->sublist("Elastic Modulus", false, "");
00133 validPL->sublist("Bulk Modulus", false, "");
00134 validPL->sublist("Poissons Ratio", false, "");
00135 validPL->sublist("Stabilization Parameter", false, "");
00136 validPL->sublist("Reference Temperature", false, "");
00137 validPL->sublist("Skeleton Thermal Expansion", false, "");
00138 validPL->sublist("Pore-Fluid Thermal Expansion", false, "");
00139 validPL->sublist("Skeleton Density", false, "");
00140 validPL->sublist("Pore-Fluid Density", false, "");
00141 validPL->sublist("Skeleton Specific Heat", false, "");
00142 validPL->sublist("Pore-Fluid Specific Heat", false, "");
00143
00144
00145 if (matModel == "J2"|| matModel == "J2Fiber" || matModel == "GursonFD")
00146 {
00147 validPL->set<bool>("Compute Dislocation Density Tensor", false, "Flag to compute the dislocaiton density tensor (only for 3D)");
00148 validPL->sublist("Hardening Modulus", false, "");
00149 validPL->sublist("Yield Strength", false, "");
00150 validPL->sublist("Saturation Modulus", false, "");
00151 validPL->sublist("Saturation Exponent", false, "");
00152 }
00153
00154 if (matModel == "J2Fiber")
00155 {
00156 validPL->set<RealType>("xiinf_J2",false,"");
00157 validPL->set<RealType>("tau_J2",false,"");
00158 validPL->set<RealType>("k_f1",false,"");
00159 validPL->set<RealType>("q_f1",false,"");
00160 validPL->set<RealType>("vol_f1",false,"");
00161 validPL->set<RealType>("xiinf_f1",false,"");
00162 validPL->set<RealType>("tau_f1",false,"");
00163 validPL->set<RealType>("Mx_f1",false,"");
00164 validPL->set<RealType>("My_f1",false,"");
00165 validPL->set<RealType>("Mz_f1",false,"");
00166 validPL->set<RealType>("k_f2",false,"");
00167 validPL->set<RealType>("q_f2",false,"");
00168 validPL->set<RealType>("vol_f2",false,"");
00169 validPL->set<RealType>("xiinf_f2",false,"");
00170 validPL->set<RealType>("tau_f2",false,"");
00171 validPL->set<RealType>("Mx_f2",false,"");
00172 validPL->set<RealType>("My_f2",false,"");
00173 validPL->set<RealType>("Mz_f2",false,"");
00174 }
00175
00176 if (matModel == "GursonFD")
00177 {
00178 validPL->set<RealType>("f0",false,"");
00179 validPL->set<RealType>("kw",false,"");
00180 validPL->set<RealType>("eN",false,"");
00181 validPL->set<RealType>("sN",false,"");
00182 validPL->set<RealType>("fN",false,"");
00183 validPL->set<RealType>("fc",false,"");
00184 validPL->set<RealType>("ff",false,"");
00185 validPL->set<RealType>("q1",false,"");
00186 validPL->set<RealType>("q2",false,"");
00187 validPL->set<RealType>("q3",false,"");
00188 }
00189
00190 return validPL;
00191 }
00192
00193 void
00194 Albany::ThermoPoroPlasticityProblem::getAllocatedStates(
00195 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > oldState_,
00196 Teuchos::ArrayRCP<Teuchos::ArrayRCP<Teuchos::RCP<Intrepid::FieldContainer<RealType> > > > newState_
00197 ) const
00198 {
00199 oldState_ = oldState;
00200 newState_ = newState;
00201 }
00202