https://mooseframework.inl.gov
Loading...
Searching...
No Matches
EquilibriumConstantFitTest.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
10#include "gtest/gtest.h"
11
13
14#include <cmath>
15
16const double tol = 1.0e-6;
17const std::vector<double> x = {273.15, 298.15, 333.15, 373.15, 423.15, 473.15, 523.15, 573.15};
18const std::vector<double> y = {
19 14.9398, 13.9951, 13.0272, 12.2551, 11.6308, 11.2836, 11.1675, 11.3002};
20
21TEST(EquilibriumConstantFitTest, constructor)
22{
24 EXPECT_EQ(logk.getSampleSize(), x.size());
25}
26
27TEST(EquilibriumConstantFitTest, sample)
28{
30 logk.generate();
31
32 // Compare with values calculated using scipy.optimize.curve_fit
33 EXPECT_NEAR(logk.sample(x[1]), 13.991103115875013, tol);
34 EXPECT_NEAR(logk.sample(x[2]), 13.028890219017683, tol);
35 EXPECT_NEAR(logk.sample(x[3]), 12.259284844918287, tol);
36 EXPECT_NEAR(logk.sample(x[4]), 11.627599702911748, tol);
37 EXPECT_NEAR(logk.sample(x[5]), 11.278660590504469, tol);
38}
const std::vector< double > y
TEST(EquilibriumConstantFitTest, constructor)
const double tol
const std::vector< double > x
Fit the equilibrium constant values read from a databse at specified temperature values with a Maier-...
virtual Real sample(Real T) override
virtual void generate()
unsigned int getSampleSize()