https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
29public:
31
32 virtual void initialSetup() override;
33 virtual void initialize() override;
34 virtual void execute() override;
35
47 ADReal getEfficiency() const;
52
53 virtual void finalize() override;
54 virtual void threadJoin(const UserObject & uo) override;
55
56protected:
57 virtual void computeFluxesAndResiduals(const unsigned int & c) override;
58
60 Point _di_out;
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;
74 const Real & _tau_fr_const;
76 const std::vector<Real> & _tau_fr_coeff;
78 const Real & _speed_cr_I;
80 const Real & _inertia_const;
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
125public:
127};
DualNumber< Real, DNDerivativeType, true > ADReal
Base class for computing numerical fluxes for FlowModelSinglePhase.
Interface class for user objects that are connected to a shaft.
Computes and caches flux and residual vectors for a 1-phase compressor.
const std::vector< Real > & _tau_fr_coeff
Compressor friction coefficients.
ADReal getCompressorDeltaP() const
Compressor head computed in the 1-phase shaft-connected compressor.
std::vector< DenseMatrix< Real > > _residual_jacobian_omega_var
Jacobian entries of junction variables wrt shaft variables.
const bool _treat_as_turbine
Treat the compressor as a turbine?
const Real & _speed_cr_I
Compressor speed threshold for inertia.
ADReal getFrictionTorque() const
Friction torque computed in the 1-phase shaft-connected compressor.
ADReal getDissipationTorque() const
Dissipation torque computed in the 1-phase shaft-connected compressor.
const Real & _speed_cr_fr
Compressor speed threshold for friction.
const Real & _rho0_rated
Rated compressor inlet stagnation fluid density.
ADReal getRelativeCorrectedSpeed() const
Gets the elative corrected shaft speed.
std::vector< const Function * > _Rp_functions
Pressure ratio functions.
const std::vector< Real > & _speeds
Compressor speeds which correspond to Rp and eff function order.
virtual void computeFluxesAndResiduals(const unsigned int &c) override
Computes and stores the fluxes, the scalar residuals, and their Jacobians.
std::vector< const Function * > _eff_functions
Adiabatic efficiency functions.
const Real & _c0_rated
Rated compressor inlet stagnation sound speed.
const std::vector< Real > & _inertia_coeff
Compressor inertia coefficients.
ADReal getRelativeCorrectedMassFlowRate() const
Gets the relative corrected mass flow rate.
const std::vector< FunctionName > & _Rp_function_names
Names of the pressure ratio functions.
ADReal getIsentropicTorque() const
Isentropic torque computed in the 1-phase shaft-connected compressor.
const std::vector< FunctionName > & _eff_function_names
Names of the adiabatic efficiency functions.
Computes and caches flux and residual vectors for a 1-phase volume junction.
Common class for single phase fluid properties.
VariableValueTempl< true > ADVariableValue