News for constitutive laws

From KratosWiki
Revision as of 14:52, 1 June 2010 by Nelson (Talk | contribs)
Jump to: navigation, search

The constitutive models are mathematical formulations based on the laws of thermodynamics and the mechanics of continuous medium that predict the behavior of a particular material. In Kratos we program in a file constituting a basis for programming models: constitutive_law.h . It is from this file we can create derived classes that will be our constitutive model.


Contents

C++ files

Old Format

Usually defines the constructor of a constitutive law with an empty constructor. For example in the elastic constitutive law we write as follows.

 Isotropic2D::Isotropic2D() 
 :ConstitutiveLaw< Node<3> >()
   {
   }
 Isotropic2D::~Isotropic2D()
  {
  }


In the element loop, when it call the constitutive law, the element did the follows:

      • Update Material
      • Calculate Stress
      • Calculate Constituve Matrix


void UpdateMaterial( const Vector& StrainVector,
const Properties& props,
const GeometryType& geom,
const Vector& ShapeFunctionsValues ,
const ProcessInfo& CurrentProcessInfo)
{
}
void Isotropic2D::CalculateElasticMatrix(Matrix& C, const double E, const double NU)
{ 
double c1 = E / (1.00 - NU*NU);
double c2 = c1 * NU;
double c3 = 0.5*E / (1 + NU);
C(0,0) = c1;	C(0,1) = c2;	C(0,2) = 0.0;
C(1,0) = c2;	C(1,1) = c1;	C(1,2) = 0.0;
C(2,0) = 0.0;	C(2,1) = 0.0;	C(2,2) = c3;
}
void Isotropic2D::CalculateStress(const Vector& StrainVector, Vector& StressVector)
{
double c1 = mE / (1.00 - mNU*mNU);
double c2 = c1 * mNU;
double c3 = 0.5*mE / (1 + mNU);
StressVector[0] = c1*StrainVector[0] + c2 * (StrainVector[1])	;
StressVector[1] = c1*StrainVector[1] + c2 * (StrainVector[0])	;
StressVector[2] = c3*StrainVector[2];
} 


void Isotropic2D::CalculateStressAndTangentMatrix(Vector& StressVector, const Vector& StrainVector,Matrix& algorithmicTangent)
{
Isotropic2D::CalculateConstitutiveMatrix(StrainVector, algorithmicTangent);
}
void Isotropic2D::CalculateConstitutiveMatrix(const Vector& StrainVector, Matrix& rResult)
{
CalculateElasticMatrix( rResult, mE, mNU );
}



Proposed New Format

However more complicated constitutive models require defining a number of parameters such as:

      • Fluency Criteria
      • Softening-Hardening Behavior
      • Special Properties
      • Other Parameters

Considering this, a constitutive law with these parameters we can define in the constructor as follows:


Variables for the constructor of the constitutive law

FluencyCriteriaPointer mpFluencyCriteria
SofteningHardeningCriteriaPointer mpSofteningBehavior;
PropertiesPointer mpProperties;


 PlasticDamage2D::PlasticDamage2D()
 :ConstitutiveLaw< Node<3> >()	
 {
 KRATOS_ERROR(std::logic_error,"Calling the empty constructor.","");
 }
 PlasticDamage2D::PlasticDamage2D(
 FluencyCriteriaPointer FluencyCriteria,
 SofteningHardeningCriteriaPointer SofteningBehavior, 
 PropertiesPointer Property) 
 :ConstitutiveLaw< Node<3> >()
 {
   mpFluencyCriteria              = FluencyCriteria;
   mpSofteningBehavior            = SofteningBehavior;
   mpProperties                   = Property;
 }
 PlasticDamage2D::~PlasticDamage2D()
 {
 }

Instead of separate calculations of the stresses and constitutive matrix, a new function is included in the base class.

virtual void CalculateMaterialResponse(
const Vector& StrainVector,
const ProcessInfo& CurrentProcessInfo,
Vector& StressVector,
Matrix& algorithmicTangent,
bool calculate_stress_flag,
bool calculate_tangent_flag,
bool  save_internal_variables)
{
}


In the file "add_constitutive_laws_to_python.h" we type:

class_<PlasticDamage2D, bases< ConstitutiveLawBaseType >, boost::noncopyable >
("PlasticDamage2D",
init<>() )
.def(init<FluencyCriteriaPointer,SofteningHardeningCriteriaPointer, PropertiesPointer>())
.def(init<FluencyCriteriaPointer,FluencyCriteriaPointer, SofteningHardeningCriteriaPointer, PropertiesPointer>())
;

As we can see, we can define a constructor with the parameters necessary to define the constitutive law.

Python files

We need to create an auxiliary file in python to define the materials and other parameters of the constitutive law.

Personal tools
Categories