Line data Source code
1 : // Copyright 2024, UChicago Argonne, LLC
2 : // All Rights Reserved
3 : // Software Name: NEML2 -- the New Engineering material Model Library, version 2
4 : // By: Argonne National Laboratory
5 : // OPEN SOURCE LICENSE (MIT)
6 : //
7 : // Permission is hereby granted, free of charge, to any person obtaining a copy
8 : // of this software and associated documentation files (the "Software"), to deal
9 : // in the Software without restriction, including without limitation the rights
10 : // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 : // copies of the Software, and to permit persons to whom the Software is
12 : // furnished to do so, subject to the following conditions:
13 : //
14 : // The above copyright notice and this permission notice shall be included in
15 : // all copies or substantial portions of the Software.
16 : //
17 : // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 : // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 : // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 : // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 : // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 : // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 : // THE SOFTWARE.
24 :
25 : #include "neml2/models/solid_mechanics/crystal_plasticity/VoceSingleSlipHardeningRule.h"
26 : #include "neml2/tensors/Scalar.h"
27 :
28 : namespace neml2
29 : {
30 : register_NEML2_object(VoceSingleSlipHardeningRule);
31 :
32 : OptionSet
33 2 : VoceSingleSlipHardeningRule::expected_options()
34 : {
35 2 : OptionSet options = SingleSlipHardeningRule::expected_options();
36 2 : options.doc() = "Voce hardening for a SingleSlipStrength type model defined by \\f$ \\dot{\\tau} "
37 : "= \\theta_0 \\left( 1 - \\frac{\\tau}{\\tau_f} \\right) "
38 : "\\sum_{i=1}^{n_{slip}} \\left| \\dot{\\gamma}_i \\right| \\f$ where \\f$ "
39 : "\\theta_0 \\f$ is the initial rate of work hardening, \\f$ \\tau_f \\f$ is the "
40 : "saturated, maximum value of the slip system strength, and \\f$ \\dot{\\gamma}_i "
41 2 : "\\f$ is the slip rate on each system.";
42 :
43 4 : options.set_parameter<TensorName<Scalar>>("initial_slope");
44 4 : options.set("initial_slope").doc() = "The initial rate of hardening";
45 4 : options.set_parameter<TensorName<Scalar>>("saturated_hardening");
46 4 : options.set("saturated_hardening").doc() =
47 2 : "The final, saturated value of the slip system strength";
48 2 : return options;
49 0 : }
50 :
51 2 : VoceSingleSlipHardeningRule::VoceSingleSlipHardeningRule(const OptionSet & options)
52 : : SingleSlipHardeningRule(options),
53 6 : _theta_0(declare_parameter<Scalar>("initial_slope", "initial_slope")),
54 10 : _tau_f(declare_parameter<Scalar>("saturated_hardening", "saturated_hardening"))
55 : {
56 2 : }
57 :
58 : void
59 4 : VoceSingleSlipHardeningRule::set_value(bool out, bool dout_din, bool /*d2out_din2*/)
60 : {
61 4 : if (out)
62 3 : _tau_dot = _theta_0 * (1 - _tau / _tau_f) * _gamma_dot_sum;
63 :
64 4 : if (dout_din)
65 : {
66 2 : if (_tau.is_dependent())
67 2 : _tau_dot.d(_tau) = -_theta_0 / _tau_f * _gamma_dot_sum;
68 :
69 2 : if (_gamma_dot_sum.is_dependent())
70 2 : _tau_dot.d(_gamma_dot_sum) = _theta_0 * (1 - _tau / _tau_f);
71 : }
72 4 : }
73 : } // namespace neml2
|