https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions
MoelansInterfaceFitsTest.C File Reference

Go to the source code of this file.

Functions

 TEST (MoelansInterfaceFitsTest, moelans2022Table1)
 
 TEST (MoelansInterfaceFitsTest, gamma1p5)
 
 TEST (MoelansInterfaceFitsTest, inRange)
 

Function Documentation

◆ TEST() [1/3]

TEST ( MoelansInterfaceFitsTest  ,
gamma1p5   
)

Definition at line 35 of file MoelansInterfaceFitsTest.C.

36{
37 // gamma = 1.5 is the one case with analytical values, g^2 = 2/9 and f0_interf = 1/8; the
38 // tolerances reflect the accuracy of each fit there
39 EXPECT_NEAR(inverseGamma(2.0 / 9.0, Fit::MOELANS2022), 1.0 / 1.5, 1e-3);
40 EXPECT_NEAR(inverseGamma(2.0 / 9.0, Fit::MOELANS2009), 1.0 / 1.5, 1e-4);
41 EXPECT_NEAR(f0Interf(1.0 / 1.5, Fit::MOELANS2022), 0.125, 1e-3);
42 EXPECT_NEAR(f0Interf(1.0 / 1.5, Fit::MOELANS2009), 0.125, 1e-5);
43}
Real inverseGamma(Real g2, Fit fit)
1/gamma as a function of g^2
Real f0Interf(Real inverse_gamma, Fit fit)
f0_interf as a function of 1/gamma

◆ TEST() [2/3]

TEST ( MoelansInterfaceFitsTest  ,
inRange   
)

Definition at line 45 of file MoelansInterfaceFitsTest.C.

46{
47 // the 2022 fit covers 0.098 <= g <= 0.766
48 EXPECT_FALSE(inRange(0.097 * 0.097, Fit::MOELANS2022));
49 EXPECT_TRUE(inRange(0.099 * 0.099, Fit::MOELANS2022));
50 EXPECT_TRUE(inRange(0.765 * 0.765, Fit::MOELANS2022));
51 EXPECT_FALSE(inRange(0.767 * 0.767, Fit::MOELANS2022));
52
53 // the 2009 fit is not range checked
54 EXPECT_TRUE(inRange(0.9, Fit::MOELANS2009));
55}
bool inRange(Real g2, Fit fit)
Whether g^2 lies within the range the fit was made for.

◆ TEST() [3/3]

TEST ( MoelansInterfaceFitsTest  ,
moelans2022Table1   
)

Definition at line 16 of file MoelansInterfaceFitsTest.C.

17{
18 // gamma values from Table 1 of N. Moelans, Mater. Des. 217, 110592 (2022), which are given to
19 // four decimals, with g^2 = sigma^2 / (kappa m)
20 struct Sample
21 {
22 Real sigma, kappa, m, gamma;
23 } samples[] = {{0.4, 0.36, 1.125, 5.1364},
24 {0.15, 0.36, 1.125, 0.6328},
25 {0.75, 0.6, 1.875, 13.7765},
26 {0.15, 0.6, 1.875, 0.5424}};
27
28 for (const auto & s : samples)
29 {
30 const Real g2 = s.sigma * s.sigma / (s.kappa * s.m);
31 EXPECT_NEAR(1.0 / inverseGamma(g2, Fit::MOELANS2022), s.gamma, 5e-5);
32 }
33}
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real