www.mooseframework.org
TwoPhaseFluidProperties.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<FluidProperties>();
18  params.addCustomTypeParam<std::string>(
19  "fp_type", "two-phase-fp", "FPType", "Type of the fluid property object");
20  params.addParam<UserObjectName>("fp_liquid",
21  "Liquid single-phase fluid properties user object name");
22  params.addParam<UserObjectName>("fp_vapor",
23  "Vapor single-phase fluid properties user object name");
24 
25  return params;
26 }
27 
28 TwoPhaseFluidProperties::TwoPhaseFluidProperties(const InputParameters & parameters)
29  : FluidProperties(parameters),
30 
31  _liquid_name(isParamValid("fp_liquid") ? getParam<UserObjectName>("fp_liquid")
32  : UserObjectName(name() + ":liquid")),
33  _vapor_name(isParamValid("fp_vapor") ? getParam<UserObjectName>("fp_vapor")
34  : UserObjectName(name() + ":vapor"))
35 {
36  // If the single-phase fluid properties user object names are not provided, it
37  // is implied that these objects will be created by a derived class. In this
38  // case, we need to check that these user objects do not already exist.
39  if (!isParamValid("fp_liquid"))
40  if (_tid == 0 && _fe_problem.hasUserObject(_liquid_name))
41  paramError("fp_liquid",
42  "The two-phase fluid properties object '" + name() + "' is ",
43  "trying to create a single-phase fluid properties object with ",
44  "name '",
46  "', but a single-phase fluid properties ",
47  "object with this name already exists.");
48  if (!isParamValid("fp_vapor"))
49  if (_tid == 0 && _fe_problem.hasUserObject(_vapor_name))
50  paramError("fp_vapor",
51  "The two-phase fluid properties object '" + name() + "' is ",
52  "trying to create a single-phase fluid properties object with ",
53  "name '",
55  "', but a single-phase fluid properties ",
56  "object with this name already exists.");
57 }
58 
59 Real
60 TwoPhaseFluidProperties::h_lat(Real p, Real T) const
61 {
62  return _fp_vapor->h_from_p_T(p, T) - _fp_liquid->h_from_p_T(p, T);
63 }
64 
66 {
67  mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
68 }
69 
71 {
72  mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
73 }
TwoPhaseFluidProperties::_liquid_name
const UserObjectName _liquid_name
The name of the user object that provides liquid phase fluid properties.
Definition: TwoPhaseFluidProperties.h:94
TwoPhaseFluidProperties::sigma_from_T
virtual Real sigma_from_T(Real T) const
Computes surface tension sigma of saturated liquid in contact with saturated vapor.
Definition: TwoPhaseFluidProperties.C:65
TwoPhaseFluidProperties::_fp_liquid
const SinglePhaseFluidProperties * _fp_liquid
The user object that provides liquid phase fluid properties.
Definition: TwoPhaseFluidProperties.h:99
TwoPhaseFluidProperties::_fp_vapor
const SinglePhaseFluidProperties * _fp_vapor
The user object that provides vapor phase fluid properties.
Definition: TwoPhaseFluidProperties.h:101
SinglePhaseFluidProperties.h
TwoPhaseFluidProperties::_vapor_name
const UserObjectName _vapor_name
The name of the user object that provides vapor phase fluid properties.
Definition: TwoPhaseFluidProperties.h:96
validParams< TwoPhaseFluidProperties >
InputParameters validParams< TwoPhaseFluidProperties >()
Definition: TwoPhaseFluidProperties.C:15
TwoPhaseFluidProperties::TwoPhaseFluidProperties
TwoPhaseFluidProperties(const InputParameters &parameters)
Definition: TwoPhaseFluidProperties.C:28
TwoPhaseFluidProperties::h_lat
virtual Real h_lat(Real p, Real T) const
Computes latent heat of vaporization.
Definition: TwoPhaseFluidProperties.C:60
TwoPhaseFluidProperties.h
validParams< FluidProperties >
InputParameters validParams< FluidProperties >()
Definition: FluidProperties.C:16
name
const std::string name
Definition: Setup.h:21
FluidProperties
Definition: FluidProperties.h:28
TwoPhaseFluidProperties::dsigma_dT_from_T
virtual Real dsigma_dT_from_T(Real T) const
Computes dsigma/dT along the saturation line.
Definition: TwoPhaseFluidProperties.C:70