https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MoelansInterfaceFits.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11#include "InputParameters.h"
12#include "MooseEnum.h"
13#include "MathUtils.h"
14
15#include <array>
16
18{
21{
23 // the enum values match the Fit enum class
24 MooseEnum fit("moelans2022=0 moelans2009=1", "moelans2022");
25 params.addParam<MooseEnum>(
26 "interface_fit",
27 fit,
28 "Polynomial fits relating gamma to the interfacial free energy and diffuse interface width: "
29 "'moelans2022' (N. Moelans, Mater. Des. 217, 110592, 2022, valid for 0.53 <= gamma <= 40) "
30 "or the earlier 'moelans2009' fits");
31 return params;
32}
33
34Real
35inverseGamma(Real g2, Fit fit)
36{
37 // coefficients in ascending powers of g^2
38 static constexpr std::array<Real, 5> c2022{{2.0033, -8.1819, 10.323, -1.8169, -3.0944}};
39 static constexpr std::array<Real, 5> c2009{{2.007, -8.183, 9.965, -0.09364, -5.288}};
40 return MathUtils::polynomial(fit == Fit::MOELANS2022 ? c2022 : c2009, g2);
41}
42
43Real
44f0Interf(Real inverse_gamma, Fit fit)
45{
46 // coefficients in ascending powers of 1/gamma
47 static constexpr std::array<Real, 7> c2022{
48 {0.2907, -0.5563, 1.0686, -1.5281, 1.2244, -0.4955, 0.0788}};
49 static constexpr std::array<Real, 7> c2009{
50 {0.2792, -0.4324, 0.6107, -0.7749, 0.6367, -0.2924, 0.05676}};
51 return MathUtils::polynomial(fit == Fit::MOELANS2022 ? c2022 : c2009, inverse_gamma);
52}
53
54bool
55inRange(Real g2, Fit fit)
56{
57 // the 2022 fit covers 0.098 <= g <= 0.766, i.e. 0.53 <= gamma <= 40 (Moelans 2022, Sec. 5)
58 if (fit == Fit::MOELANS2022)
59 return g2 >= 0.098 * 0.098 && g2 <= 0.766 * 0.766;
60
61 // no range is documented for the 2009 fit; it is not checked so earlier results are reproduced
62 return true;
63}
64}
InputParameters emptyInputParameters()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
R polynomial(const C &c, const T x)
Polynomial fits for the interface relations of the multi-order-parameter model of Moelans et al....
Fit
Fits selectable through the "interface_fit" parameter.
@ MOELANS2022
N. Moelans, Mater. Des. 217, 110592 (2022), supplementary material Sec. I.
Real inverseGamma(Real g2, Fit fit)
1/gamma as a function of g^2
InputParameters validParams()
Parameters for objects using these fits.
bool inRange(Real g2, Fit fit)
Whether g^2 lies within the range the fit was made for.
Real f0Interf(Real inverse_gamma, Fit fit)
f0_interf as a function of 1/gamma