Commit d126df66 authored by Antoine Jacquey's avatar Antoine Jacquey

Merge branch 'devel' into HEAD

parents 270aed75 cb25bd34
......@@ -217,3 +217,6 @@ python/peacock/tests/postprocessor_tab/TestPostprocessorPluginManager_test_scrip
!python/peacock/tests/**/input/*.*
peacock_tmp_diff.exo
*.e.diff
# VSCode
.vscode/ipch
\ 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 LYNXHOLDSTRESSACTION_H
#define LYNXHOLDSTRESSACTION_H
#include "Action.h"
class LynxHoldStressAction;
template <>
InputParameters validParams<LynxHoldStressAction>();
class LynxHoldStressAction : public Action
{
public:
LynxHoldStressAction(const InputParameters & params);
virtual void act() override;
protected:
std::vector<std::vector<AuxVariableName>> _save_in_vars;
std::vector<bool> _has_save_in_vars;
};
#endif // LYNXHOLDSTRESSACTION_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 LYNXELASTICEQVSTRAINAUX_H
#define LYNXELASTICEQVSTRAINAUX_H
#include "LynxElasticStrainAuxBase.h"
class LynxElasticEqvStrainAux;
template <>
InputParameters validParams<LynxElasticEqvStrainAux>();
class LynxElasticEqvStrainAux : public LynxElasticStrainAuxBase
{
public:
LynxElasticEqvStrainAux(const InputParameters & parameters);
protected:
virtual Real computeValue();
};
#endif // LYNXELASTICEQVSTRAINAUX_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 LYNXELASTICSTRAINAUXBASE_H
#define LYNXELASTICSTRAINAUXBASE_H
#include "AuxKernel.h"
#include "RankTwoTensor.h"
#include "DerivativeMaterialInterface.h"
class LynxElasticStrainAuxBase;
template <>
InputParameters validParams<LynxElasticStrainAuxBase>();
class LynxElasticStrainAuxBase : public DerivativeMaterialInterface<AuxKernel>
{
public:
LynxElasticStrainAuxBase(const InputParameters & parameters);
const MaterialProperty<RankTwoTensor> & _elastic_strain;
};
#endif // LYNXELASTICSTRAINAUXBASE_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 LYNXELASTICVOLSTRAINAUX_H
#define LYNXELASTICVOLSTRAINAUX_H
#include "LynxElasticStrainAuxBase.h"
class LynxElasticVolStrainAux;
template <>
InputParameters validParams<LynxElasticVolStrainAux>();
class LynxElasticVolStrainAux : public LynxElasticStrainAuxBase
{
public:
LynxElasticVolStrainAux(const InputParameters & parameters);
protected:
virtual Real computeValue();
};
#endif // LYNXELASTICVOLSTRAINAUX_H
......@@ -21,24 +21,20 @@
#ifndef LYNXSTRAINRATIOAUX_H
#define LYNXSTRAINRATIOAUX_H
#include "AuxKernel.h"
#include "RankTwoTensor.h"
#include "DerivativeMaterialInterface.h"
#include "LynxElasticStrainAuxBase.h"
class LynxStrainRatioAux;
template <>
InputParameters validParams<LynxStrainRatioAux>();
class LynxStrainRatioAux : public DerivativeMaterialInterface<AuxKernel>
class LynxStrainRatioAux : public LynxElasticStrainAuxBase
{
public:
LynxStrainRatioAux(const InputParameters & parameters);
protected:
virtual Real computeValue();
const MaterialProperty<RankTwoTensor> & _elastic_strain;
};
#endif // LYNXSTRAINRATIOAUX_H
......@@ -39,7 +39,7 @@ protected:
virtual Real computeQpResidual() override;
const Real & _value;
Function * const _function;
const Function * _function;
Real _rand_per;
const MaterialProperty<Real> & _rhoC_b;
};
......
/******************************************************************************/
/* 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 LYNXHOLDSTRESSBC_H
#define LYNXHOLDSTRESSBC_H
#include "IntegratedBC.h"
class LynxHoldStressBC;
class Function;
template <>
InputParameters validParams<LynxHoldStressBC>();
class LynxHoldStressBC : public IntegratedBC
{
public:
LynxHoldStressBC(const InputParameters & parameters);
protected:
virtual Real computeQpResidual();
bool _coupled_pf;
const VariableValue & _pf;
const int _component;
const Real _bulk_modulus;
const Real _shear_modulus;
const MaterialProperty<RankTwoTensor> & _elastic_strain_old;
const MaterialProperty<Real> & _biot_coeff;
};
#endif // LYNXHOLDSTRESSBC_H
......@@ -39,7 +39,7 @@ protected:
const int _component;
const Real _value;
Function * const _function;
const Function * _function;
};
#endif // LYNXPRESSUREBC_H
......@@ -39,7 +39,7 @@ protected:
const VariableValue & _u_old;
const Real & _value;
Function * const _function;
const Function * _function;
};
#endif // LYNXVELOCITYBC_H
......@@ -42,7 +42,7 @@ protected:
std::vector<const VariableValue *> _disp;
const int _component;
const Real _value;
Function * const _function;
const Function * _function;
const Real _rho_ext;
const Real _g;
const MaterialProperty<Real> & _rho_b;
......
......@@ -39,7 +39,7 @@ protected:
virtual Real value(const Point & p) override;
virtual RealGradient gradient(const Point & p) override;
Function & _func;
const Function & _func;
Real _rand_per;
};
......
......@@ -46,7 +46,7 @@ protected:
const MaterialProperty<Real> & _radiogenic_heat;
const MaterialProperty<Real> & _rho_b;
const MaterialProperty<Real> & _dinvrho_dtemp;
const MaterialProperty<Real> & _inelastic_heat;
const MaterialProperty<Real> & _inelastic_heat_mat;
const MaterialProperty<Real> & _adiabatic_heat;
const MaterialProperty<Real> & _damage_heat;
// const MaterialProperty<Real> & _dinelastic_heat_dtemp;
......@@ -54,6 +54,8 @@ protected:
const bool _coupled_disp;
unsigned int _ndisp;
std::vector<unsigned int> _disp_var;
const bool _coupled_inelastic_heat;
const VariableValue & _inelastic_heat;
};
#endif // LYNXHEATSOURCES_H
......@@ -45,12 +45,12 @@ protected:
virtual Real computeQpJacobian();
virtual Real computeQpOffDiagJacobian(unsigned jvar);
const Real _penalty;
PenaltyType _penalty_type;
unsigned _ndisp;
std::vector<unsigned> _disp_var;
const MaterialProperty<Real> & _penalty;
const MaterialProperty<RankTwoTensor> & _strain_increment;
};
......
......@@ -39,6 +39,7 @@ public:
virtual void computeResidual() override;
virtual void computeJacobian() override;
virtual void computeOffDiagJacobian(MooseVariableFEBase & jvar) override;
using Kernel::computeOffDiagJacobian;
protected:
virtual Real computeQpResidual() override;
......
......@@ -46,7 +46,6 @@ protected:
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);
......@@ -55,6 +54,7 @@ protected:
virtual Real getConvexProjection(const Real & x1, const Real & x2);
virtual Real strainRatio(const RankTwoTensor & elastic_strain);
virtual RankTwoTensor rotatedElasticStrain(const RankTwoTensor & elastic_strain);
virtual void computeQpThermalSources() override;
// Coupled variables
bool _coupled_dam;
......@@ -87,6 +87,7 @@ protected:
// Damage properties
MaterialProperty<Real> & _damage_rate;
MaterialProperty<Real> & _damage_heat;
};
#endif // LYNXDAMAGEDEFORMATION_H
......@@ -73,7 +73,7 @@ protected:
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();
virtual void computeQpThermalSources();
// Coupled variables
unsigned int _ndisp;
......
......@@ -44,7 +44,7 @@ protected:
const std::vector<Real> _beta_fluid;
const std::vector<Real> _beta_solid;
Real _temp_ref;
Function * const _temp_ref_fct;
const Function * _temp_ref_fct;
};
#endif // LYNXDENSITYTHERMAL_H
......@@ -49,8 +49,8 @@ protected:
const MaterialProperty<Real> & _K;
const MaterialProperty<RankFourTensor> & _tangent_modulus;
const MaterialProperty<RankTwoTensor> & _strain_increment;
const MaterialProperty<RankTwoTensor> & _inelastic_strain;
const MaterialProperty<RankTwoTensor> & _inelastic_strain_old;
const MaterialProperty<RankTwoTensor> & _viscous_strain_incr;
const MaterialProperty<RankTwoTensor> & _plastic_strain_incr;
MaterialProperty<Real> & _biot;
MaterialProperty<Real> & _C_d;
MaterialProperty<Real> & _C_biot;
......
......@@ -227,7 +227,7 @@ struct damage_plasticity
Real _alpha2; // square of alpha parameter for capped yield
Real _dxi_cr_dp; // derivative wrt pressure of the critical strain ratio
Real _dxi_cr_dq; // derivative wrt eqv_stress of the critical strain ratio
Real _dmu2_dxi_cr; // derivative wrt the critical strain ratio of the square of alpha parameter
Real _dalpha2_dxi_cr; // derivative wrt the critical strain ratio of the square of alpha parameter
damage_plasticity()
: _xi0(-std::sqrt(3.0)),
_gamma(0.0),
......@@ -248,7 +248,7 @@ struct damage_plasticity
_alpha2(0.0),
_dxi_cr_dp(0.0),
_dxi_cr_dq(0.0),
_dmu2_dxi_cr(0.0)
_dalpha2_dxi_cr(0.0)
{
}
void fill(const Real xi0,
......
/******************************************************************************/
/* 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 "LynxHoldStressAction.h"
#include "Factory.h"
#include "FEProblem.h"
#include "Conversion.h"
registerMooseAction("LynxApp", LynxHoldStressAction, "add_bc");
template <>
InputParameters
validParams<LynxHoldStressAction>()
{
InputParameters params = validParams<Action>();
params.addClassDescription("Set up hold stress boundary conditions.");
params.addRequiredParam<std::vector<BoundaryName>>(
"boundary", "The list of boundary IDs from the mesh where the pressure will be applied.");
params.addRequiredParam<std::vector<NonlinearVariableName>>(
"displacements",
"The displacements appropriate for the simulation geometry and coordinate system");
// Elastic moduli parameters
params.addRangeCheckedParam<Real>(
"bulk_modulus", "bulk_modulus >= 0.0", "The drained bulk modulus of the material.");
params.addRangeCheckedParam<Real>(
"shear_modulus", "shear_modulus >= 0.0", "The shear modulus of the material.");
params.addCoupledVar("fluid_pressure", "The fluid pressure variable.");
return params;
}
LynxHoldStressAction::LynxHoldStressAction(const InputParameters & params) : Action(params) {}
void
LynxHoldStressAction::act()
{
const std::string kernel_name = "LynxHoldStressBC";
std::vector<NonlinearVariableName> displacements =
getParam<std::vector<NonlinearVariableName>>("displacements");
// Create pressure BCs
for (unsigned int i = 0; i < displacements.size(); ++i)
{
// Create unique kernel name for each of the components
std::string unique_kernel_name = kernel_name + "_" + _name + "_" + Moose::stringify(i);
InputParameters params = _factory.getValidParams(kernel_name);
params.applyParameters(parameters());
params.set<bool>("use_displaced_mesh") = true;
params.set<unsigned int>("component") = i;
params.set<NonlinearVariableName>("variable") = displacements[i];
_problem->addBoundaryCondition(kernel_name, unique_kernel_name, params);
}
}
/******************************************************************************/
/* 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 "LynxElasticEqvStrainAux.h"
registerMooseObject("LynxApp", LynxElasticEqvStrainAux);
template <>
InputParameters
validParams<LynxElasticEqvStrainAux>()
{
InputParameters params = validParams<LynxElasticStrainAuxBase>();
params.addClassDescription(
"Access the volumetric elastic strain.");
return params;
}
LynxElasticEqvStrainAux::LynxElasticEqvStrainAux(const InputParameters & parameters)
: LynxElasticStrainAuxBase(parameters)
{
}
Real
LynxElasticEqvStrainAux::computeValue()
{
return std::sqrt(2.0 / 3.0) * _elastic_strain[_qp].deviatoric().L2norm();
}
/******************************************************************************/
/* 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 "LynxElasticStrainAuxBase.h"
template <>
InputParameters
validParams<LynxElasticStrainAuxBase>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription(
"Base class to access the elastic strain tensor.");
return params;
}
LynxElasticStrainAuxBase::LynxElasticStrainAuxBase(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_elastic_strain(getDefaultMaterialProperty<RankTwoTensor>("elastic_strain"))
{
}
/******************************************************************************/
/* 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 "LynxElasticVolStrainAux.h"
registerMooseObject("LynxApp", LynxElasticVolStrainAux);
template <>
InputParameters
validParams<LynxElasticVolStrainAux>()
{
InputParameters params = validParams<LynxElasticStrainAuxBase>();
params.addClassDescription(
"Access the volumetric elastic strain.");
return params;
}
LynxElasticVolStrainAux::LynxElasticVolStrainAux(const InputParameters & parameters)
: LynxElasticStrainAuxBase(parameters)
{
}
Real
LynxElasticVolStrainAux::computeValue()
{
return _elastic_strain[_qp].trace();
}
......@@ -26,15 +26,14 @@ template <>
InputParameters
validParams<LynxStrainRatioAux>()
{
InputParameters params = validParams<AuxKernel>();
InputParameters params = validParams<LynxElasticStrainAuxBase>();
params.addClassDescription(
"Access the strain ratio (volumetric strain on norm of the elastic strain).");
return params;
}
LynxStrainRatioAux::LynxStrainRatioAux(const InputParameters & parameters)
: DerivativeMaterialInterface<AuxKernel>(parameters),
_elastic_strain(getDefaultMaterialProperty<RankTwoTensor>("elastic_strain"))