Commit 12f04b84 authored by Antoine Jacquey's avatar Antoine Jacquey

Damage rheology working and tested.

parent 817cdaaf
......@@ -40,4 +40,4 @@ protected:
std::vector<bool> _has_save_in_vars;
};
#endif // LYNXPRESSUREACTION_H
\ No newline at end of file
#endif // LYNXPRESSUREACTION_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 LYNXDAMAGEAUX_H
#define LYNXDAMAGEAUX_H
#include "AuxKernel.h"
#include "DerivativeMaterialInterface.h"
class LynxDamageAux;
template <>
InputParameters validParams<LynxDamageAux>();
class LynxDamageAux : public DerivativeMaterialInterface<AuxKernel>
{
public:
LynxDamageAux(const InputParameters & parameters);
protected:
virtual Real computeValue() override;
const MaterialProperty<Real> & _damage_rate;
};
#endif // LYNXDAMAGEAUX_H
\ No newline at end of file
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXEFFECTIVEPRESSUREAUX_H
\ No newline at end of file
#endif // LYNXEFFECTIVEPRESSUREAUX_H
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXEQVSTRAINAUX_H
\ No newline at end of file
#endif // LYNXEQVSTRAINAUX_H
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXEQVSTRAINRATEAUX_H
\ No newline at end of file
#endif // LYNXEQVSTRAINRATEAUX_H
......@@ -44,4 +44,4 @@ protected:
Real _cond_bulk;
};
#endif // LynxHeatFluxAux_H
\ No newline at end of file
#endif // LynxHeatFluxAux_H
......@@ -49,4 +49,4 @@ protected:
const MaterialProperty<RankTwoTensor> & _inelastic_strain_old;
};
#endif // LYNXPOROSITYAUX_H
\ No newline at end of file
#endif // LYNXPOROSITYAUX_H
......@@ -41,4 +41,4 @@ private:
const unsigned int _j;
};
#endif // LYNXSTRAINAUX_H
\ No newline at end of file
#endif // LYNXSTRAINAUX_H
......@@ -42,4 +42,4 @@ protected:
const MaterialProperty<RankTwoTensor> * _strain_incr;
};
#endif // LYNXSTRAINAUXBASE_H
\ No newline at end of file
#endif // LYNXSTRAINAUXBASE_H
......@@ -41,4 +41,4 @@ private:
const unsigned int _j;
};
#endif // LYNXSTRAINRATEAUX_H
\ No newline at end of file
#endif // LYNXSTRAINRATEAUX_H
......@@ -43,4 +43,4 @@ private:
const unsigned int _j;
};
#endif // LYNXSTRESSAUX_H
\ No newline at end of file
#endif // LYNXSTRESSAUX_H
......@@ -39,4 +39,4 @@ protected:
const MaterialProperty<RankTwoTensor> & _stress;
};
#endif // LYNXSTRESSAUXBASE_H
\ No newline at end of file
#endif // LYNXSTRESSAUXBASE_H
......@@ -43,4 +43,4 @@ protected:
bool _relative;
};
#endif // LYNXVARIABLERATEAUX_H
\ No newline at end of file
#endif // LYNXVARIABLERATEAUX_H
......@@ -40,4 +40,4 @@ protected:
const VariableValue & _disp_old;
};
#endif // LYNXVELOCITYAUX_H
\ No newline at end of file
#endif // LYNXVELOCITYAUX_H
......@@ -40,4 +40,4 @@ protected:
std::vector<const VariableValue *> _vel;
};
#endif // LYNXVELOCITYNORMAUX_H
\ No newline at end of file
#endif // LYNXVELOCITYNORMAUX_H
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXVOLSTRAINAUX_H
\ No newline at end of file
#endif // LYNXVOLSTRAINAUX_H
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXVOLSTRAINRATEAUX_H
\ No newline at end of file
#endif // LYNXVOLSTRAINRATEAUX_H
......@@ -37,4 +37,4 @@ protected:
virtual Real computeValue() override;
};
#endif // LYNXVONMISESSTRESSAUX_H
\ No newline at end of file
#endif // LYNXVONMISESSTRESSAUX_H
......@@ -44,4 +44,4 @@ protected:
const MaterialProperty<Real> & _rhoC_b;
};
#endif // LYNXHEATFLUXBC_H
\ No newline at end of file
#endif // LYNXHEATFLUXBC_H
......@@ -42,4 +42,4 @@ protected:
Function * const _function;
};
#endif // LYNXPRESSUREBC_H
\ No newline at end of file
#endif // LYNXPRESSUREBC_H
......@@ -42,4 +42,4 @@ protected:
Function * const _function;
};
#endif // LYNXVELOCITYBC_H
\ No newline at end of file
#endif // LYNXVELOCITYBC_H
......@@ -48,4 +48,4 @@ protected:
const MaterialProperty<Real> & _rho_b;
};
#endif // LYNXWINKLERBC_H
\ No newline at end of file
#endif // LYNXWINKLERBC_H
......@@ -43,4 +43,4 @@ protected:
Real _rand_per;
};
#endif // LYNXFUNCTIONNOISEIC_H
\ No newline at end of file
#endif // LYNXFUNCTIONNOISEIC_H
......@@ -22,13 +22,14 @@
#define LYNXDAMAGERATE_H
#include "Kernel.h"
#include "DerivativeMaterialInterface.h"
class LynxDamageRate;
template <>
InputParameters validParams<LynxDamageRate>();
class LynxDamageRate : public Kernel
class LynxDamageRate : public DerivativeMaterialInterface<Kernel>
{
public:
LynxDamageRate(const InputParameters & parameters);
......@@ -40,7 +41,12 @@ protected:
const VariableValue & _u_old;
bool _coupled_dam;
bool _coupled_disp;
unsigned int _ndisp;
std::vector<unsigned> _disp_var;
const VariableValue & _damage_rate;
const MaterialProperty<Real> & _damage_rate_mat;
const MaterialProperty<RankTwoTensor> & _ddamage_rate_dstrain;
};
#endif // LYNXDAMAGERATE_H
......@@ -44,4 +44,4 @@ protected:
const MaterialProperty<Real> & _rho_f;
};
#endif // LYNXHYDRODARCY_H
\ No newline at end of file
#endif // LYNXHYDRODARCY_H
......@@ -45,4 +45,4 @@ protected:
std::vector<unsigned int> _disp_var;
};
#endif // LYNXHYDROPOROMECH_H
\ No newline at end of file
#endif // LYNXHYDROPOROMECH_H
......@@ -54,4 +54,4 @@ protected:
const MaterialProperty<RankTwoTensor> & _strain_increment;
};
#endif // LYNXMASS_H
\ No newline at end of file
#endif // LYNXMASS_H
......@@ -42,4 +42,4 @@ protected:
const MaterialProperty<RealVectorValue> & _gravity;
};
#endif // LYNXPRESSURELOAD_H
\ No newline at end of file
#endif // LYNXPRESSURELOAD_H
......@@ -58,6 +58,7 @@ protected:
const VariableValue & _pf;
bool _coupled_plith;
bool _coupled_pdyn;
bool _coupled_dam;
const unsigned int _component;
bool _vol_locking_correction;
const MaterialProperty<RankTwoTensor> & _stress;
......@@ -68,6 +69,7 @@ protected:
const MaterialProperty<Real> & _rho_b;
const MaterialProperty<Real> & _drho_dtemp;
const MaterialProperty<Real> & _drho_dev;
const MaterialProperty<RankTwoTensor> & _dstress_ddamage;
// Gradient of test function averaged over the element. Used in volumetric locking correction
// calculation.
std::vector<std::vector<Real>> _avg_grad_test;
......@@ -79,6 +81,7 @@ protected:
unsigned int _pf_var;
unsigned int _plith_var;
unsigned int _pdyn_var;
unsigned int _damage_var;
};
#endif // LYNXSOLIDMOMENTUM_H
......@@ -35,13 +35,10 @@ public:
virtual ~LynxDamageDeformation() {}
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 RankFourTensor damageTangentOperator(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);
......@@ -83,15 +80,10 @@ protected:
// 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;
MaterialProperty<RankTwoTensor> & _dstress_ddamage;
MaterialProperty<RankTwoTensor> & _ddamage_rate_dstrain;
// Damage properties
MaterialProperty<Real> & _damage_rate;
......
/******************************************************************************/
/* 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
......@@ -51,8 +51,8 @@ protected:
virtual void computeQpDeformation();
virtual void initializeQpDeformation();
virtual void elasticModuli();
virtual void volumetricDeformation(Real & pressure);
virtual void deviatoricDeformation(const Real & pressure, RankTwoTensor & stress_dev);
virtual Real volumetricDeformation();
virtual RankTwoTensor deviatoricDeformation(const Real & pressure);
virtual void reformStressTensor(const Real & pressure, const RankTwoTensor & stress_dev);
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) = 0;
virtual void damageCorrection();
......@@ -60,8 +60,7 @@ protected:
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 RankFourTensor damageTangentOperator(const RankFourTensor & /*tme*/);
virtual void finiteTangentOperator();
virtual Real computeStokeEffectiveViscosity(const Real & pressure);
virtual RankTwoTensor computeStokeEffectiveViscosityDerivative();
......@@ -150,6 +149,8 @@ protected:
Real _dq_dq_tr_p;
// Strain properties
MaterialProperty<RankTwoTensor> & _elastic_strain;
const MaterialProperty<RankTwoTensor> & _elastic_strain_old;
MaterialProperty<RankTwoTensor> & _strain_increment;
MaterialProperty<RankTwoTensor> & _spin_tensor;
const MaterialProperty<RankTwoTensor> & _thermal_strain_incr;
......@@ -164,7 +165,6 @@ protected:
// Stress properties
MaterialProperty<RankTwoTensor> & _stress;
const MaterialProperty<RankTwoTensor> & _stress_old;
MaterialProperty<Real> & _K;
MaterialProperty<Real> & _G;
MaterialProperty<RankFourTensor> & _tangent_modulus;
......
......@@ -37,4 +37,4 @@ protected:
virtual void computeQpProperties() override;
};
#endif // LYNXDENSITYCONSTANT_H
\ No newline at end of file
#endif // LYNXDENSITYCONSTANT_H
......@@ -64,4 +64,4 @@ protected:
std::vector<Real> _eta_f;
};
#endif // LYNXHYDROBASE_H
\ No newline at end of file
#endif // LYNXHYDROBASE_H
......@@ -45,4 +45,4 @@ protected:
std::vector<Real> _solid_compr;
};
#endif // LYNXHYDROCONSTANT
\ No newline at end of file
#endif // LYNXHYDROCONSTANT
......@@ -50,4 +50,4 @@ protected:
std::vector<const VariableValue *> _compositional_phases;
};
#endif // LYNXSTRAINBASE_H
\ No newline at end of file
#endif // LYNXSTRAINBASE_H
......@@ -69,4 +69,4 @@ protected:
std::vector<Real> _beta_s;
};
#endif // LYNXTHERMALBASE_H
\ No newline at end of file
#endif // LYNXTHERMALBASE_H
......@@ -46,4 +46,4 @@ protected:
const std::vector<Real> _solid_thermal_exp;
};
#endif // LYNXTHERMALCONSTANT_H
\ No newline at end of file
#endif // LYNXTHERMALCONSTANT_H
......@@ -41,4 +41,4 @@ protected:
std::vector<const VariableValue *> _vel;
};
#endif // LYNXVELOCITYROOTMEANSQUARE_H
\ No newline at end of file
#endif // LYNXVELOCITYROOTMEANSQUARE_H
......@@ -38,7 +38,6 @@ protected:
virtual Real computeDT() override;
private:
const Real _log_dt;
const Real _first_dt;
const Real _max_dt;
......
......@@ -65,4 +65,4 @@ LynxPressureAction::act()
_problem->addBoundaryCondition(kernel_name, unique_kernel_name, params);
}
}
\ 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/> */
/******************************************************************************/
#include "LynxDamageAux.h"
registerMooseObject("LynxApp", LynxDamageAux);
template <>
InputParameters
validParams<LynxDamageAux>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription("Updating the damage auxiliary variable.");
return params;
}
LynxDamageAux::LynxDamageAux(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_damage_rate(getDefaultMaterialProperty<Real>("damage_rate"))
{
}
Real
LynxDamageAux::computeValue()
{
Real damage_rate = _damage_rate[_qp];
if (damage_rate > (1.0 - _u_old[_qp]) / _dt)
damage_rate = (1.0 - _u_old[_qp]) / _dt;
return _u_old[_qp] + damage_rate * _dt;
}
\ No newline at end of file
......@@ -40,4 +40,4 @@ Real
LynxEffectivePressureAux::computeValue()
{
return -_stress[_qp].trace() / 3.0;
}
\ No newline at end of file
}
......@@ -27,8 +27,7 @@ InputParameters
validParams<LynxEqvStrainAux>()
{
InputParameters params = validParams<LynxStrainAuxBase>();
params.addClassDescription(
"Calculates the equivalent strain of the given tensor.");
params.addClassDescription("Calculates the equivalent strain of the given tensor.");
return params;
}
......@@ -41,4 +40,4 @@ Real
LynxEqvStrainAux::computeValue()
{
return _u_old[_qp] + std::sqrt(2.0 / 3.0) * (*_strain_incr)[_qp].deviatoric().L2norm();
}
\ No newline at end of file
}
......@@ -40,4 +40,4 @@ Real
LynxEqvStrainRateAux::computeValue()
{
return std::sqrt(2.0 / 3.0) * (*_strain_incr)[_qp].deviatoric().L2norm() / _dt;
}
\ No newline at end of file
}
......@@ -27,13 +27,12 @@ InputParameters
validParams<LynxHeatFluxAux>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription(
"Calculates the heat flux in each element for the given direction.");
params.addClassDescription("Calculates the heat flux in each element for the given direction.");
params.addRequiredCoupledVar("temperature", "The temperature variable.");
params.addRequiredRangeCheckedParam<unsigned int>(
"component",
"component >= 0 & component <= 2",
"Integer corresponding to direction of the heat flux (0, 1, 2.");
"component",
"component >= 0 & component <= 2",
"Integer corresponding to direction of the heat flux (0, 1, 2.");
return params;
}
......@@ -54,5 +53,5 @@ LynxHeatFluxAux::computeValue()
else
_cond_bulk = _thermal_diff[_qp] * _rhoC_b[_qp];
return -1*_cond_bulk*_grad_T[_qp](_component);
}
\ No newline at end of file
return -1 * _cond_bulk * _grad_T[_qp](_component);
}
......@@ -67,4 +67,4 @@ LynxPorosityAux::computeEvInDot()
{
RankTwoTensor e_in_dot = (_inelastic_strain[_qp] - _inelastic_strain_old[_qp]) / _dt;
return e_in_dot.trace();
}
\ No newline at end of file
}
......@@ -51,4 +51,4 @@ Real
LynxStrainAux::computeValue()
{
return _u_old[_qp] + (*_strain_incr)[_qp](_i, _j);
}
\ No newline at end of file
}
......@@ -69,4 +69,4 @@ MooseEnum
LynxStrainAuxBase::strainType()
{
return MooseEnum("total=1 inelastic=2 elastic=3 viscous=4 damage=5 plastic=6 thermal=7");
}
\ No newline at end of file
}
......@@ -51,4 +51,4 @@ Real
LynxStrainRateAux::computeValue()
{
return (*_strain_incr)[_qp](_i, _j) / _dt;
}
\ No newline at end of file
}
......@@ -53,4 +53,4 @@ Real
LynxStressAux::computeValue()
{
return _stress[_qp](_i, _j) - (_i == _j) * _pt[_qp];
}
\ No newline at end of file
}
......@@ -33,4 +33,4 @@ LynxStressAuxBase::LynxStressAuxBase(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_stress(getMaterialProperty<RankTwoTensor>("stress"))
{
}
\ No newline at end of file
}