https://mooseframework.inl.gov
ThermalFunctionSolidPropertiesTest.h
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 #pragma once
11 
12 #include "MooseObjectUnitTest.h"
14 #include "Function.h"
15 
17 {
18 public:
20  {
21  buildObjects();
22  }
23 
24 protected:
25  void buildObjects()
26  {
27  InputParameters rho_pars = _factory.getValidParams("ParsedFunction");
28  rho_pars.set<std::string>("value") = "100.0+t";
29  _fe_problem->addFunction("ParsedFunction", "rho", rho_pars);
30  Function & rho = _fe_problem->getFunction("rho");
31  rho.initialSetup();
32 
33  InputParameters cp_pars = _factory.getValidParams("PiecewiseLinear");
34  cp_pars.set<std::vector<Real>>("x") = {700.0, 900.0};
35  cp_pars.set<std::vector<Real>>("y") = {1000.0, 1400.0};
36  _fe_problem->addFunction("PiecewiseLinear", "cp", cp_pars);
37  Function & cp = _fe_problem->getFunction("cp");
38  cp.initialSetup();
39 
40  InputParameters k_pars = _factory.getValidParams("ParsedFunction");
41  k_pars.set<std::string>("value") = "12.1+1.e-6*t*t*t+2.0e-4*t*t-0.5*t";
42  _fe_problem->addFunction("ParsedFunction", "k", k_pars);
43  Function & k = _fe_problem->getFunction("k");
44  k.initialSetup();
45 
46  InputParameters uo_pars = _factory.getValidParams("ThermalFunctionSolidProperties");
47  uo_pars.set<FunctionName>("rho") = "rho";
48  uo_pars.set<FunctionName>("cp") = "cp";
49  uo_pars.set<FunctionName>("k") = "k";
50  _fe_problem->addUserObject("ThermalFunctionSolidProperties", "sp", uo_pars);
51  _sp = &_fe_problem->getUserObject<ThermalFunctionSolidProperties>("sp");
52  }
53 
55 };
std::shared_ptr< FEProblem > _fe_problem
Thermal material properties as a function of temperature from function inputs.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
static const std::string cp
Definition: NS.h:121
const ThermalFunctionSolidProperties * _sp
virtual void initialSetup()
static const std::string k
Definition: NS.h:130