https://mooseframework.inl.gov
HydrostaticPressureFunction.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 
12 
14 
17 {
20 
21  params.addClassDescription("Computes hydrostatic pressure from a reference point.");
22 
23  params.addRequiredParam<Real>("reference_pressure", "Pressure at the reference point [Pa]");
24  params.addRequiredParam<Real>("reference_temperature",
25  "Reference temperature for density evaluation [K]");
26  params.addRequiredParam<Point>("reference_point",
27  "Reference point where pressure is specified [m]");
28 
29  params.addRequiredParam<UserObjectName>("fluid_properties",
30  "Name of the SinglePhaseFluidProperties user object");
31 
32  return params;
33 }
34 
36  : Function(parameters),
38  _p_ref(getParam<Real>("reference_pressure")),
39  _T_ref(getParam<Real>("reference_temperature")),
40  _r_ref(getParam<Point>("reference_point"))
41 {
42 }
43 
44 void
46 {
48 
49  const auto & fp = getUserObject<SinglePhaseFluidProperties>("fluid_properties");
50  _rho = fp.rho_from_p_T(_p_ref, _T_ref);
51 }
52 
53 Real
54 HydrostaticPressureFunction::value(Real /*t*/, const Point & r) const
55 {
56  return _p_ref - _rho * gravityVector() * (_r_ref - r);
57 }
const Real _p_ref
Reference pressure.
Real _rho
Density at reference pressure and temperature.
const Real _T_ref
Reference temperature.
virtual Real value(Real t, const Point &p) const override
const RealVectorValue & gravityVector() const
Gets gravity magnitude.
void addRequiredParam(const std::string &name, const std::string &doc_string)
HydrostaticPressureFunction(const InputParameters &parameters)
Computes hydrostatic pressure from a reference point.
Interface for specifying gravity vector.
registerMooseObject("FluidPropertiesApp", HydrostaticPressureFunction)
static InputParameters validParams()
const Point & _r_ref
Reference point.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual void initialSetup()
static InputParameters validParams()
static InputParameters validParams()