https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADComputeAxisymmetric1DFiniteStrain.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11#include "UserObject.h"
12
14
17{
19 params.addClassDescription("Compute a strain increment and rotation increment for finite strains "
20 "in an axisymmetric 1D problem");
21 params.addParam<UserObjectName>("subblock_index_provider",
22 "SubblockIndexProvider user object name");
23 params.addCoupledVar("scalar_out_of_plane_strain", "Scalar variable for axisymmetric 1D problem");
24 params.addCoupledVar("out_of_plane_strain", "Nonlinear variable for axisymmetric 1D problem");
25
26 return params;
27}
28
30 const InputParameters & parameters)
31 : ADCompute1DFiniteStrain(parameters),
32 _disp_old_0(coupledValueOld("displacements", 0)),
33 _subblock_id_provider(isParamValid("subblock_index_provider")
34 ? &getUserObject<SubblockIndexProvider>("subblock_index_provider")
35 : nullptr),
36 _has_out_of_plane_strain(isCoupled("out_of_plane_strain")),
37 _out_of_plane_strain(_has_out_of_plane_strain ? adCoupledValue("out_of_plane_strain")
38 : _ad_zero),
39 _out_of_plane_strain_old(_has_out_of_plane_strain ? coupledValueOld("out_of_plane_strain")
40 : _zero),
41 _has_scalar_out_of_plane_strain(isCoupledScalar("scalar_out_of_plane_strain"))
42{
44 mooseError("Must define only one of out_of_plane_strain or scalar_out_of_plane_strain");
45
47 {
48 const auto nscalar_strains = coupledScalarComponents("scalar_out_of_plane_strain");
49 _scalar_out_of_plane_strain.resize(nscalar_strains);
50 _scalar_out_of_plane_strain_old.resize(nscalar_strains);
51 for (unsigned int i = 0; i < nscalar_strains; ++i)
52 {
53 _scalar_out_of_plane_strain[i] = &adCoupledScalarValue("scalar_out_of_plane_strain", i);
54 _scalar_out_of_plane_strain_old[i] = &coupledScalarValueOld("scalar_out_of_plane_strain", i);
55 }
56 }
57}
58
59void
61{
63
65 mooseError("The coordinate system must be set to RZ for Axisymmetric geometries.");
66}
67
68unsigned int
73
83
84Real
92
95{
96 if (!MooseUtils::absoluteFuzzyEqual(_q_point[_qp](0), 0.0))
97 return (*_disp[0])[_qp] / _q_point[_qp](0);
98 else
99 return 0.0;
100}
101
102Real
104{
105 if (!MooseUtils::absoluteFuzzyEqual(_q_point[_qp](0), 0.0))
106 return _disp_old_0[_qp] / _q_point[_qp](0);
107 else
108 return 0.0;
109}
registerMooseObject("SolidMechanicsApp", ADComputeAxisymmetric1DFiniteStrain)
DualNumber< Real, DNDerivativeType, true > ADReal
ADCompute1DFiniteStrain defines a strain increment for finite strains in 1D problems,...
static InputParameters validParams()
ADComputeAxisymmetric1DFiniteStrain defines a strain increment for finite strains in an Axisymmetric ...
const bool _has_out_of_plane_strain
Whether an out-of-plane strain variable is coupled.
ADComputeAxisymmetric1DFiniteStrain(const InputParameters &parameters)
ADReal computeGradDispYY() override
Computes the current dUy/dy for axisymmetric problems.
const bool _has_scalar_out_of_plane_strain
Whether an out-of-plane strain scalar variable is coupled.
std::vector< const ADVariableValue * > _scalar_out_of_plane_strain
Current and old values of the out-of-plane strain scalar variable.
const SubblockIndexProvider *const _subblock_id_provider
A UserObject that carries the subblock ID for all elements.
const ADVariableValue & _out_of_plane_strain
Current and old values of the out-of-plane strain variable.
std::vector< const VariableValue * > _scalar_out_of_plane_strain_old
const VariableValue & _disp_old_0
the old value of the first component of the displacements vector
Real computeGradDispYYOld() override
Computes the old dUy/dy for axisymmetric problems.
Real computeGradDispZZOld() override
Computes the old dUz/dz for axisymmetric problems, where .
ADReal computeGradDispZZ() override
Computes the current dUz/dz for axisymmetric problems, where .
unsigned int getCurrentSubblockIndex() const
Gets the subblock index for the current element.
std::vector< const ADVariableValue * > _disp
Displacement variables.
Moose::CoordinateSystemType getBlockCoordSystem()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _qp
const Elem *const & _current_elem
const MooseArray< Point > & _q_point
void mooseError(Args &&... args) const
unsigned int coupledScalarComponents(const std::string &var_name) const
const VariableValue & coupledScalarValueOld(const std::string &var_name, unsigned int comp=0) const
const ADVariableValue & adCoupledScalarValue(const std::string &var_name, unsigned int comp=0) const
Abstract base class for user objects that provide an index for a given element that is independent of...
virtual unsigned int getSubblockIndex(const Elem &) const =0
The index of subblock this element is on.