https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
44void
46{
48
49 const auto & fp = getUserObject<SinglePhaseFluidProperties>("fluid_properties");
50 _rho = fp.rho_from_p_T(_p_ref, _T_ref);
51}
52
53Real
54HydrostaticPressureFunction::value(Real /*t*/, const Point & r) const
55{
56 return _p_ref - _rho * gravityVector() * (_r_ref - r);
57}
registerMooseObject("FluidPropertiesApp", HydrostaticPressureFunction)
static InputParameters validParams()
Interface for specifying gravity vector.
static InputParameters validParams()
const RealVectorValue & gravityVector() const
Gets gravity magnitude.
Computes hydrostatic pressure from a reference point.
const Real _T_ref
Reference temperature.
const Real _p_ref
Reference pressure.
Real _rho
Density at reference pressure and temperature.
HydrostaticPressureFunction(const InputParameters &parameters)
const Point & _r_ref
Reference point.
virtual Real value(Real t, const Point &p) const override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual void initialSetup()