https://mooseframework.inl.gov
ADFluidPropsTest.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"
15 
17 {
18 public:
19  ADFluidPropsTest() : MooseObjectUnitTest("FluidPropertiesApp") { buildObj(); }
20 
21 protected:
22  const SinglePhaseFluidProperties & buildObj(const std::string name = "fp",
23  bool allow_imperfect_jac = false)
24  {
25  InputParameters uo_pars = _factory.getValidParams("IdealGasFluidProperties");
26  uo_pars.set<Real>("molar_mass") = 0.028966206103678928;
27  uo_pars.set<Real>("gamma") = 1.41;
28  uo_pars.set<bool>("allow_imperfect_jacobians") = allow_imperfect_jac;
29  _fe_problem->addUserObject("IdealGasFluidProperties", name, uo_pars);
30  _fp = &_fe_problem->getUserObject<IdealGasFluidProperties>(name);
31  return *_fp;
32  }
33 
35  {
36  {
37  const std::string class_name = "StiffenedGasTwoPhaseFluidProperties";
38  const UserObjectName fp_2phase_name = "fp_2phase";
39  InputParameters params = _factory.getValidParams(class_name);
40  _fe_problem->addUserObject(class_name, fp_2phase_name, params);
41  return _fe_problem->getUserObject<TwoPhaseFluidProperties>(fp_2phase_name);
42  }
43  }
44 
46 };
std::shared_ptr< FEProblem > _fe_problem
const SinglePhaseFluidProperties * _fp
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Base class for fluid properties used with two-phase flow.
const std::string name
Definition: Setup.h:20
Common class for single phase fluid properties.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const TwoPhaseFluidProperties & buildTwoPhaseFluidProperties()
Ideal gas fluid properties Default parameters are for air at atmospheric pressure and temperature...
const SinglePhaseFluidProperties & buildObj(const std::string name="fp", bool allow_imperfect_jac=false)