https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TabulatedPVTFluidPropertiesTest.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
16{
17public:
19 {
20 _fp = &buildFP("fp", "ignore");
21 _fp_bounds = &buildFP("fp_bounds", "set_to_closest_bound");
22 _fp_throw = &buildFP("fp_throw", "throw");
23 _fp_declare_invalid = &buildFP("fp_declare_invalid", "declare_invalid");
24 _fp_warn_invalid = &buildFP("fp_warn_invalid", "warn_invalid");
25 }
26
27protected:
30 {
31 InputParameters params = _factory.getValidParams("TabulatedPVTFluidProperties");
32 params.set<Real>("density_sc") = _rho_sc;
33 params.set<std::vector<Real>>("pressure") = _p;
34 params.set<std::vector<Real>>("formation_volume_factor") = _B;
35 params.set<std::vector<Real>>("viscosity") = _mu;
36 params.set<Real>("cv") = _cv;
37 params.set<Real>("molar_mass") = _molar_mass;
38 return params;
39 }
40
41 const TabulatedPVTFluidProperties & buildFP(const std::string & name,
42 const std::string & out_of_bounds_behavior)
43 {
45 params.set<MooseEnum>("out_of_bounds_behavior") = out_of_bounds_behavior;
46 _fe_problem->addUserObject("TabulatedPVTFluidProperties", name, params);
47 return _fe_problem->getUserObject<TabulatedPVTFluidProperties>(name);
48 }
49
50 const Real _rho_sc = 850.0;
51 const std::vector<Real> _p = {2.0e6, 1.0e7, 2.0e7, 3.0e7};
52 const std::vector<Real> _B = {1.062, 1.050, 1.038, 1.028};
53 const std::vector<Real> _mu = {1.04e-3, 1.10e-3, 1.17e-3, 1.24e-3};
54 const Real _cv = 2000.0;
55 const Real _molar_mass = 0.2;
56
67};
const std::string name
Definition Setup.h:21
InputParameters getValidParams(const std::string &name) const
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< FEProblem > _fe_problem
const TabulatedPVTFluidProperties * _fp_bounds
out_of_bounds_behavior = set_to_closest_bound
const TabulatedPVTFluidProperties & buildFP(const std::string &name, const std::string &out_of_bounds_behavior)
InputParameters validFPParams()
Valid parameters for a PVDO-style dead-oil table.
const TabulatedPVTFluidProperties * _fp_warn_invalid
out_of_bounds_behavior = warn_invalid
const TabulatedPVTFluidProperties * _fp_throw
out_of_bounds_behavior = throw (the default)
const TabulatedPVTFluidProperties * _fp
out_of_bounds_behavior = ignore (linear extrapolation)
const TabulatedPVTFluidProperties * _fp_declare_invalid
out_of_bounds_behavior = declare_invalid
Fluid properties from a table of pressure, formation volume factor and viscosity (PVDO/PVDG style)