22 "Creates density material property. This class is deprecated, and its functionality" 23 "is replaced by StrainAdjustedDensity for cases when the density should be adjusted" 24 "to account for material deformation. If it is not desired to adjust the density for" 25 "deformation, a variety of general-purpose Materials, such as GenericConstantMaterial" 26 "or ParsedMaterial can be used to define the density.");
30 "The displacements appropriate for the simulation geometry and coordinate system");
32 params.
addParam<std::string>(
"base_name",
33 "Optional parameter that allows the user to define " 34 "multiple material systems on the same block, " 35 "e.g. for multiple phases");
44 _is_coupled(isCoupled(
"displacements")),
45 _coord_system(getBlockCoordSystem()),
46 _disp_r(_is_coupled ? this->template coupledGenericValue<is_ad>(
"displacements", 0)
47 : genericZeroValue<is_ad>()),
48 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
49 _initial_density(getParam<
Real>(
"density")),
50 _grad_disp(_is_coupled ? this->template coupledGenericGradients<is_ad>(
"displacements")
52 _density(declareGenericProperty<
Real, is_ad>(_base_name +
"density"))
54 if (getParam<bool>(
"use_displaced_mesh"))
56 "Density needs to act on an undisplaced mesh. Use of a displaced mesh leads to " 57 "incorrect gradient values");
65 "The system uses a displaced problem but 'displacements' are not provided in Density.");
68 _grad_disp.resize(3, &genericZeroGradient<is_ad>());
75 _density[_qp] = _initial_density;
93 const auto Axx = (*_grad_disp[0])[_qp](0) + 1.0;
94 const auto & Axy = (*_grad_disp[0])[_qp](1);
95 const auto & Axz = (*_grad_disp[0])[_qp](2);
96 const auto & Ayx = (*_grad_disp[1])[_qp](0);
97 auto Ayy = (*_grad_disp[1])[_qp](1) + 1.0;
98 const auto & Ayz = (*_grad_disp[1])[_qp](2);
99 const auto & Azx = (*_grad_disp[2])[_qp](0);
100 const auto & Azy = (*_grad_disp[2])[_qp](1);
101 auto Azz = (*_grad_disp[2])[_qp](2) + 1.0;
103 switch (_coord_system)
106 Azz = (*_grad_disp[2])[_qp](2) + 1.0;
110 if (_q_point[_qp](0) != 0.0)
111 Azz = _disp_r[_qp] / _q_point[_qp](0) + 1.0;
115 if (_q_point[_qp](0) != 0.0)
116 Ayy = Azz = _disp_r[_qp] / _q_point[_qp](0) + 1.0;
120 const auto detF = Axx * Ayy * Azz + Axy * Ayz * Azx + Axz * Ayx * Azy - Azx * Ayy * Axz -
121 Azy * Ayz * Axx - Azz * Ayx * Axy;
Compute density, which may changed based on a deforming mesh.
Moose::GenericType< Real, is_ad > GenericReal
FEProblemBase & _fe_problem
static InputParameters validParams()
static const std::string density
DensityTempl(const InputParameters ¶ms)
std::vector< const GenericVariableGradient< is_ad > * > _grad_disp
static InputParameters validParams()
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
void paramError(const std::string ¶m, Args... args) const
registerMooseObjectDeprecated("MiscApp", Density, "12/31/2025 24:00")
virtual void initQpStatefulProperties() override
virtual void computeQpProperties() override
unsigned int coupledComponents(const std::string &var_name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const