https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADPump1PhaseUserObject.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#include "THMIndicesVACE.h"
15#include "Numerics.h"
16
18
21{
23
24 params.addRequiredParam<Real>("head", "Pump head, [m]");
25 params.addRequiredParam<Real>("gravity_magnitude", "Gravity constant, [m/s^2]");
26
27 params.addClassDescription("Computes and caches flux and residual vectors for a 1-phase pump");
28
29 params.declareControllable("head");
30
31 return params;
32}
33
36 _head(getParam<Real>("head")),
37 _g(getParam<Real>("gravity_magnitude"))
38{
39}
40
41void
43{
45
50
51 const ADRealVectorValue di = _dir[0];
52 const ADReal rho = rhoV / _volume;
53 const ADRealVectorValue uvec(rhouV / rhoV, rhovV / rhoV, rhowV / rhoV);
54
55 // compute momentum and energy source terms
56 const ADRealVectorValue S_momentum = 0.5 * rho * _g * _head * _A_ref * di;
57 const ADReal S_energy = S_momentum * uvec;
58
63}
registerMooseObject("ThermalHydraulicsApp", ADPump1PhaseUserObject)
DualNumber< Real, DNDerivativeType, true > ADReal
const double rho
const MaterialProperty< RealVectorValue > & _dir
Direction of the element connected to the junction.
Computes and caches flux and residual vectors for a 1-phase pump.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
const Real & _head
Pump head, [m].
static InputParameters validParams()
const Real & _g
Gravity constant, i.e., 9.8 [m/s^2].
ADPump1PhaseUserObject(const InputParameters &params)
Computes and caches flux and residual vectors for a 1-phase volume junction.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
std::vector< ADReal > _residual
Cached scalar residual vector.
const Real & _volume
Volume of the junction.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)