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 18 of file ConstitutiveModel.h.

Constructor & Destructor Documentation

ConstitutiveModel::ConstitutiveModel ( const InputParameters &  parameters)

Definition at line 36 of file ConstitutiveModel.C.

37  : Material(parameters),
38  _has_temp(isCoupled("temp")),
39  _temperature(_has_temp ? coupledValue("temp") : _zero),
40  _temperature_old(_has_temp ? coupledValueOld("temp") : _zero),
41  _alpha(parameters.isParamValid("thermal_expansion") ? getParam<Real>("thermal_expansion") : 0.),
42  _alpha_function(parameters.isParamValid("thermal_expansion_function")
43  ? &getFunction("thermal_expansion_function")
44  : NULL),
45  _has_stress_free_temp(isParamValid("stress_free_temperature")),
46  _stress_free_temp(_has_stress_free_temp ? getParam<Real>("stress_free_temperature") : 0.0),
47  _ref_temp(0.0),
48  _step_zero_cm(declareRestartableData<bool>("step_zero_cm", true)),
49  _step_one_cm(declareRestartableData<bool>("step_one_cm", true))
50 {
51  if (parameters.isParamValid("thermal_expansion_function_type"))
52  {
53  if (!_alpha_function)
54  mooseError("thermal_expansion_function_type can only be set when thermal_expansion_function "
55  "is used");
56  MooseEnum tec = getParam<MooseEnum>("thermal_expansion_function_type");
57  if (tec == "mean")
58  _mean_alpha_function = true;
59  else if (tec == "instantaneous")
60  _mean_alpha_function = false;
61  else
62  mooseError("Invalid option for thermal_expansion_function_type");
63  }
64  else
65  _mean_alpha_function = false;
66 
67  if (parameters.isParamValid("thermal_expansion_reference_temperature"))
68  {
69  if (!_alpha_function)
70  mooseError("thermal_expansion_reference_temperature can only be set when "
71  "thermal_expansion_function is used");
73  mooseError("thermal_expansion_reference_temperature can only be set when "
74  "thermal_expansion_function_type = mean");
75  _ref_temp = getParam<Real>("thermal_expansion_reference_temperature");
76  if (!_has_temp)
77  mooseError(
78  "Cannot specify thermal_expansion_reference_temperature without coupling to temperature");
79  }
80  else if (_mean_alpha_function)
81  mooseError("Must specify thermal_expansion_reference_temperature if "
82  "thermal_expansion_function_type = mean");
83 }
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
virtual ConstitutiveModel::~ConstitutiveModel ( )
inlinevirtual

Definition at line 23 of file ConstitutiveModel.h.

23 {}

Member Function Documentation

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

Definition at line 103 of file ConstitutiveModel.C.

Referenced by modifyStrainIncrement(), and 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 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 92 of file ConstitutiveModel.C.

Referenced by ~ConstitutiveModel().

97 {
98  stress_new = elasticityTensor * strain_increment;
99  stress_new += stress_old;
100 }
virtual bool ConstitutiveModel::modifyStrainIncrement ( const Elem &  ,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
inlinevirtual

Reimplemented in CombinedCreepPlasticity.

Definition at line 34 of file ConstitutiveModel.h.

37  {
38  return applyThermalStrain(strain_increment, d_strain_dT);
39  }
virtual bool applyThermalStrain(SymmTensor &strain_increment, SymmTensor &d_strain_dT)
void ConstitutiveModel::setQp ( unsigned int  qp)

Sets the value of the variable _qp for inheriting classes.

Definition at line 86 of file ConstitutiveModel.C.

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

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

Definition at line 40 of file ConstitutiveModel.h.

40 { return false; }

Member Data Documentation

const Real ConstitutiveModel::_alpha
protected

Definition at line 48 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

Function* ConstitutiveModel::_alpha_function
protected

Definition at line 49 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

bool ConstitutiveModel::_has_stress_free_temp
protected

Definition at line 50 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

const bool ConstitutiveModel::_has_temp
protected
bool ConstitutiveModel::_mean_alpha_function
protected

Definition at line 52 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

Real ConstitutiveModel::_ref_temp
protected

Definition at line 53 of file ConstitutiveModel.h.

Referenced by applyThermalStrain(), and ConstitutiveModel().

bool& ConstitutiveModel::_step_one_cm
protected

Definition at line 57 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

bool& ConstitutiveModel::_step_zero_cm
protected

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

Definition at line 56 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

Real ConstitutiveModel::_stress_free_temp
protected

Definition at line 51 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().

const VariableValue& ConstitutiveModel::_temperature
protected
const VariableValue& ConstitutiveModel::_temperature_old
protected

Definition at line 47 of file ConstitutiveModel.h.

Referenced by applyThermalStrain().


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