www.mooseframework.org
TwoPhaseAverageDensityAux.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 
13 
14 registerMooseObject("FluidPropertiesTestApp", TwoPhaseAverageDensityAux);
15 
18 {
20 
21  params.addClassDescription("Computes the average of the densities of the phases corresponding to "
22  "a 2-phase fluid properties object.");
23 
24  params.addRequiredCoupledVar("p", "Pressure");
25  params.addRequiredCoupledVar("T", "Temperature");
26  params.addRequiredParam<UserObjectName>("fp_2phase", "2-phase fluid properties user object name");
27 
28  return params;
29 }
30 
32  : AuxKernel(parameters),
33 
34  _p(coupledValue("p")),
35  _T(coupledValue("T")),
36  _fp_2phase(getUserObject<TwoPhaseFluidProperties>("fp_2phase")),
37  _fp_liquid(getUserObjectByName<SinglePhaseFluidProperties>(_fp_2phase.getLiquidName())),
38  _fp_vapor(getUserObjectByName<SinglePhaseFluidProperties>(_fp_2phase.getVaporName()))
39 {
40 }
41 
42 Real
44 {
45  return 0.5 *
46  (_fp_liquid.rho_from_p_T(_p[_qp], _T[_qp]) + _fp_vapor.rho_from_p_T(_p[_qp], _T[_qp]));
47 }
virtual Real computeValue() override
TwoPhaseAverageDensityAux(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
Base class for fluid properties used with two-phase flow.
const VariableValue & _T
Temperature.
const SinglePhaseFluidProperties & _fp_vapor
Vapor 1-phase fluid properties object.
Common class for single phase fluid properties.
static InputParameters validParams()
registerMooseObject("FluidPropertiesTestApp", TwoPhaseAverageDensityAux)
Computes the average of the densities of the phases corresponding to a 2-phase fluid properties objec...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _p
Pressure.
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const SinglePhaseFluidProperties & _fp_liquid
Liquid 1-phase fluid properties object.