Commit 270aed75 authored by Antoine Jacquey's avatar Antoine Jacquey

Merge branch 'devel' into 'master'

Damage rheology working

See merge request !1
parents 89da1ea4 b6a8a2b0
// /******************************************************************************/
// /* 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
......@@ -18,26 +18,35 @@
/* along with this program. If not, see <http://www.gnu.org/licenses/> */
/******************************************************************************/
#ifndef LYNXDAMAGEAUX_H
#define LYNXDAMAGEAUX_H
#ifndef LYNXDAMAGERATE_H
#define LYNXDAMAGERATE_H
#include "AuxKernel.h"
#include "Kernel.h"
#include "DerivativeMaterialInterface.h"
class LynxDamageAux;
class LynxDamageRate;
template <>
InputParameters validParams<LynxDamageAux>();
InputParameters validParams<LynxDamageRate>();
class LynxDamageAux : public DerivativeMaterialInterface<AuxKernel>
class LynxDamageRate : public DerivativeMaterialInterface<Kernel>
{
public:
LynxDamageAux(const InputParameters & parameters);
LynxDamageRate(const InputParameters & parameters);
protected:
virtual Real computeValue() override;
const MaterialProperty<Real> & _damage_rate;
virtual Real computeQpResidual() override;
virtual Real computeQpJacobian() override;
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
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 // LYNXDAMAGEAUX_H
\ No newline at end of file
#endif // LYNXDAMAGERATE_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
......@@ -28,26 +28,34 @@ class LynxDamageDeformation;
template <>
InputParameters validParams<LynxDamageDeformation>();
class LynxDamageDeformation : public LynxDeformation
class LynxDamageDeformation : public LynxDeformationBase
{
public:
LynxDamageDeformation(const InputParameters & parameters);
virtual ~LynxDamageDeformation() {}
protected:
virtual void initQpStatefulProperties() override;
virtual void computeQpDeformation() override;
virtual void elasticModuli() override;
virtual void initializeQpDeformation() override;
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) override;
virtual void convexPlasticCorrection(Real & pressure, RankTwoTensor & stress_dev);
virtual Real convexReferencePressure(const Real & p_tr, const Real & q_tr);
virtual Real convexPlasticYield2(const Real & rho);
virtual void damageCorrection() 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);
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 convexPlasticYield2(const Real & pressure, const Real & eqv_stress);
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;
......@@ -55,39 +63,30 @@ protected:
bool _coupled_phi;
const VariableValue & _porosity;
// Strain parameters
// Elastic moduli parameters
const std::vector<Real> _damage_modulus;
// Creep parameters
// Plastic parameters
const std::vector<Real> _critical_pressure;
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;
// Convex yield parameters
Real _p_cr;
Real _xi0;
Real _p_r;
Real _q_r;
Real _dp_r_dp_tr;
Real _dp_r_dq_tr;
Real _p_tr;
Real _q_tr;
Real _rho_tr;
Real _rp;
Real _rq;
Real _p_k;
// Damage-Plasticity structure
damage_plasticity * _damage_plasticity;
// Strain properties
MaterialProperty<RankTwoTensor> & _elastic_strain;
const MaterialProperty<RankTwoTensor> & _elastic_strain_old;
// Viscous properties
// Plastic properties
// Damage-Plasticity utilities
Real _dyield_dp_tr;
Real _dyield_dq_tr;
// Stress properties
MaterialProperty<RankTwoTensor> & _dstress_ddamage;
MaterialProperty<RankTwoTensor> & _ddamage_rate_dstrain;
// Damage properties
MaterialProperty<Real> & _damage_rate;
};
#endif // LYNXDAMAGEDEFORMATION_H
......@@ -21,105 +21,28 @@
#ifndef LYNXDEFORMATION_H
#define LYNXDEFORMATION_H
#include "LynxMaterialBase.h"
#include "LynxRheologyStructures.h"
#include "RankTwoTensor.h"
#include "RankFourTensor.h"
#include "LynxDeformationBase.h"
class LynxDeformation;
template <>
InputParameters validParams<LynxDeformation>();
class LynxDeformation : public LynxMaterialBase
class LynxDeformation : public LynxDeformationBase
{
public:
LynxDeformation(const InputParameters & parameters);
virtual ~LynxDeformation() {}
static MooseEnum strainModel();
static MooseEnum viscousUpdate();
protected:
virtual void initQpStatefulProperties() override;
virtual void computeProperties() override;
virtual void computeQpProperties() override;
virtual void computeStrainIncrement();
virtual void calculateSmallStrain(const RankTwoTensor & grad_tensor,
const RankTwoTensor & grad_tensor_old);
virtual void calculateFiniteStrain(const RankTwoTensor & grad_tensor,
const RankTwoTensor & grad_tensor_old);
virtual void computeQpDeformation();
virtual void elasticModuli();
virtual void volumetricDeformation(Real & pressure);
virtual void deviatoricDeformation(const Real & pressure, RankTwoTensor & stress_dev);
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev);
virtual void tangentOperator();
virtual void finiteTangentOperator();
virtual Real computeStokeEffectiveViscosity(const Real & pressure);
virtual RankTwoTensor computeStokeEffectiveViscosityDerivative();
virtual Real computeEffectiveViscosity(const Real & pressure, const Real & eqv_stress);
virtual Real computeCreepRate(const Real A, const Real n, const Real eqv_stress);
virtual Real viscousIncrement(const Real & pressure, const Real & eqv_stress);
virtual void plasticCorrection(Real & pressure, RankTwoTensor & stress_dev) override;
virtual Real computePlasticityYield(const Real & pressure, const Real & eqv_stress);
virtual Real plasticIncrement(const Real & pressure, const Real & eqv_stress);
virtual RankTwoTensor spinRotation(const RankTwoTensor & tensor);
virtual void updateSpinTangentModulus();
virtual void computeCreepProperties(const Real & pressure);
virtual void updateCreepParameters();
virtual Real plasticIncrement(const Real & /*pressure*/, const Real & eqv_stress);
virtual void computePlasticityProperties(const Real & pressure);
virtual void updatePlasticityParameters();
virtual Real rootBrent(iterative_viscous & viscous_model, const Real x1, const Real x2);
virtual Real rootNewtonSafe(iterative_viscous & viscous_model, const Real x1, const Real x2);
void computeQpThermalSources();
// Coupled variables
unsigned int _ndisp;
std::vector<const VariableGradient *> _grad_disp;
std::vector<const VariableGradient *> _grad_disp_old;
bool _coupled_temp;
const VariableValue & _temp;
bool _coupled_plith;
const VariableValue & _plith;
const VariableValue & _plith_old;
bool _coupled_pdyn;
const VariableValue & _pdyn;
// Strain parameters
const MooseEnum _strain_model;
bool _vol_locking_correction;
std::vector<RankTwoTensor> _deformation_gradient;
std::vector<RankTwoTensor> _deformation_gradient_old;
const Real & _current_elem_volume;
// Elastic moduli parameters
const bool _has_bulk_modulus;
const bool _has_shear_modulus;
const std::vector<Real> _bulk_modulus;
const std::vector<Real> _shear_modulus;
// Creep parameters
const bool _has_diffusion_creep;
const std::vector<Real> _A_diffusion;
const std::vector<Real> _E_diffusion;
const std::vector<Real> _V_diffusion;
const bool _has_dislocation_creep;
const std::vector<Real> _A_dislocation;
const std::vector<Real> _E_dislocation;
const std::vector<Real> _V_dislocation;
const std::vector<Real> _n_dislocation;
const Real _gas_constant;
const MooseEnum _viscous_update;
const Real _tol;
const unsigned int _itmax;
const bool _has_background_strain_rate;
bool _has_initial_viscosity;
const std::vector<Real> _initial_viscosity;
const Real _background_strain_rate;
const std::vector<Real> _eta_min;
const std::vector<Real> _eta_max;
// Plastic parameters
const bool _has_plasticity;
const std::vector<Real> _friction_angle_0;
const std::vector<Real> _cohesion_0;
const std::vector<Real> _friction_angle_res;
......@@ -130,52 +53,12 @@ protected:
std::vector<Real> _one_on_plastic_eta;
const bool _has_hardening;
// Rheology boolean
const bool _has_elastic;
const bool _has_viscous;
// Creep structures
diffusion_creep * _diffusion_creep;
dislocation_creep * _dislocation_creep;
iterative_viscous * _iterative_viscous;
// Plasticity structure
plasticity * _plasticity;
// Viscous scalars for tangent modulus
Real _stress_corr_v;
Real _dq_dq_tr_v;
// Plastic scalars for tangent modulus
Real _stress_corr_p;
Real _dp_dp_tr_p;
Real _dp_dq_tr_p;
Real _dq_dp_tr_p;
Real _dq_dq_tr_p;
// Strain properties
MaterialProperty<RankTwoTensor> & _strain_increment;
MaterialProperty<RankTwoTensor> & _spin_tensor;
const MaterialProperty<RankTwoTensor> & _thermal_strain_incr;
// Viscous properties
MaterialProperty<RankTwoTensor> & _viscous_strain_incr;
MaterialProperty<Real> & _eta_eff;
// Plastic properties
MaterialProperty<RankTwoTensor> & _plastic_strain_incr;
MaterialProperty<Real> & _plastic_yield_function;
MaterialProperty<Real> * _intnl;
const MaterialProperty<Real> * _intnl_old;
// Stress properties
MaterialProperty<RankTwoTensor> & _stress;
const MaterialProperty<RankTwoTensor> & _stress_old;
MaterialProperty<Real> & _K;
MaterialProperty<Real> & _G;
MaterialProperty<RankFourTensor> & _tangent_modulus;
MaterialProperty<Real> & _inelastic_heat;
MaterialProperty<RankTwoTensor> & _dinelastic_heat_dstrain;
};
#endif // LYNXDEFORMATION_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 LYNXDEFORMATIONBASE_H
#define LYNXDEFORMATIONBASE_H
#include "LynxMaterialBase.h"
#include "LynxRheologyStructures.h"
#include "RankTwoTensor.h"
#include "RankFourTensor.h"
class LynxDeformationBase;
template <>
InputParameters validParams<LynxDeformationBase>();
class LynxDeformationBase : public LynxMaterialBase
{
public:
LynxDeformationBase(const InputParameters & parameters);
virtual ~LynxDeformationBase() {}
static MooseEnum strainModel();
static MooseEnum viscousUpdate();
protected:
virtual void initQpStatefulProperties() override;
virtual void computeProperties() override;
virtual void computeQpProperties() override;
virtual void computeStrainIncrement();
virtual void calculateSmallStrain(const RankTwoTensor & grad_tensor,
const RankTwoTensor & grad_tensor_old);
virtual void calculateFiniteStrain(const RankTwoTensor & grad_tensor,
const RankTwoTensor & grad_tensor_old);
virtual void computeQpDeformation();
virtual void initializeQpDeformation();
virtual void elasticModuli();
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();
virtual void tangentOperator();
virtual RankFourTensor viscousTangentOperator(const RankFourTensor & flow_direction_dyad);
virtual RankFourTensor plasticTangentOperator(const RankTwoTensor & flow_direction,
const RankFourTensor & flow_direction_dyad);
virtual RankFourTensor damageTangentOperator(const RankFourTensor & /*tme*/);
virtual void finiteTangentOperator();
virtual Real computeStokeEffectiveViscosity(const Real & pressure);
virtual RankTwoTensor computeStokeEffectiveViscosityDerivative();
virtual Real computeEffectiveViscosity(const Real & pressure, const Real & eqv_stress);
virtual Real computeCreepRate(const Real A, const Real n, const Real eqv_stress);
virtual Real viscousIncrement(const Real & pressure, const Real & eqv_stress);
virtual RankTwoTensor spinRotation(const RankTwoTensor & tensor);
virtual void updateSpinTangentModulus();
virtual void computeCreepProperties(const Real & pressure);
virtual void updateCreepParameters();
virtual Real rootBrent(iterative_viscous & viscous_model, const Real x1, const Real x2);
virtual Real rootNewtonSafe(iterative_viscous & viscous_model, const Real x1, const Real x2);
void computeQpThermalSources();
// Coupled variables
unsigned int _ndisp;
std::vector<const VariableGradient *> _grad_disp;
std::vector<const VariableGradient *> _grad_disp_old;
bool _coupled_temp;
const VariableValue & _temp;
bool _coupled_plith;
const VariableValue & _plith;
const VariableValue & _plith_old;
bool _coupled_pdyn;
const VariableValue & _pdyn;
// Strain parameters
const MooseEnum _strain_model;
bool _vol_locking_correction;
std::vector<RankTwoTensor> _deformation_gradient;
std::vector<RankTwoTensor> _deformation_gradient_old;
const Real & _current_elem_volume;
// Elastic moduli parameters
const bool _has_bulk_modulus;
const bool _has_shear_modulus;
const std::vector<Real> _bulk_modulus;
const std::vector<Real> _shear_modulus;
// Creep parameters
const bool _has_diffusion_creep;
const std::vector<Real> _A_diffusion;
const std::vector<Real> _E_diffusion;
const std::vector<Real> _V_diffusion;
const bool _has_dislocation_creep;
const std::vector<Real> _A_dislocation;
const std::vector<Real> _E_dislocation;
const std::vector<Real> _V_dislocation;
const std::vector<Real> _n_dislocation;
const Real _gas_constant;
const MooseEnum _viscous_update;
const Real _tol;
const unsigned int _itmax;
const bool _has_background_strain_rate;
bool _has_initial_viscosity;
const std::vector<Real> _initial_viscosity;
const Real _background_strain_rate;
const std::vector<Real> _eta_min;
const std::vector<Real> _eta_max;
// Rheology boolean
const bool _has_elastic;
const bool _has_viscous;
bool _has_plasticity;
// Creep structures
diffusion_creep * _diffusion_creep;
dislocation_creep * _dislocation_creep;
iterative_viscous * _iterative_viscous;
// RankFourTensor utilities
RankTwoTensor _identity_two;
RankFourTensor _volumetric_four;
RankFourTensor _identity_four;