https://mooseframework.inl.gov
ADShaftConnectedCompressor1PhaseUserObject.h
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 #pragma once
11 
14 
17 
28 {
29 public:
31 
32  virtual void initialSetup() override;
33  virtual void initialize() override;
34  virtual void execute() override;
35 
41  ADReal getFrictionTorque() const;
45  ADReal getPressureRatio() const;
47  ADReal getEfficiency() const;
52 
53  virtual void finalize() override;
54  virtual void threadJoin(const UserObject & uo) override;
55 
56 protected:
57  virtual void computeFluxesAndResiduals(const unsigned int & c) override;
58 
60  Point _di_out;
62  const bool _treat_as_turbine;
64  const Real & _omega_rated;
66  const Real & _mdot_rated;
68  const Real & _rho0_rated;
70  const Real & _c0_rated;
72  const Real & _speed_cr_fr;
76  const std::vector<Real> & _tau_fr_coeff;
78  const Real & _speed_cr_I;
82  const std::vector<Real> & _inertia_coeff;
84  const std::vector<Real> & _speeds;
86  const std::vector<FunctionName> & _Rp_function_names;
88  const std::vector<FunctionName> & _eff_function_names;
90  const unsigned int _n_speeds;
92  std::vector<const Function *> _Rp_functions;
94  std::vector<const Function *> _eff_functions;
96  const Real & _Rp_min;
98  const Real & _Rp_max;
99 
101  const std::string & _compressor_name;
102 
104 
121 
123  std::vector<DenseMatrix<Real>> _residual_jacobian_omega_var;
124 
125 public:
126  static InputParameters validParams();
127 };
const std::vector< Real > & _speeds
Compressor speeds which correspond to Rp and eff function order.
const bool _treat_as_turbine
Treat the compressor as a turbine?
std::vector< const Function * > _Rp_functions
Pressure ratio functions.
ADReal getDissipationTorque() const
Dissipation torque computed in the 1-phase shaft-connected compressor.
const Real & _c0_rated
Rated compressor inlet stagnation sound speed.
const std::vector< FunctionName > & _eff_function_names
Names of the adiabatic efficiency functions.
const std::vector< FunctionName > & _Rp_function_names
Names of the pressure ratio functions.
std::vector< const Function * > _eff_functions
Adiabatic efficiency functions.
ADReal getFrictionTorque() const
Friction torque computed in the 1-phase shaft-connected compressor.
const std::vector< Real > & _inertia_coeff
Compressor inertia coefficients.
ADReal getIsentropicTorque() const
Isentropic torque computed in the 1-phase shaft-connected compressor.
const std::vector< Real > & _tau_fr_coeff
Compressor friction coefficients.
Common class for single phase fluid properties.
Base class for computing numerical fluxes for FlowModelSinglePhase.
VariableValueTempl< true > ADVariableValue
ADReal getRelativeCorrectedSpeed() const
Gets the elative corrected shaft speed.
Computes and caches flux and residual vectors for a 1-phase volume junction.
const Real & _speed_cr_I
Compressor speed threshold for inertia.
std::vector< DenseMatrix< Real > > _residual_jacobian_omega_var
Jacobian entries of junction variables wrt shaft variables.
ADReal getRelativeCorrectedMassFlowRate() const
Gets the relative corrected mass flow rate.
const Real & _rho0_rated
Rated compressor inlet stagnation fluid density.
Interface class for user objects that are connected to a shaft.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real & _mdot_rated
Rated compressor mass flow rate.
Computes and caches flux and residual vectors for a 1-phase compressor.
ADReal getCompressorDeltaP() const
Compressor head computed in the 1-phase shaft-connected compressor.
const Real & _speed_cr_fr
Compressor speed threshold for friction.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.