GRINS-0.6.0
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
GRINS::HookesLaw Class Reference

Elasticity tensor for Hooke's law. More...

#include <hookes_law.h>

Inheritance diagram for GRINS::HookesLaw:
Inheritance graph
[legend]
Collaboration diagram for GRINS::HookesLaw:
Collaboration graph
[legend]

Public Member Functions

 HookesLaw (const GetPot &input)
 
virtual ~HookesLaw ()
 
void compute_stress (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
 
void compute_stress_and_elasticity (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
 
libMesh::Real compute_33_stress (const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)
 This is primarily a helper function for the plane stress cases. More...
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Private Member Functions

 HookesLaw ()
 
void read_input_options (const GetPot &input)
 Parse properties from input. More...
 
void compute_stress_imp (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
 
void compute_stress_and_elasticity_imp (unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress, ElasticityTensor &C)
 
libMesh::Real compute_33_stress_imp (const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov)
 

Private Attributes

ElasticityTensor _C
 
libMesh::Real _lambda
 Lam\'{e} constant. More...
 
libMesh::Real _mu
 Lam\'{e} constant. More...
 

Friends

class StressStrainLaw< HookesLaw >
 

Detailed Description

Elasticity tensor for Hooke's law.

Uses Lam\'{e} constants, but can parse Young's modulus and Poisson's ratio if desired. By default, is constructed for Cartesian coordinate systems. If working with curvilinear coordinate systems, the user should call the set_deformation method before calling operator().

Definition at line 46 of file hookes_law.h.

Constructor & Destructor Documentation

GRINS::HookesLaw::HookesLaw ( const GetPot &  input)

Definition at line 34 of file hookes_law.C.

References read_input_options().

36  ParameterUser("HookesLaw"),
37  _C(),
38  _lambda(0.0),
39  _mu(0.0)
40  {
41  this->read_input_options(input);
42 
43  return;
44  }
void read_input_options(const GetPot &input)
Parse properties from input.
Definition: hookes_law.C:51
ParameterUser(const std::string &user_name)
libMesh::Real _mu
Lam\'{e} constant.
Definition: hookes_law.h:90
friend class StressStrainLaw< HookesLaw >
Definition: hookes_law.h:55
libMesh::Real _lambda
Lam\'{e} constant.
Definition: hookes_law.h:87
ElasticityTensor _C
Definition: hookes_law.h:84
GRINS::HookesLaw::~HookesLaw ( )
virtual

Definition at line 46 of file hookes_law.C.

47  {
48  return;
49  }
GRINS::HookesLaw::HookesLaw ( )
private

Member Function Documentation

libMesh::Real GRINS::StressStrainLaw< HookesLaw >::compute_33_stress ( const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov 
)
inherited

This is primarily a helper function for the plane stress cases.

libMesh::Real GRINS::HookesLaw::compute_33_stress_imp ( const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov 
)
private

Definition at line 132 of file hookes_law.C.

References _lambda, and _mu.

136  {
137  libMesh::Real sigma_33 = 0.0;
138 
139  for( unsigned int k = 0; k < 3; k++ )
140  {
141  for( unsigned int l = 0; l < 3; l++ )
142  {
143  libMesh::Real strain_kl = 0.5*(G_cov(k,l) - g_cov(k,l));
144 
145  libMesh::Real C = _lambda*g_contra(2,2)*g_contra(k,l) +
146  _mu*(g_contra(2,k)*g_contra(2,l) + g_contra(2,l)*g_contra(2,k));
147 
148  sigma_33 += C*strain_kl;
149  }
150  }
151 
152  return sigma_33;
153  }
libMesh::Real _mu
Lam\'{e} constant.
Definition: hookes_law.h:90
libMesh::Real _lambda
Lam\'{e} constant.
Definition: hookes_law.h:87
void GRINS::StressStrainLaw< HookesLaw >::compute_stress ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress 
)
inherited
void GRINS::StressStrainLaw< HookesLaw >::compute_stress_and_elasticity ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress,
ElasticityTensor C 
)
inherited
void GRINS::HookesLaw::compute_stress_and_elasticity_imp ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress,
ElasticityTensor C 
)
private

Definition at line 117 of file hookes_law.C.

References _C, and compute_stress_imp().

124  {
125  this->compute_stress_imp(dim,g_contra,g_cov,G_contra,G_cov,stress);
126 
127  C = _C;
128 
129  return;
130  }
void compute_stress_imp(unsigned int dim, const libMesh::TensorValue< libMesh::Real > &g_contra, const libMesh::TensorValue< libMesh::Real > &g_cov, const libMesh::TensorValue< libMesh::Real > &G_contra, const libMesh::TensorValue< libMesh::Real > &G_cov, libMesh::TensorValue< libMesh::Real > &stress)
Definition: hookes_law.C:86
ElasticityTensor _C
Definition: hookes_law.h:84
void GRINS::HookesLaw::compute_stress_imp ( unsigned int  dim,
const libMesh::TensorValue< libMesh::Real > &  g_contra,
const libMesh::TensorValue< libMesh::Real > &  g_cov,
const libMesh::TensorValue< libMesh::Real > &  G_contra,
const libMesh::TensorValue< libMesh::Real > &  G_cov,
libMesh::TensorValue< libMesh::Real > &  stress 
)
private

Definition at line 86 of file hookes_law.C.

References _C, _lambda, and _mu.

Referenced by compute_stress_and_elasticity_imp().

92  {
93  stress.zero();
94 
95  for( unsigned int i = 0; i < dim; i++ )
96  {
97  for( unsigned int j = 0; j < dim; j++ )
98  {
99  for( unsigned int k = 0; k < dim; k++ )
100  {
101  for( unsigned int l = 0; l < dim; l++ )
102  {
103  libMesh::Real strain_kl = 0.5*(G_cov(k,l) - g_cov(k,l));
104 
105  _C(i,j,k,l) = _lambda*g_contra(i,j)*g_contra(k,l) +
106  _mu*(g_contra(i,k)*g_contra(j,l) + g_contra(i,l)*g_contra(j,k));
107 
108  stress(i,j) += _C(i,j,k,l)*strain_kl;
109  }
110  }
111  }
112  }
113 
114  return;
115  }
libMesh::Real _mu
Lam\'{e} constant.
Definition: hookes_law.h:90
libMesh::Real _lambda
Lam\'{e} constant.
Definition: hookes_law.h:87
ElasticityTensor _C
Definition: hookes_law.h:84
void GRINS::HookesLaw::read_input_options ( const GetPot &  input)
private

Parse properties from input.

Definition at line 51 of file hookes_law.C.

References _lambda, _mu, and GRINS::ParameterUser::set_parameter().

Referenced by HookesLaw().

52  {
53  // We'd better have either Lam\'{e} constants or E and nu
54  if( ( !input.have_variable("Physics/HookesLaw/lambda") ||
55  !input.have_variable("Physics/HookesLaw/mu") ) &&
56  ( !input.have_variable("Physics/HookesLaw/E") ||
57  !input.have_variable("Physics/HookesLaw/nu") ) )
58  {
59  std::cerr << "Error: Must specify either Lame constants lambda and mu or" << std::endl
60  << " Young's modulus and Poisson's ratio." << std::endl;
61  libmesh_error();
62  }
63 
64  if( input.have_variable("Physics/HookesLaw/lambda") )
65  this->set_parameter
66  (_lambda, input, "Physics/HookesLaw/lambda", 0.0);
67 
68  if( input.have_variable("Physics/HookesLaw/mu") )
69  this->set_parameter
70  (_mu, input, "Physics/HookesLaw/mu", 0.0);
71 
72  if( input.have_variable("Physics/HookesLaw/E") &&
73  input.have_variable("Physics/HookesLaw/nu") )
74  {
75  // FIXME - we'll need a special accessor to give parameter
76  // access to these
77  libMesh::Real E = input("Physics/HookesLaw/E", 0.0);
78  libMesh::Real nu = input("Physics/HookesLaw/nu", 0.0);
79  _lambda = nu*E/( (1+nu)*(1-2*nu) );
80  _mu = E/(2*(1+nu));
81  }
82 
83  return;
84  }
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
libMesh::Real _mu
Lam\'{e} constant.
Definition: hookes_law.h:90
libMesh::Real _lambda
Lam\'{e} constant.
Definition: hookes_law.h:87
void GRINS::ParameterUser::register_parameter ( const std::string &  param_name,
libMesh::ParameterMultiPointer< libMesh::Number > &  param_pointer 
) const
virtualinherited

Each subclass will register its copy of an independent.

Reimplemented in GRINS::AxisymmetricHeatTransfer< Conductivity >, GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >, GRINS::IncompressibleNavierStokesBase< Viscosity >, GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >, GRINS::HeatConduction< Conductivity >, GRINS::HeatTransferBase< Conductivity >, and GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >.

Definition at line 50 of file parameter_user.C.

Referenced by GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::register_parameter(), GRINS::HeatTransferBase< Conductivity >::register_parameter(), GRINS::HeatConduction< Conductivity >::register_parameter(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::register_parameter(), GRINS::IncompressibleNavierStokesBase< Viscosity >::register_parameter(), GRINS::LowMachNavierStokesBase< Viscosity, SpecificHeat, ThermalConductivity >::register_parameter(), and GRINS::AxisymmetricHeatTransfer< Conductivity >::register_parameter().

53  {
54  std::map<std::string, libMesh::Number*>::const_iterator it =
55  _my_parameters.find(param_name);
56 
57  if (it != _my_parameters.end())
58  {
59  std::cout << _my_name << " uses parameter " << param_name
60  << std::endl;
61  param_pointer.push_back(it->second);
62  }
63  }
std::map< std::string, libMesh::Number * > _my_parameters
void GRINS::ParameterUser::set_parameter ( libMesh::Number &  param_variable,
const GetPot &  input,
const std::string &  param_name,
libMesh::Number  param_default 
)
virtualinherited

Each subclass can simultaneously read a parameter value from.

Definition at line 35 of file parameter_user.C.

References GRINS::ParameterUser::_my_name, and GRINS::ParameterUser::_my_parameters.

Referenced by GRINS::AveragedFanAdjointStabilization< Viscosity >::AveragedFanAdjointStabilization(), GRINS::AveragedTurbineAdjointStabilization< Viscosity >::AveragedTurbineAdjointStabilization(), GRINS::BoussinesqBuoyancyAdjointStabilization< Viscosity >::BoussinesqBuoyancyAdjointStabilization(), GRINS::BoussinesqBuoyancyBase::BoussinesqBuoyancyBase(), GRINS::BoussinesqBuoyancySPGSMStabilization< Viscosity >::BoussinesqBuoyancySPGSMStabilization(), GRINS::ConstantConductivity::ConstantConductivity(), GRINS::ConstantPrandtlConductivity::ConstantPrandtlConductivity(), GRINS::ConstantSourceFunction::ConstantSourceFunction(), GRINS::ConstantSourceTerm::ConstantSourceTerm(), GRINS::ConstantSpecificHeat::ConstantSpecificHeat(), GRINS::ConstantViscosity::ConstantViscosity(), GRINS::ElasticCable< StressStrainLaw >::ElasticCable(), GRINS::ElasticCableConstantGravity::ElasticCableConstantGravity(), GRINS::ElasticMembrane< StressStrainLaw >::ElasticMembrane(), GRINS::ElasticMembraneConstantPressure::ElasticMembraneConstantPressure(), GRINS::HeatConduction< Conductivity >::HeatConduction(), GRINS::HeatTransferBase< Conductivity >::HeatTransferBase(), GRINS::IncompressibleNavierStokesBase< Viscosity >::IncompressibleNavierStokesBase(), GRINS::AverageNusseltNumber::init(), GRINS::MooneyRivlin::MooneyRivlin(), GRINS::ReactingLowMachNavierStokesBase< Mixture, Evaluator >::ReactingLowMachNavierStokesBase(), GRINS::HookesLaw1D::read_input_options(), read_input_options(), GRINS::AxisymmetricBoussinesqBuoyancy::read_input_options(), and GRINS::VelocityDragAdjointStabilization< Viscosity >::VelocityDragAdjointStabilization().

39  {
40  param_variable = input(param_name, param_default);
41 
42  libmesh_assert_msg(!_my_parameters.count(param_name),
43  "ERROR: " << _my_name << " double-registered parameter " <<
44  param_name);
45 
46  _my_parameters[param_name] = &param_variable;
47  }
std::map< std::string, libMesh::Number * > _my_parameters

Friends And Related Function Documentation

friend class StressStrainLaw< HookesLaw >
friend

Definition at line 55 of file hookes_law.h.

Member Data Documentation

ElasticityTensor GRINS::HookesLaw::_C
private

Definition at line 84 of file hookes_law.h.

Referenced by compute_stress_and_elasticity_imp(), and compute_stress_imp().

libMesh::Real GRINS::HookesLaw::_lambda
private

Lam\'{e} constant.

Definition at line 87 of file hookes_law.h.

Referenced by compute_33_stress_imp(), compute_stress_imp(), and read_input_options().

libMesh::Real GRINS::HookesLaw::_mu
private

Lam\'{e} constant.

Definition at line 90 of file hookes_law.h.

Referenced by compute_33_stress_imp(), compute_stress_imp(), and read_input_options().


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

Generated on Mon Jun 22 2015 21:32:23 for GRINS-0.6.0 by  doxygen 1.8.9.1