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

#include <ConstitutiveModel.h>

Inheritance diagram for ConstitutiveModel:
[legend]

Public Member Functions

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

Protected Attributes

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

Definition at line 23 of file ConstitutiveModel.h.

Constructor & Destructor Documentation

◆ ConstitutiveModel()

ConstitutiveModel::ConstitutiveModel ( const InputParameters &  parameters)

Definition at line 39 of file ConstitutiveModel.C.

40  : Material(parameters),
41  _has_temp(isCoupled("temp")),
42  _temperature(_has_temp ? coupledValue("temp") : _zero),
43  _temperature_old(_has_temp ? coupledValueOld("temp") : _zero),
44  _alpha(parameters.isParamValid("thermal_expansion") ? getParam<Real>("thermal_expansion") : 0.),
45  _alpha_function(parameters.isParamValid("thermal_expansion_function")
46  ? &getFunction("thermal_expansion_function")
47  : NULL),
48  _has_stress_free_temp(isParamValid("stress_free_temperature")),
49  _stress_free_temp(_has_stress_free_temp ? getParam<Real>("stress_free_temperature") : 0.0),
50  _ref_temp(0.0),
51  _step_zero_cm(declareRestartableData<bool>("step_zero_cm", true)),
52  _step_one_cm(declareRestartableData<bool>("step_one_cm", true))
53 {
54  if (parameters.isParamValid("thermal_expansion_function_type"))
55  {
56  if (!_alpha_function)
57  mooseError("thermal_expansion_function_type can only be set when thermal_expansion_function "
58  "is used");
59  MooseEnum tec = getParam<MooseEnum>("thermal_expansion_function_type");
60  if (tec == "mean")
61  _mean_alpha_function = true;
62  else if (tec == "instantaneous")
63  _mean_alpha_function = false;
64  else
65  mooseError("Invalid option for thermal_expansion_function_type");
66  }
67  else
68  _mean_alpha_function = false;
69 
70  if (parameters.isParamValid("thermal_expansion_reference_temperature"))
71  {
72  if (!_alpha_function)
73  mooseError("thermal_expansion_reference_temperature can only be set when "
74  "thermal_expansion_function is used");
76  mooseError("thermal_expansion_reference_temperature can only be set when "
77  "thermal_expansion_function_type = mean");
78  _ref_temp = getParam<Real>("thermal_expansion_reference_temperature");
79  if (!_has_temp)
80  mooseError(
81  "Cannot specify thermal_expansion_reference_temperature without coupling to temperature");
82  }
83  else if (_mean_alpha_function)
84  mooseError("Must specify thermal_expansion_reference_temperature if "
85  "thermal_expansion_function_type = mean");
86 }
const VariableValue & _temperature
Function * _alpha_function
bool & _step_zero_cm
Restartable data to check for the zeroth and first time steps.
const VariableValue & _temperature_old

◆ ~ConstitutiveModel()

virtual ConstitutiveModel::~ConstitutiveModel ( )
inlinevirtual

Definition at line 28 of file ConstitutiveModel.h.

28 {}

Member Function Documentation

◆ applyThermalStrain()

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

Definition at line 106 of file ConstitutiveModel.C.

Referenced by 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 ConstitutiveModel::computeStress ( const Elem &  ,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new 
)
virtual

Reimplemented in RateDepSmearCrackModel, ReturnMappingModel, CombinedCreepPlasticity, and ElasticModel.

Definition at line 95 of file ConstitutiveModel.C.

100 {
101  stress_new = elasticityTensor * strain_increment;
102  stress_new += stress_old;
103 }

◆ modifyStrainIncrement()

virtual bool ConstitutiveModel::modifyStrainIncrement ( const Elem &  ,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
inlinevirtual

Reimplemented in CombinedCreepPlasticity.

Definition at line 39 of file ConstitutiveModel.h.

42  {
43  return applyThermalStrain(strain_increment, d_strain_dT);
44  }
virtual bool applyThermalStrain(SymmTensor &strain_increment, SymmTensor &d_strain_dT)

◆ setQp()

void ConstitutiveModel::setQp ( unsigned int  qp)

Sets the value of the variable _qp for inheriting classes.

Definition at line 89 of file ConstitutiveModel.C.

Referenced by CombinedCreepPlasticity::computeStress().

90 {
91  _qp = qp;
92 }

◆ updateElasticityTensor()

virtual bool ConstitutiveModel::updateElasticityTensor ( SymmElasticityTensor )
inlinevirtual

Definition at line 45 of file ConstitutiveModel.h.

45 { return false; }

Member Data Documentation

◆ _alpha

const Real ConstitutiveModel::_alpha
protected

Definition at line 53 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

◆ _alpha_function

Function* ConstitutiveModel::_alpha_function
protected

Definition at line 54 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

◆ _has_stress_free_temp

bool ConstitutiveModel::_has_stress_free_temp
protected

Definition at line 55 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

◆ _has_temp

const bool ConstitutiveModel::_has_temp
protected

◆ _mean_alpha_function

bool ConstitutiveModel::_mean_alpha_function
protected

Definition at line 57 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

◆ _ref_temp

Real ConstitutiveModel::_ref_temp
protected

Definition at line 58 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

◆ _step_one_cm

bool& ConstitutiveModel::_step_one_cm
protected

Definition at line 62 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

◆ _step_zero_cm

bool& ConstitutiveModel::_step_zero_cm
protected

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

Definition at line 61 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

◆ _stress_free_temp

Real ConstitutiveModel::_stress_free_temp
protected

Definition at line 56 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

◆ _temperature

const VariableValue& ConstitutiveModel::_temperature
protected

◆ _temperature_old

const VariableValue& ConstitutiveModel::_temperature_old
protected

Definition at line 52 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().


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