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 _internal_solve_full_iteration_history
 
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 26 of file CombinedCreepPlasticity.h.

Constructor & Destructor Documentation

◆ CombinedCreepPlasticity()

CombinedCreepPlasticity::CombinedCreepPlasticity ( const InputParameters &  parameters)

Definition at line 39 of file CombinedCreepPlasticity.C.

40  : ConstitutiveModel(parameters),
41  _submodels(),
42  _max_its(parameters.get<unsigned int>("max_its")),
43  _internal_solve_full_iteration_history(getParam<bool>("internal_solve_full_iteration_history")),
44  _relative_tolerance(parameters.get<Real>("relative_tolerance")),
45  _absolute_tolerance(parameters.get<Real>("absolute_tolerance")),
46  _matl_timestep_limit(declareProperty<Real>("matl_timestep_limit"))
47 {
48 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels
ConstitutiveModel(const InputParameters &parameters)
MaterialProperty< Real > & _matl_timestep_limit

◆ ~CombinedCreepPlasticity()

virtual CombinedCreepPlasticity::~CombinedCreepPlasticity ( )
inlinevirtual

Definition at line 30 of file CombinedCreepPlasticity.h.

30 {}

Member Function Documentation

◆ applyThermalStrain()

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

Definition at line 106 of file ConstitutiveModel.C.

Referenced by ConstitutiveModel::modifyStrainIncrement().

107 {
108  if (_t_step >= 1)
109  _step_zero_cm = false;
110 
111  if (_t_step >= 2)
112  _step_one_cm = false;
113 
114  if (_has_temp && !_step_zero_cm)
115  {
116  Real inc_thermal_strain;
117  Real d_thermal_strain_d_temp;
118 
119  Real old_temp;
121  old_temp = _stress_free_temp;
122  else
123  old_temp = _temperature_old[_qp];
124 
125  Real current_temp = _temperature[_qp];
126 
127  Real delta_t = current_temp - old_temp;
128 
129  Real alpha = _alpha;
130 
131  if (_alpha_function)
132  {
133  Point p;
134  Real alpha_current_temp = _alpha_function->value(current_temp, p);
135  Real alpha_old_temp = _alpha_function->value(old_temp, p);
136  Real alpha_stress_free_temperature = _alpha_function->value(_stress_free_temp, p);
137 
139  {
140  Real small(1e-6);
141 
142  Real numerator = alpha_current_temp * (current_temp - _ref_temp) -
143  alpha_old_temp * (old_temp - _ref_temp);
144  Real denominator = 1.0 + alpha_stress_free_temperature * (_stress_free_temp - _ref_temp);
145  if (denominator < small)
146  mooseError("Denominator too small in thermal strain calculation");
147  inc_thermal_strain = numerator / denominator;
148  d_thermal_strain_d_temp = alpha_current_temp * (current_temp - _ref_temp);
149  }
150  else
151  {
152  inc_thermal_strain = delta_t * 0.5 * (alpha_current_temp + alpha_old_temp);
153  d_thermal_strain_d_temp = alpha_current_temp;
154  }
155  }
156  else
157  {
158  inc_thermal_strain = delta_t * alpha;
159  d_thermal_strain_d_temp = alpha;
160  }
161 
162  strain_increment.addDiag(-inc_thermal_strain);
163  d_strain_dT.addDiag(-d_thermal_strain_d_temp);
164  }
165 
166  bool modified = true;
167  return modified;
168 }
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:282
const VariableValue & _temperature_old

◆ computeStress()

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 95 of file CombinedCreepPlasticity.C.

100 {
101  // Given the stretching, compute the stress increment and add it to the old stress. Also update
102  // the creep strain
103  // stress = stressOld + stressIncrement
104  // creep_strain = creep_strainOld + creep_strainIncrement
105 
106  if (_t_step == 0 && !_app.isRestarting())
107  {
108  _matl_timestep_limit[_qp] = std::numeric_limits<Real>::max();
109  return;
110  }
111 
113  {
114  _console << std::endl
115  << "iteration output for CombinedCreepPlasticity solve:"
116  << " time=" << _t << " temperature=" << _temperature[_qp] << " int_pt=" << _qp
117  << std::endl;
118  }
119 
120  // compute trial stress
121  stress_new = elasticityTensor * strain_increment;
122  stress_new += stress_old;
123 
124  const SubdomainID current_block = current_elem.subdomain_id();
125  const std::vector<MooseSharedPointer<ReturnMappingModel>> & rmm(_submodels[current_block]);
126  const unsigned num_submodels = rmm.size();
127 
128  SymmTensor inelastic_strain_increment;
129 
130  SymmTensor elastic_strain_increment;
131  SymmTensor stress_new_last(stress_new);
132  Real delS(_absolute_tolerance + 1);
133  Real first_delS(delS);
134  unsigned int counter(0);
135 
136  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
137  rmm[i_rmm]->setQp(_qp);
138 
139  while (counter < _max_its && delS > _absolute_tolerance &&
140  (delS / first_delS) > _relative_tolerance && (num_submodels != 1 || counter < 1))
141  {
142  elastic_strain_increment = strain_increment;
143  stress_new = elasticityTensor * (elastic_strain_increment - inelastic_strain_increment);
144  stress_new += stress_old;
145 
146  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
147  {
148  rmm[i_rmm]->computeStress(current_elem,
149  elasticityTensor,
150  stress_old,
151  elastic_strain_increment,
152  stress_new,
153  inelastic_strain_increment);
154  }
155 
156  // now check convergence
157  SymmTensor deltaS(stress_new_last - stress_new);
158  delS = std::sqrt(deltaS.doubleContraction(deltaS));
159  if (counter == 0)
160  {
161  first_delS = delS;
162  }
163  stress_new_last = stress_new;
164 
166  {
167  _console << "stress_it=" << counter
168  << " rel_delS=" << (0 == first_delS ? 0 : delS / first_delS)
169  << " rel_tol=" << _relative_tolerance << " abs_delS=" << delS
170  << " abs_tol=" << _absolute_tolerance << std::endl;
171  }
172 
173  ++counter;
174  }
175 
176  if (counter == _max_its && delS > _absolute_tolerance &&
177  (delS / first_delS) > _relative_tolerance)
178  {
179  mooseError("Max stress iteration hit during CombinedCreepPlasticity solve!");
180  }
181 
182  strain_increment = elastic_strain_increment;
183 
184  _matl_timestep_limit[_qp] = 0.0;
185  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
186  _matl_timestep_limit[_qp] += 1.0 / rmm[i_rmm]->computeTimeStepLimit();
187 
188  if (MooseUtils::absoluteFuzzyEqual(_matl_timestep_limit[_qp], 0.0))
189  {
190  _matl_timestep_limit[_qp] = std::numeric_limits<Real>::max();
191  }
192  else
193  {
194  _matl_timestep_limit[_qp] = 1.0 / _matl_timestep_limit[_qp];
195  }
196 }
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

◆ initialSetup()

void CombinedCreepPlasticity::initialSetup ( )
protectedvirtual

Definition at line 51 of file CombinedCreepPlasticity.C.

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

◆ modifyStrainIncrement()

bool CombinedCreepPlasticity::modifyStrainIncrement ( const Elem &  current_elem,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
virtual

Reimplemented from ConstitutiveModel.

Definition at line 199 of file CombinedCreepPlasticity.C.

202 {
203  bool modified = false;
204  const SubdomainID current_block = current_elem.subdomain_id();
205  const std::vector<MooseSharedPointer<ReturnMappingModel>> & rmm(_submodels[current_block]);
206  const unsigned num_submodels = rmm.size();
207 
208  for (unsigned i_rmm(0); i_rmm < num_submodels; ++i_rmm)
209  {
210  rmm[i_rmm]->setQp(_qp);
211  modified |= rmm[i_rmm]->modifyStrainIncrement(current_elem, strain_increment, d_strain_dT);
212  }
213  return modified;
214 }
std::map< SubdomainID, std::vector< MooseSharedPointer< ReturnMappingModel > > > _submodels

◆ setQp()

void ConstitutiveModel::setQp ( unsigned int  qp)
inherited

Sets the value of the variable _qp for inheriting classes.

Definition at line 89 of file ConstitutiveModel.C.

Referenced by computeStress().

90 {
91  _qp = qp;
92 }

◆ updateElasticityTensor()

virtual bool ConstitutiveModel::updateElasticityTensor ( SymmElasticityTensor )
inlinevirtualinherited

Definition at line 45 of file ConstitutiveModel.h.

45 { return false; }

Member Data Documentation

◆ _absolute_tolerance

Real CombinedCreepPlasticity::_absolute_tolerance
protected

Definition at line 51 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

◆ _alpha

const Real ConstitutiveModel::_alpha
protectedinherited

Definition at line 53 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _alpha_function

Function* ConstitutiveModel::_alpha_function
protectedinherited

◆ _has_stress_free_temp

bool ConstitutiveModel::_has_stress_free_temp
protectedinherited

Definition at line 55 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _has_temp

const bool ConstitutiveModel::_has_temp
protectedinherited

◆ _internal_solve_full_iteration_history

bool CombinedCreepPlasticity::_internal_solve_full_iteration_history
protected

Definition at line 49 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

◆ _matl_timestep_limit

MaterialProperty<Real>& CombinedCreepPlasticity::_matl_timestep_limit
protected

Definition at line 52 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

◆ _max_its

unsigned int CombinedCreepPlasticity::_max_its
protected

Definition at line 48 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

◆ _mean_alpha_function

bool ConstitutiveModel::_mean_alpha_function
protectedinherited

◆ _ref_temp

Real ConstitutiveModel::_ref_temp
protectedinherited

◆ _relative_tolerance

Real CombinedCreepPlasticity::_relative_tolerance
protected

Definition at line 50 of file CombinedCreepPlasticity.h.

Referenced by computeStress().

◆ _step_one_cm

bool& ConstitutiveModel::_step_one_cm
protectedinherited

Definition at line 62 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _step_zero_cm

bool& ConstitutiveModel::_step_zero_cm
protectedinherited

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

Definition at line 61 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _stress_free_temp

Real ConstitutiveModel::_stress_free_temp
protectedinherited

Definition at line 56 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _submodels

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

Definition at line 46 of file CombinedCreepPlasticity.h.

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

◆ _temperature

const VariableValue& ConstitutiveModel::_temperature
protectedinherited

◆ _temperature_old

const VariableValue& ConstitutiveModel::_temperature_old
protectedinherited

Definition at line 52 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().


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