Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F69345826
isotropic_hardening.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 1, 09:19
Size
6 KB
Mime Type
text/x-c++
Expires
Wed, Jul 3, 09:19 (2 d)
Engine
blob
Format
Raw Data
Handle
18644922
Attached To
rTAMAAS tamaas
isotropic_hardening.cpp
View Options
/**
* @file
* LICENSE
*
* Copyright (©) 2016-2021 EPFL (École Polytechnique Fédérale de Lausanne),
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "isotropic_hardening.hh"
#include "influence.hh"
/* -------------------------------------------------------------------------- */
namespace tamaas {
/* -------------------------------------------------------------------------- */
template <model_type type>
IsotropicHardening<type>::IsotropicHardening(Model* model, Real sigma_0, Real h)
: Material<type>(model), sigma_0(sigma_0), h(h) {
plastic_strain =
allocateGrid<type, false, Real>(model->getDiscretization(), trait::voigt);
cumulated_plastic_strain =
allocateGrid<type, false, Real>(model->getDiscretization(), 1);
plastic_strain.initialize();
cumulated_plastic_strain.initialize();
model->registerField("plastic_strain", plastic_strain);
model->registerField("cumulated_plastic_strain", cumulated_plastic_strain);
}
/* -------------------------------------------------------------------------- */
template <>
void IsotropicHardening<model_type::volume_2d>::
computeInelasticDeformationIncrement(Field& increment, const Field& strain,
const Field& strain_increment) {
influence::ElasticHelper<dim> elasticity(this->model->getShearModulus(),
this->model->getPoissonRatio());
plastic_strain.reset();
cumulated_plastic_strain.reset();
Loop::loop(
[&elasticity,
this](auto dep, // < plastic strain increment
auto epsilon, // < total strain
auto delta_epsilon, // < strain increment
auto ep, // < plastic strain
Real& p // < cumulated plastic strain
) {
// Trial elastic stress
auto sigma_tr = elasticity(epsilon - ep + delta_epsilon);
// Zero increment by default
dep = 0;
// Deviatoric trial stress
decltype(sigma_tr) dev;
dev.deviatoric(sigma_tr);
// Von-Mises stress
Real von_mises = std::sqrt(1.5) * dev.l2norm();
// Plasticity condition
if (von_mises - this->hardening(p) > 0) {
// radial return
Real dp = (von_mises - this->hardening(p)) / (3 * elasticity.mu + h);
dev *= 3 * dp / (2 * von_mises); // saving memory (dev is delta ep)
dep = dev;
p += dp;
ep += dep;
}
},
range<Mat>(increment), range<CMat>(strain), range<CMat>(strain_increment),
range<Mat>(*plastic_strain), *cumulated_plastic_strain);
}
/* -------------------------------------------------------------------------- */
template <>
void IsotropicHardening<model_type::volume_2d>::computeStress(
Field& stress, const Field& strain, const Field& strain_increment) {
this->computeInelasticDeformationIncrement(stress, strain, strain_increment);
const influence::ElasticHelper<dim> elasticity(
this->model->getShearModulus(), this->model->getPoissonRatio());
Loop::loop(
[&elasticity](auto sigma, // < stress
auto epsilon, // < total strain
auto delta_epsilon, // < strain increment
auto ep // < plastic strain
) {
sigma = epsilon;
sigma += delta_epsilon;
sigma -= ep;
sigma = elasticity(sigma);
},
range<Mat>(stress), range<CMat>(strain), range<CMat>(strain_increment),
range<CMat>(*plastic_strain));
}
/* -------------------------------------------------------------------------- */
template <model_type type>
void IsotropicHardening<type>::update() {
plastic_strain.update();
cumulated_plastic_strain.update();
}
/* -------------------------------------------------------------------------- */
template <>
void IsotropicHardening<model_type::volume_2d>::applyTangentIncrement(
Grid<Real, dim>& output, const Grid<Real, dim>& input,
const Grid<Real, dim>& strain,
const Grid<Real, dim>& strain_increment) const {
const influence::ElasticHelper<dim> elasticity(
this->model->getShearModulus(), this->model->getPoissonRatio());
Loop::loop(
[&elasticity, this](auto out, auto in, auto epsilon, auto delta_epsilon,
auto ep, const Real& p) {
auto sigma_tr = elasticity(epsilon - ep + delta_epsilon);
decltype(sigma_tr) dev;
dev.deviatoric(sigma_tr, 3);
auto von_mises = std::sqrt(1.5) * dev.l2norm();
if (von_mises - this->hardening(p) > 0) {
Real dp = (von_mises - this->hardening(p)) / (3 * elasticity.mu + h);
// Applying tangent from Bonnet & Frangi, p.175
const Real beta = 3 * elasticity.mu * dp / von_mises;
const Real gamma = 3 * elasticity.mu / (3 * elasticity.mu + this->h);
const Real dot = dev.dot(in);
dev *= 3 * elasticity.mu * (gamma - beta) * dot /
(von_mises * von_mises);
out.deviatoric(in);
out *= 2 * elasticity.mu * beta;
out += dev;
} else
out = 0;
},
range<Mat>(output), range<CMat>(input), range<CMat>(strain),
range<CMat>(strain_increment), range<CMat>(*this->plastic_strain),
*this->cumulated_plastic_strain);
}
/* -------------------------------------------------------------------------- */
/* Template instanciation */
/* -------------------------------------------------------------------------- */
template class IsotropicHardening<model_type::volume_2d>;
} // namespace tamaas
Event Timeline
Log In to Comment