www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CombinedCreepPlasticity Class Reference

One or more constitutive models coupled together. More...

#include <CombinedCreepPlasticity.h>

Inheritance diagram for CombinedCreepPlasticity:
[legend]

Public Member Functions

 CombinedCreepPlasticity (const InputParameters &parameters)
 
virtual ~CombinedCreepPlasticity ()
 
virtual void computeStress (const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new)
 Compute the stress (sigma += deltaSigma) More...
 
virtual bool modifyStrainIncrement (const Elem &current_elem, SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 
void setQp (unsigned int qp)
 Sets the value of the variable _qp for inheriting classes. More...
 
virtual bool updateElasticityTensor (SymmElasticityTensor &)
 
virtual bool applyThermalStrain (SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 

Protected Member Functions

virtual void initialSetup ()
 

Protected Attributes

std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
 
unsigned int _max_its
 
bool _output_iteration_info
 
Real _relative_tolerance
 
Real _absolute_tolerance
 
MaterialProperty< Real > & _matl_timestep_limit
 
const bool _has_temp
 
const VariableValue & _temperature
 
const VariableValue & _temperature_old
 
const Real _alpha
 
Function * _alpha_function
 
bool _has_stress_free_temp
 
Real _stress_free_temp
 
bool _mean_alpha_function
 
Real _ref_temp
 
bool & _step_zero_cm
 Restartable data to check for the zeroth and first time steps. More...
 
bool & _step_one_cm
 

Detailed Description

One or more constitutive models coupled together.

Definition at line 18 of file CombinedCreepPlasticity.h.

Constructor & Destructor Documentation

CombinedCreepPlasticity::CombinedCreepPlasticity ( const InputParameters &  parameters)

Definition at line 33 of file CombinedCreepPlasticity.C.

34  : ConstitutiveModel(parameters),
35  _submodels(),
36  _max_its(parameters.get<unsigned int>("max_its")),
37  _output_iteration_info(getParam<bool>("output_iteration_info")),
38  _relative_tolerance(parameters.get<Real>("relative_tolerance")),
39  _absolute_tolerance(parameters.get<Real>("absolute_tolerance")),
40  _matl_timestep_limit(declareProperty<Real>("matl_timestep_limit"))
41 {
42 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
ConstitutiveModel(const InputParameters &parameters)
MaterialProperty< Real > & _matl_timestep_limit
virtual CombinedCreepPlasticity::~CombinedCreepPlasticity ( )
inlinevirtual

Definition at line 22 of file CombinedCreepPlasticity.h.

22 {}

Member Function Documentation

bool ConstitutiveModel::applyThermalStrain ( SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
virtualinherited

Definition at line 103 of file ConstitutiveModel.C.

Referenced by ConstitutiveModel::modifyStrainIncrement(), and ConstitutiveModel::updateElasticityTensor().

104 {
105  if (_t_step >= 1)
106  _step_zero_cm = false;
107 
108  if (_t_step >= 2)
109  _step_one_cm = false;
110 
111  if (_has_temp && !_step_zero_cm)
112  {
113  Real inc_thermal_strain;
114  Real d_thermal_strain_d_temp;
115 
116  Real old_temp;
118  old_temp = _stress_free_temp;
119  else
120  old_temp = _temperature_old[_qp];
121 
122  Real current_temp = _temperature[_qp];
123 
124  Real delta_t = current_temp - old_temp;
125 
126  Real alpha = _alpha;
127 
128  if (_alpha_function)
129  {
130  Point p;
131  Real alpha_current_temp = _alpha_function->value(current_temp, p);
132  Real alpha_old_temp = _alpha_function->value(old_temp, p);
133  Real alpha_stress_free_temperature = _alpha_function->value(_stress_free_temp, p);
134 
136  {
137  Real small(1e-6);
138 
139  Real numerator = alpha_current_temp * (current_temp - _ref_temp) -
140  alpha_old_temp * (old_temp - _ref_temp);
141  Real denominator = 1.0 + alpha_stress_free_temperature * (_stress_free_temp - _ref_temp);
142  if (denominator < small)
143  mooseError("Denominator too small in thermal strain calculation");
144  inc_thermal_strain = numerator / denominator;
145  d_thermal_strain_d_temp = alpha_current_temp * (current_temp - _ref_temp);
146  }
147  else
148  {
149  inc_thermal_strain = delta_t * 0.5 * (alpha_current_temp + alpha_old_temp);
150  d_thermal_strain_d_temp = alpha_current_temp;
151  }
152  }
153  else
154  {
155  inc_thermal_strain = delta_t * alpha;
156  d_thermal_strain_d_temp = alpha;
157  }
158 
159  strain_increment.addDiag(-inc_thermal_strain);
160  d_strain_dT.addDiag(-d_thermal_strain_d_temp);
161  }
162 
163  bool modified = true;
164  return modified;
165 }
const VariableValue & _temperature
Function * _alpha_function
bool & _step_zero_cm
Restartable data to check for the zeroth and first time steps.
void addDiag(Real value)
Definition: SymmTensor.h:279
const VariableValue & _temperature_old
void CombinedCreepPlasticity::computeStress ( const Elem &  current_elem,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new 
)
virtual

Compute the stress (sigma += deltaSigma)

Reimplemented from ConstitutiveModel.

Definition at line 89 of file CombinedCreepPlasticity.C.

Referenced by ~CombinedCreepPlasticity().

94 {
95  // Given the stretching, compute the stress increment and add it to the old stress. Also update
96  // the creep strain
97  // stress = stressOld + stressIncrement
98  // creep_strain = creep_strainOld + creep_strainIncrement
99 
100  if (_t_step == 0 && !_app.isRestarting())
101  return;
102 
103  if (_output_iteration_info == true)
104  {
105  _console << std::endl
106  << "iteration output for CombinedCreepPlasticity solve:"
107  << " time=" << _t << " temperature=" << _temperature[_qp] << " int_pt=" << _qp
108  << std::endl;
109  }
110 
111  // compute trial stress
112  stress_new = elasticityTensor * strain_increment;
113  stress_new += stress_old;
114 
115  const SubdomainID current_block = current_elem.subdomain_id();
116  const std::vector<MooseSharedPointer<ReturnMappingModel>> & rmm(_submodels[current_block]);
117  const unsigned num_submodels = rmm.size();
118 
119  SymmTensor inelastic_strain_increment;
120 
121  SymmTensor elastic_strain_increment;
122  SymmTensor stress_new_last(stress_new);
123  Real delS(_absolute_tolerance + 1);
124  Real first_delS(delS);
125  unsigned int counter(0);
126 
127  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
128  rmm[i_rmm]->setQp(_qp);
129 
130  while (counter < _max_its && delS > _absolute_tolerance &&
131  (delS / first_delS) > _relative_tolerance && (num_submodels != 1 || counter < 1))
132  {
133  elastic_strain_increment = strain_increment;
134  stress_new = elasticityTensor * (elastic_strain_increment - inelastic_strain_increment);
135  stress_new += stress_old;
136 
137  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
138  {
139  rmm[i_rmm]->computeStress(current_elem,
140  elasticityTensor,
141  stress_old,
142  elastic_strain_increment,
143  stress_new,
144  inelastic_strain_increment);
145  }
146 
147  // now check convergence
148  SymmTensor deltaS(stress_new_last - stress_new);
149  delS = std::sqrt(deltaS.doubleContraction(deltaS));
150  if (counter == 0)
151  {
152  first_delS = delS;
153  }
154  stress_new_last = stress_new;
155 
156  if (_output_iteration_info == true)
157  {
158  _console << "stress_it=" << counter
159  << " rel_delS=" << (0 == first_delS ? 0 : delS / first_delS)
160  << " rel_tol=" << _relative_tolerance << " abs_delS=" << delS
161  << " abs_tol=" << _absolute_tolerance << std::endl;
162  }
163 
164  ++counter;
165  }
166 
167  if (counter == _max_its && delS > _absolute_tolerance &&
168  (delS / first_delS) > _relative_tolerance)
169  {
170  mooseError("Max stress iteration hit during CombinedCreepPlasticity solve!");
171  }
172 
173  strain_increment = elastic_strain_increment;
174 
175  _matl_timestep_limit[_qp] = 0.0;
176  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
177  _matl_timestep_limit[_qp] += 1.0 / rmm[i_rmm]->computeTimeStepLimit();
178 
179  _matl_timestep_limit[_qp] = 1.0 / _matl_timestep_limit[_qp];
180 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
const VariableValue & _temperature
MaterialProperty< Real > & _matl_timestep_limit
void setQp(unsigned int qp)
Sets the value of the variable _qp for inheriting classes.
static unsigned int counter
void CombinedCreepPlasticity::initialSetup ( )
protectedvirtual

Definition at line 45 of file CombinedCreepPlasticity.C.

Referenced by ~CombinedCreepPlasticity().

46 {
47  std::vector<SubdomainID> block_id =
48  std::vector<SubdomainID>(blockIDs().begin(), blockIDs().end());
49  const std::vector<std::string> & submodels = getParam<std::vector<std::string>>("submodels");
50  for (unsigned i(0); i < block_id.size(); ++i)
51  {
52  std::string suffix;
53  std::vector<MooseSharedPointer<Material>> const * mats_p;
54  if (_bnd)
55  {
56  mats_p = &_fe_problem.getMaterialWarehouse()[Moose::FACE_MATERIAL_DATA].getActiveBlockObjects(
57  block_id[i], _tid);
58  suffix = "_face";
59  }
60  else
61  mats_p = &_fe_problem.getMaterialWarehouse().getActiveBlockObjects(block_id[i], _tid);
62 
63  const std::vector<MooseSharedPointer<Material>> & mats = *mats_p;
64  for (unsigned int i_name(0); i_name < submodels.size(); ++i_name)
65  {
66  bool found = false;
67  for (unsigned int j = 0; j < mats.size(); ++j)
68  {
69  MooseSharedPointer<ReturnMappingModel> rmm =
70  MooseSharedNamespace::dynamic_pointer_cast<ReturnMappingModel>(mats[j]);
71  if (rmm && rmm->name() == submodels[i_name] + suffix)
72  {
73  _submodels[block_id[i]].push_back(rmm);
74  found = true;
75  break;
76  }
77  }
78  if (!found)
79  {
80  mooseError("Unable to find submodel " + submodels[i_name]);
81  }
82  }
83  }
84 
85  ConstitutiveModel::initialSetup();
86 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
Base class for models that perform return mapping iterations to compute stress.
bool CombinedCreepPlasticity::modifyStrainIncrement ( const Elem &  current_elem,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
virtual

Reimplemented from ConstitutiveModel.

Definition at line 183 of file CombinedCreepPlasticity.C.

Referenced by ~CombinedCreepPlasticity().

186 {
187  bool modified = false;
188  const SubdomainID current_block = current_elem.subdomain_id();
189  const std::vector<MooseSharedPointer<ReturnMappingModel>> & rmm(_submodels[current_block]);
190  const unsigned num_submodels = rmm.size();
191 
192  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
193  {
194  rmm[i_rmm]->setQp(_qp);
195  modified |= rmm[i_rmm]->modifyStrainIncrement(current_elem, strain_increment, d_strain_dT);
196  }
197  return modified;
198 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
void ConstitutiveModel::setQp ( unsigned int  qp)
inherited

Sets the value of the variable _qp for inheriting classes.

Definition at line 86 of file ConstitutiveModel.C.

Referenced by computeStress(), and ConstitutiveModel::~ConstitutiveModel().

87 {
88  _qp = qp;
89 }
virtual bool ConstitutiveModel::updateElasticityTensor ( SymmElasticityTensor )
inlinevirtualinherited

Definition at line 40 of file ConstitutiveModel.h.

40 { return false; }

Member Data Documentation

Real CombinedCreepPlasticity::_absolute_tolerance
protected

Definition at line 43 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

const Real ConstitutiveModel::_alpha
protectedinherited

Definition at line 48 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

Function* ConstitutiveModel::_alpha_function
protectedinherited
bool ConstitutiveModel::_has_stress_free_temp
protectedinherited

Definition at line 50 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

const bool ConstitutiveModel::_has_temp
protectedinherited
MaterialProperty<Real>& CombinedCreepPlasticity::_matl_timestep_limit
protected

Definition at line 44 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

unsigned int CombinedCreepPlasticity::_max_its
protected

Definition at line 40 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

bool ConstitutiveModel::_mean_alpha_function
protectedinherited
bool CombinedCreepPlasticity::_output_iteration_info
protected

Definition at line 41 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

Real ConstitutiveModel::_ref_temp
protectedinherited
Real CombinedCreepPlasticity::_relative_tolerance
protected

Definition at line 42 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

bool& ConstitutiveModel::_step_one_cm
protectedinherited

Definition at line 57 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

bool& ConstitutiveModel::_step_zero_cm
protectedinherited

Restartable data to check for the zeroth and first time steps.

Definition at line 56 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

Real ConstitutiveModel::_stress_free_temp
protectedinherited

Definition at line 51 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

std::map<SubdomainID, std::vector<MooseSharedPointer<ReturnMappingModel> > > CombinedCreepPlasticity::_submodels
protected

Definition at line 38 of file CombinedCreepPlasticity.h.

Referenced by computeStress(), initialSetup(), and modifyStrainIncrement().

const VariableValue& ConstitutiveModel::_temperature
protectedinherited
const VariableValue& ConstitutiveModel::_temperature_old
protectedinherited

Definition at line 47 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().


The documentation for this class was generated from the following files: