https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TwoPhaseAverageDensityAux.C
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
13
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
42Real
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}
registerMooseObject("FluidPropertiesTestApp", TwoPhaseAverageDensityAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Common class for single phase fluid properties.
Computes the average of the densities of the phases corresponding to a 2-phase fluid properties objec...
const VariableValue & _p
Pressure.
const SinglePhaseFluidProperties & _fp_liquid
Liquid 1-phase fluid properties object.
virtual Real computeValue() override
const SinglePhaseFluidProperties & _fp_vapor
Vapor 1-phase fluid properties object.
static InputParameters validParams()
TwoPhaseAverageDensityAux(const InputParameters &parameters)
const VariableValue & _T
Temperature.
Base class for fluid properties used with two-phase flow.