NEML2 1.4.0
Loading...
Searching...
No Matches
OlevskySinteringStress.cxx
1// Copyright 2023, 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/OlevskySinteringStress.h"
26
27namespace neml2
28{
29register_NEML2_object(OlevskySinteringStress);
30
33{
35 options.doc() = "Define the Olevsky-Skorohod sintering stress to be used in conjunction with "
36 "poroplasticity yield functions such as the GTNYieldFunction. The sintering "
37 "stress is defined as \\f$ \\sigma_s = 3 \\dfrac{\\gamma}{r} \\phi^2 \\f$, where "
38 "\\f$ \\gamma \\f$ is the surface tension, \\f$ r \\f$ is the size of the "
39 "particles/powders, and \\f$ \\phi \\f$ is the void fraction.";
40
41 options.set<VariableName>("sintering_stress") = VariableName("state", "internal", "ss");
42 options.set("sintering_stress").doc() = "Sintering stress";
43
44 options.set<VariableName>("void_fraction") = VariableName("state", "internal", "f");
45 options.set("void_fraction").doc() = "Void fraction";
46
47 options.set<CrossRef<Scalar>>("surface_tension");
48 options.set("surface_tension").doc() = "Surface tension";
49
50 options.set<CrossRef<Scalar>>("particle_radius");
51 options.set("particle_radius").doc() = "Particle radius";
52
53 return options;
54}
55
57 : Model(options),
58 _s(declare_output_variable<Scalar>("sintering_stress")),
59 _phi(declare_input_variable<Scalar>("void_fraction")),
60 _gamma(declare_parameter<Scalar>("gamma", "surface_tension")),
61 _r(declare_parameter<Scalar>("r", "particle_radius"))
62{
63}
64
65void
67{
68 if (out)
69 _s = 3 * _gamma * _phi * _phi / _r;
70
71 if (dout_din)
72 _s.d(_phi) = 6 * _gamma * _phi / _r;
73
74 if (d2out_din2)
75 _s.d(_phi, _phi) = 6 * _gamma / _r;
76}
77} // namespace neml2
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The accessor containing all the information needed to access an item in a LabeledAxis.
Definition LabeledAxisAccessor.h:44
The base class for all constitutive models.
Definition Model.h:53
const torch::TensorOptions & options() const
This model's tensor options.
Definition Model.h:116
static OptionSet expected_options()
Definition Model.cxx:33
Definition OlevskySinteringStress.h:39
const Scalar & _r
Particle radius.
Definition OlevskySinteringStress.h:58
const Scalar & _gamma
Surface tension.
Definition OlevskySinteringStress.h:55
static OptionSet expected_options()
Definition OlevskySinteringStress.cxx:32
const Variable< Scalar > & _phi
Void fraction.
Definition OlevskySinteringStress.h:52
Variable< Scalar > & _s
Sintering stress.
Definition OlevskySinteringStress.h:49
OlevskySinteringStress(const OptionSet &options)
Definition OlevskySinteringStress.cxx:56
void set_value(bool out, bool dout_din, bool d2out_din2) override
The map between input -> output, and optionally its derivatives.
Definition OlevskySinteringStress.cxx:66
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
The (logical) scalar.
Definition Scalar.h:38
Derivative d(const VariableBase &x)
Create a wrapper representing the derivative dy/dx.
Definition Variable.cxx:102
Definition CrossRef.cxx:32
LabeledAxisAccessor VariableName
Definition Variable.h:35