Commit 817cdaaf authored by Antoine Jacquey's avatar Antoine Jacquey

Implemented damage in two ways: fully coupled or via a MultiApp.

parent 6c336965
// /******************************************************************************/
// /* LYNX, a MOOSE-based application */
// /* */
// /* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
// /* GFZ Potsdam, German Research Centre for Geosciences */
// /* */
// /* This program is free software: you can redistribute it and/or modify */
// /* it under the terms of the GNU 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 General Public License for more details. */
// /* */
// /* You should have received a copy of the GNU General Public License */
// /* along with this program. If not, see <http://www.gnu.org/licenses/> */
// /******************************************************************************/
// #ifndef LYNXSTRAINRATIOAUX_H
// #define LYNXSTRAINRATIOAUX_H
// #include "LynxStrainAuxBase.h"
// class LynxStrainRatioAux;
// template <>
// InputParameters validParams<LynxStrainRatioAux>();
// class LynxStrainRatioAux : public LynxStrainAuxBase
// {
// public:
// LynxStrainRatioAux(const InputParameters & parameters);
// protected:
// virtual Real computeValue() override;
// };
// #endif // LYNXSTRAINRATIOAUX_H
\ No newline at end of file
/******************************************************************************/
/* LYNX, a MOOSE-based application */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU 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 General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
#ifndef LYNXSTRAINRATIOAUX_H
#define LYNXSTRAINRATIOAUX_H
#include "AuxKernel.h"
#include "RankTwoTensor.h"
#include "DerivativeMaterialInterface.h"
class LynxStrainRatioAux;
template <>
InputParameters validParams<LynxStrainRatioAux>();
class LynxStrainRatioAux : public DerivativeMaterialInterface<AuxKernel>
{
public:
LynxStrainRatioAux(const InputParameters & parameters);
protected:
virtual Real computeValue();
const MaterialProperty<RankTwoTensor> & _elastic_strain;
};
#endif // LYNXSTRAINRATIOAUX_H
/******************************************************************************/
/* LYNX, a MOOSE-based application */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU 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 General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
#ifndef LYNXDAMAGERATE_H
#define LYNXDAMAGERATE_H
#include "Kernel.h"
class LynxDamageRate;
template <>
InputParameters validParams<LynxDamageRate>();
class LynxDamageRate : public Kernel
{
public:
LynxDamageRate(const InputParameters & parameters);
protected:
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
const VariableValue & _u_old;
bool _coupled_dam;
const VariableValue & _damage_rate;
};
#endif // LYNXDAMAGERATE_H
......@@ -40,6 +40,8 @@ protected:
virtual void elasticModuli() override;
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) override;
virtual void damageCorrection() override;
virtual RankFourTensor damageTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & tme) override;
virtual Real computePlasticityYield(const Real & pressure, const Real & eqv_stress);
virtual Real plasticIncrement(const Real & /*pressure*/, const Real & eqv_stress);
virtual Real computeConvexPlasticityYield2(const Real & pressure, const Real & eqv_stress);
......@@ -69,6 +71,7 @@ protected:
// Plastic parameters
const std::vector<Real> _friction_angle;
const std::vector<Real> _cohesion;
const std::vector<Real> _porous_coeff;
const std::vector<Real> _porous_coeff_linear;
std::vector<Real> _one_on_plastic_eta;
......@@ -77,9 +80,21 @@ protected:
// Damage-Plasticity structure
damage_plasticity * _damage_plasticity;
// Damage-Plasticity utilities
Real _dyield_dp_tr;
Real _dyield_dq_tr;
RankTwoTensor _damaged_stress;
RankFourTensor _damaged_tensor;
// Strain properties
MaterialProperty<RankTwoTensor> & _elastic_strain;
const MaterialProperty<RankTwoTensor> & _elastic_strain_old;
// Stress properties
// MaterialProperty<RankTwoTensor> & _dstress_ddamage;
// Damage properties
MaterialProperty<Real> & _damage_rate;
};
#endif // LYNXDAMAGEDEFORMATION_H
/******************************************************************************/
/* LYNX, a MOOSE-based application */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU 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 General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
#ifndef LYNXDAMAGEDEFORMATIONNEW_H
#define LYNXDAMAGEDEFORMATIONNEW_H
#include "LynxDeformation.h"
class LynxDamageDeformationNew;
template <>
InputParameters validParams<LynxDamageDeformationNew>();
class LynxDamageDeformationNew : public LynxDeformationBase
{
public:
LynxDamageDeformationNew(const InputParameters & parameters);
virtual ~LynxDamageDeformationNew() {}
protected:
virtual void initQpStatefulProperties() override;
virtual void initializeQpDeformation() override;
// virtual void elasticModuli() override;
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) override;
virtual void damageCorrection() override;
virtual RankFourTensor damageTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & tme) override;
virtual Real computePlasticityYield(const Real & pressure, const Real & eqv_stress);
virtual Real plasticIncrement(const Real & /*pressure*/, const Real & eqv_stress);
virtual Real computeConvexPlasticityYield2(const Real & pressure, const Real & eqv_stress);
virtual Real computeConvexPlasticityYield2(const Real & rho);
virtual Real convexPlasticIncrement(Real & vol_plastic_incr, Real & eqv_plastic_incr);
virtual void computeDamageProperties(const Real & pressure, const Real & eqv_stress);
virtual void updateDamageParameters();
virtual void initializeDamageParameters();
virtual void updateDamageConvexParameters(const Real & pressure, const Real & eqv_stress);
virtual Real convexReferencePressure();
virtual Real dConvexPlasticYield2(const Real & rho);
virtual Real dConvexPlasticYield2_dp(const Real & pressure, const Real & eqv_stress);
virtual Real dConvexPlasticYield2_dq(const Real & pressure, const Real & eqv_stress);
virtual Real getConvexProjection(const Real & x1, const Real & x2);
virtual Real strainRatio(const RankTwoTensor & elastic_strain);
virtual RankTwoTensor rotatedElasticStrain(const RankTwoTensor & elastic_strain);
// Coupled variables
bool _coupled_dam;
const VariableValue & _damage;
const VariableValue & _damage_old;
bool _coupled_phi;
const VariableValue & _porosity;
// Elastic moduli parameters
const std::vector<Real> _damage_modulus;
// Plastic parameters
const std::vector<Real> _friction_angle;
const std::vector<Real> _cohesion;
const std::vector<Real> _porous_coeff;
const std::vector<Real> _porous_coeff_linear;
std::vector<Real> _one_on_plastic_eta;
std::vector<Real> _one_on_damage_eta;
// Damage-Plasticity structure
damage_plasticity * _damage_plasticity;
// Damage-Plasticity utilities
// Real _dyield_dp_tr;
// Real _dyield_dq_tr;
// RankTwoTensor _damaged_stress;
// RankFourTensor _damaged_tensor;
// Strain properties
MaterialProperty<RankTwoTensor> & _elastic_strain;
const MaterialProperty<RankTwoTensor> & _elastic_strain_old;
// Stress properties
// MaterialProperty<RankTwoTensor> & _dstress_ddamage;
// Damage properties
MaterialProperty<Real> & _damage_rate;
};
#endif // LYNXDAMAGEDEFORMATIONNEW_H
......@@ -57,8 +57,11 @@ protected:
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) = 0;
virtual void damageCorrection();
virtual void tangentOperator();
virtual void plasticTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & flow_direction_dyad);
virtual RankFourTensor viscousTangentOperator(const RankFourTensor & flow_direction_dyad);
virtual RankFourTensor plasticTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & flow_direction_dyad);
virtual RankFourTensor damageTangentOperator(const RankTwoTensor & /*flow_direction*/,
const RankFourTensor & /*tme*/);
virtual void finiteTangentOperator();
virtual Real computeStokeEffectiveViscosity(const Real & pressure);
virtual RankTwoTensor computeStokeEffectiveViscosityDerivative();
......
......@@ -208,12 +208,14 @@ struct plasticity
struct damage_plasticity
{
Real _xi0;
Real _gamma;
Real _p_cr;
Real _eta_p; // actually one on eta
Real _eta_d; // actually one on eta
Real _alpha0;
Real _xi0; // critical strain ratio
Real _gamma; // third elastic modulus
Real _p_cr; // critical pressure for capped yield
Real _k0; // coefficient for cohesion
Real _eta_p; // actually one on eta
Real _eta_d; // actually one on eta
Real _alpha0; // coefficient for friction
Real _p_k; // coefficient to fake cohesion for capped yield
Real _p_tr; // trial pressure
Real _q_tr; // trial eqv_stress
Real _p_r; // reference pressure for convex yield
......@@ -230,9 +232,11 @@ struct damage_plasticity
: _xi0(-std::sqrt(3.0)),
_gamma(0.0),
_p_cr(0.0),
_k0(0.0),
_eta_p(0.0),
_eta_d(0.0),
_alpha0(0.0),
_p_k(0.0),
_p_tr(0.0),
_q_tr(0.0),
_p_r(0.0),
......@@ -247,11 +251,17 @@ struct damage_plasticity
_dmu2_dxi_cr(0.0)
{
}
void fill(const Real xi0, const Real gamma, const Real p_cr, const Real eta_p, const Real eta_d)
void fill(const Real xi0,
const Real gamma,
const Real p_cr,
const Real k0,
const Real eta_p,
const Real eta_d)
{
_xi0 = xi0;
_gamma = gamma;
_p_cr = p_cr;
_k0 = k0;
_eta_p = eta_p;
_eta_d = eta_d;
}
......
// /******************************************************************************/
// /* LYNX, a MOOSE-based application */
// /* */
// /* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
// /* GFZ Potsdam, German Research Centre for Geosciences */
// /* */
// /* This program is free software: you can redistribute it and/or modify */
// /* it under the terms of the GNU 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 General Public License for more details. */
// /* */
// /* You should have received a copy of the GNU General Public License */
// /* along with this program. If not, see <http://www.gnu.org/licenses/> */
// /******************************************************************************/
/******************************************************************************/
/* LYNX, a MOOSE-based application */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU 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 General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
// #include "LynxStrainRatioAux.h"
#include "LynxStrainRatioAux.h"
// registerMooseObject("LynxApp", LynxStrainRatioAux);
registerMooseObject("LynxApp", LynxStrainRatioAux);
// template <>
// InputParameters
// validParams<LynxStrainRatioAux>()
// {
// InputParameters params = validParams<LynxStrainAuxBase>();
// params.addClassDescription("Access the strain ratio (volumetric strain on norm of the
// strain)."); return params;
// }
template <>
InputParameters
validParams<LynxStrainRatioAux>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription(
"Access the strain ratio (volumetric strain on norm of the elastic strain).");
return params;
}
// LynxStrainRatioAux::LynxStrainRatioAux(const InputParameters & parameters)
// : LynxStrainAuxBase(parameters)
// {
// }
LynxStrainRatioAux::LynxStrainRatioAux(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_elastic_strain(getDefaultMaterialProperty<RankTwoTensor>("elastic_strain"))
{
}
// Real
// LynxStrainRatioAux::computeValue()
// {
// Real strain_norm = (*_strain)[_qp].L2norm();
Real
LynxStrainRatioAux::computeValue()
{
Real strain_norm = _elastic_strain[_qp].L2norm();
// if (strain_norm != 0.0)
// return (*_strain)[_qp].trace() / strain_norm;
// else
// return -std::sqrt(3.0);
// }
\ No newline at end of file
if (strain_norm != 0.0)
return _elastic_strain[_qp].trace() / strain_norm;
else
return -std::sqrt(3.0);
}
/******************************************************************************/
/* LYNX, a MOOSE-based application */
/* */
/* Copyright (C) 2017 by Antoine B. Jacquey and Mauro Cacace */
/* GFZ Potsdam, German Research Centre for Geosciences */
/* */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU 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 General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
#include "LynxDamageRate.h"
registerMooseObject("LynxApp", LynxDamageRate);
template <>
InputParameters
validParams<LynxDamageRate>()
{
InputParameters params = validParams<Kernel>();
params.addClassDescription("Damage rate for damage rheology.");
params.addCoupledVar("damage_rate", "The damage rate auxiliary variable");
return params;
}
LynxDamageRate::LynxDamageRate(const InputParameters & parameters)
: Kernel(parameters),
_u_old(valueOld()),
_coupled_dam(isCoupled("damage_rate")),
_damage_rate(_coupled_dam ? coupledValue("damage_rate") : _zero)
{
}
/******************************************************************************/
/* RESIDUALS */
/******************************************************************************/
Real
LynxDamageRate::computeQpResidual()
{
Real rate = std::min(_damage_rate[_qp], (1.0 - _u_old[_qp]) / _dt);
return -rate * _test[_i][_qp];
}
/******************************************************************************/
/* JACOBIAN */
/******************************************************************************/
Real
LynxDamageRate::computeQpJacobian()
{
return 0.0;
}
/******************************************************************************/
/* OFF-DIAG JACOBIAN */
/******************************************************************************/
Real
LynxDamageRate::computeQpOffDiagJacobian(unsigned int jvar)
{
return 0.0;
}
This diff is collapsed.
This diff is collapsed.
......@@ -449,17 +449,17 @@ LynxDeformationBase::tangentOperator()
_tangent_modulus[_qp] += _K[_qp] * _volumetric_four;
// Viscous correction
_tangent_modulus[_qp] -= (_eta_eff[_qp] != 0.0 && _G[_qp] != 0.0)
? 2.0 * _G[_qp] *
((1.0 - _stress_corr_v) * _deviatoric_four +
1.5 * (_stress_corr_v - _dq_dq_tr_v) * flow_direction_dyad)
: RankFourTensor();
RankFourTensor viscous_operator = viscousTangentOperator(flow_direction_dyad);
_tangent_modulus[_qp] -= 2.0 * _G[_qp] * viscous_operator;
// Plastic correction
if (_has_plasticity && (_G[_qp] != 0.0) && (_K[_qp] != 0.0))
plasticTangentOperator(flow_direction, flow_direction_dyad);
RankFourTensor plastic_operator = plasticTangentOperator(flow_direction, flow_direction_dyad);
_tangent_modulus[_qp] = _tangent_modulus[_qp] * (_identity_four - plastic_operator);
// Additional correction
RankFourTensor tme = (_identity_four - viscous_operator) * (_identity_four - plastic_operator);
RankFourTensor damage_operator = damageTangentOperator(flow_direction, tme);
_tangent_modulus[_qp] -= damage_operator;
// Spin correction
updateSpinTangentModulus();
......@@ -469,18 +469,41 @@ LynxDeformationBase::tangentOperator()
finiteTangentOperator();
}
void
RankFourTensor
LynxDeformationBase::viscousTangentOperator(const RankFourTensor & flow_direction_dyad)
{
if ((_eta_eff[_qp] != 0.0) && (_G[_qp] != 0.0))
return (1.0 - _stress_corr_v) * _deviatoric_four +
1.5 * (_stress_corr_v - _dq_dq_tr_v) * flow_direction_dyad;
else
return RankFourTensor();
}
RankFourTensor
LynxDeformationBase::plasticTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & flow_direction_dyad)
{
RankFourTensor plastic_operator = (1.0 - _stress_corr_p) * _deviatoric_four +
1.5 * (_stress_corr_p - _dq_dq_tr_p) * flow_direction_dyad;
plastic_operator +=
0.5 * _K[_qp] / _G[_qp] * _dq_dp_tr_p * flow_direction.outerProduct(_identity_two);
plastic_operator += (1.0 - _dp_dp_tr_p) * _volumetric_four / 3.0;
plastic_operator +=
3.0 * _G[_qp] / _K[_qp] * _dp_dq_tr_p * _identity_two.outerProduct(flow_direction) / 3.0;
_tangent_modulus[_qp] = _tangent_modulus[_qp] * (_identity_four - plastic_operator);
if (_has_plasticity && (_G[_qp] != 0.0) && (_K[_qp] != 0.0))
{
RankFourTensor plastic_operator = (1.0 - _stress_corr_p) * _deviatoric_four +
1.5 * (_stress_corr_p - _dq_dq_tr_p) * flow_direction_dyad;
plastic_operator +=
0.5 * _K[_qp] / _G[_qp] * _dq_dp_tr_p * flow_direction.outerProduct(_identity_two);
plastic_operator += (1.0 - _dp_dp_tr_p) * _volumetric_four / 3.0;
plastic_operator +=
3.0 * _G[_qp] / _K[_qp] * _dp_dq_tr_p * _identity_two.outerProduct(flow_direction) / 3.0;
return plastic_operator;
}
else
return RankFourTensor();
}
RankFourTensor
LynxDeformationBase::damageTangentOperator(const RankTwoTensor & /*flow_direction*/,
const RankFourTensor & /*tme*/)
{
return RankFourTensor();
}
void
......@@ -622,9 +645,13 @@ LynxDeformationBase::viscousIncrement(const Real & pressure, const Real & eqv_st
eqv_v_strain_incr =
(_dt / maxwell_time) / (1.0 + (_dt / maxwell_time)) * eqv_stress / (3.0 * _G[_qp]);
_stress_corr_v =
(eqv_stress != 0.0) ? (eqv_stress - 3.0 * _G[_qp] * eqv_v_strain_incr) / eqv_stress : 1.0;
_dq_dq_tr_v = 1.0 / (1.0 + _dt / maxwell_time);
// Tangent Operator
if (_fe_problem.currentlyComputingJacobian())
{
_stress_corr_v =
(eqv_stress != 0.0) ? (eqv_stress - 3.0 * _G[_qp] * eqv_v_strain_incr) / eqv_stress : 1.0;
_dq_dq_tr_v = 1.0 / (1.0 + _dt / maxwell_time);
}
}
return eqv_v_strain_incr;
......
......@@ -77,19 +77,18 @@
[./eqv_in_strain_aux]
type = LynxEqvStrainAux
variable = eqv_in_strain
strain_type = inelastic
strain_type = plastic
execute_on = 'timestep_end'
[../]
[./eqv_in_strain_rate_aux]
type = LynxEqvStrainRateAux
variable = eqv_in_strain_rate
strain_type = inelastic
strain_type = plastic
execute_on = 'timestep_end'
[../]
[./strain_ratio_aux]
type = LynxStrainRatioAux
variable = strain_ratio
strain_type = elastic
execute_on = 'timestep_end'
[../]
[]
......@@ -116,7 +115,7 @@
[./no_uy]
type = PresetBC
variable = disp_y
boundary = bottom
boundary = bottom
value = 0.0
[../]
[]