https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
18public:
20 {
22 }
23
24protected:
26 {
27 InputParameters rho_pars = _factory.getValidParams("ParsedFunction");
28 rho_pars.set<std::string>("expression") = "100.0+t";
29 _fe_problem->addFunction("ParsedFunction", "rho", rho_pars);
30 Function & rho = _fe_problem->getFunction("rho");
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>("expression") = "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);
52 }
53
55};
const double rho
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< FEProblem > _fe_problem
virtual void initialSetup()
const ThermalFunctionSolidProperties * _sp
Thermal material properties as a function of temperature from function inputs.
const T & getUserObject(const std::string &param_name, bool is_dependency=true) const