https://mooseframework.inl.gov
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 
10 #include "ADPump1PhaseUserObject.h"
12 #include "THMIndicesVACE.h"
13 #include "VolumeJunction1Phase.h"
14 #include "NumericalFlux3EqnBase.h"
15 #include "Numerics.h"
16 
17 registerMooseObject("ThermalHydraulicsApp", ADPump1PhaseUserObject);
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 
41 void
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 }
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
void addRequiredParam(const std::string &name, const std::string &doc_string)
std::vector< ADReal > _residual
Cached scalar residual vector.
const Real & _volume
Volume of the junction.
const MaterialProperty< RealVectorValue > & _dir
Direction of the element connected to the junction.
const Real & _head
Pump head, [m].
Computes and caches flux and residual vectors for a 1-phase volume junction.
Computes and caches flux and residual vectors for a 1-phase pump.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
ADPump1PhaseUserObject(const InputParameters &params)
const Real & _g
Gravity constant, i.e., 9.8 [m/s^2].
void addClassDescription(const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", ADPump1PhaseUserObject)
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
static InputParameters validParams()
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})