Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "Teuchos_TestForException.hpp"
00008 #include "Phalanx_DataLayout.hpp"
00009
00010 #include "Intrepid_FunctionSpaceTools.hpp"
00011
00012 namespace LCM {
00013
00014
00015 template<typename EvalT, typename Traits>
00016 MixtureSpecificHeat<EvalT, Traits>::
00017 MixtureSpecificHeat(const Teuchos::ParameterList& p) :
00018 porosity (p.get<std::string> ("Porosity Name"),
00019 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00020 gammaSkeleton (p.get<std::string> ("Skeleton Specific Heat Name"),
00021 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00022 gammaPoreFluid (p.get<std::string> ("Pore-Fluid Specific Heat Name"),
00023 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00024 densitySkeleton (p.get<std::string> ("Skeleton Density Name"),
00025 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00026 densityPoreFluid (p.get<std::string> ("Pore-Fluid Density Name"),
00027 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00028 J (p.get<std::string> ("DetDefGrad Name"),
00029 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") ),
00030 mixtureSpecificHeat (p.get<std::string> ("Mixture Specific Heat Name"),
00031 p.get<Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout") )
00032 {
00033 this->addDependentField(porosity);
00034 this->addDependentField(J);
00035 this->addDependentField(gammaPoreFluid);
00036 this->addDependentField(gammaSkeleton);
00037 this->addDependentField(densityPoreFluid);
00038 this->addDependentField(densitySkeleton);
00039
00040 this->addEvaluatedField(mixtureSpecificHeat);
00041
00042 this->setName("Mixture Specific Heat"+PHX::TypeString<EvalT>::value);
00043
00044 Teuchos::RCP<PHX::DataLayout> scalar_dl =
00045 p.get< Teuchos::RCP<PHX::DataLayout> >("QP Scalar Data Layout");
00046 std::vector<PHX::DataLayout::size_type> dims;
00047 scalar_dl->dimensions(dims);
00048 numQPs = dims[1];
00049 }
00050
00051
00052 template<typename EvalT, typename Traits>
00053 void MixtureSpecificHeat<EvalT, Traits>::
00054 postRegistrationSetup(typename Traits::SetupData d,
00055 PHX::FieldManager<Traits>& fm)
00056 {
00057 this->utils.setFieldData(mixtureSpecificHeat,fm);
00058 this->utils.setFieldData(porosity,fm);
00059 this->utils.setFieldData(J,fm);
00060 this->utils.setFieldData(gammaSkeleton,fm);
00061 this->utils.setFieldData(gammaPoreFluid,fm);
00062 this->utils.setFieldData(densitySkeleton,fm);
00063 this->utils.setFieldData(densityPoreFluid,fm);
00064 }
00065
00066
00067 template<typename EvalT, typename Traits>
00068 void MixtureSpecificHeat<EvalT, Traits>::
00069 evaluateFields(typename Traits::EvalData workset)
00070 {
00071
00072 for (std::size_t cell=0; cell < workset.numCells; ++cell) {
00073 for (std::size_t qp=0; qp < numQPs; ++qp) {
00074
00075 mixtureSpecificHeat(cell,qp) = (J(cell,qp)-porosity(cell,qp))
00076 *gammaSkeleton(cell,qp)*densitySkeleton(cell,qp) +
00077 porosity(cell,qp)*gammaPoreFluid(cell,qp)*
00078 densityPoreFluid(cell,qp);
00079
00080 }
00081 }
00082
00083 }
00084
00085
00086 }
00087