Line data Source code
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 : 12 : #include "FlowJunction1Phase.h" 13 : 14 : /** 15 : * Junction between 1-phase flow channels that has a non-zero volume 16 : */ 17 : class VolumeJunction1Phase : public FlowJunction1Phase 18 : { 19 : public: 20 : VolumeJunction1Phase(const InputParameters & params); 21 : 22 : virtual void addVariables() override; 23 : virtual void addMooseObjects() override; 24 : 25 : /// Enumeration for junction variable/equation indices 26 : enum VolumeJunction1PhaseIndices 27 : { 28 : RHOV_INDEX = 0, 29 : RHOUV_INDEX = 1, 30 : RHOVV_INDEX = 2, 31 : RHOWV_INDEX = 3, 32 : RHOEV_INDEX = 4 33 : }; 34 : /// Number of equations for the junction 35 : static const unsigned int N_EQ; 36 : 37 315 : UserObjectName getVolumeJunctionUserObjectName() const { return _junction_uo_name; } 38 315 : UserObjectName getNumericalFluxName(unsigned int i) const { return _numerical_flux_names[i]; } 39 : 40 : protected: 41 : virtual void setupMesh() override; 42 : virtual void check() const override; 43 : 44 : /** 45 : * Builds user object for computing and storing the fluxes 46 : */ 47 : virtual void buildVolumeJunctionUserObject(); 48 : 49 : /** 50 : * Returns the name of junction variable, depending on whether scalar 51 : * 52 : * @param[in] var_base Base variable name 53 : */ 54 : std::string junctionVariableName(const std::string & var_base) const; 55 : 56 : /** 57 : * Adds a junction variable to the problem, as a scalar or field variable 58 : * 59 : * @param[in] is_nonlinear Is the variable nonlinear? 60 : * @param[in] var Variable name 61 : * @param[in] scaling_factor Scaling factor for variable if nonlinear 62 : */ 63 : void addJunctionVariable(bool is_nonlinear, const VariableName & var, Real scaling_factor = 1.0); 64 : 65 : /** 66 : * Adds a junction IC to the problem, as a scalar or field variable 67 : * 68 : * @param[in] var Variable name 69 : * @param[in] value IC value 70 : */ 71 : void addJunctionIC(const VariableName & var, Real value); 72 : 73 : /** 74 : * Adds a VolumeJunctionIC to the problem 75 : * 76 : * @param[in] var Variable name 77 : * @param[in] quantity Quantity to compute 78 : */ 79 : void addVolumeJunctionIC(const VariableName & var, const std::string & quantity); 80 : 81 : /// Volume of the junction 82 : const Real _volume; 83 : 84 : /// Spatial position of center of the junction 85 : const Point & _position; 86 : 87 : /// Scaling factor for rho*V 88 : const Real & _scaling_factor_rhoV; 89 : /// Scaling factor for rho*u*V 90 : const Real & _scaling_factor_rhouV; 91 : /// Scaling factor for rho*v*V 92 : const Real & _scaling_factor_rhovV; 93 : /// Scaling factor for rho*w*V 94 : const Real & _scaling_factor_rhowV; 95 : /// Scaling factor for rho*E*V 96 : const Real & _scaling_factor_rhoEV; 97 : 98 : /// rho*V variable name for junction 99 : const VariableName _rhoV_var_name; 100 : /// rho*u*V variable name for junction 101 : const VariableName _rhouV_var_name; 102 : /// rho*v*V variable name for junction 103 : const VariableName _rhovV_var_name; 104 : /// rho*w*V variable name for junction 105 : const VariableName _rhowV_var_name; 106 : /// rho*E*V variable name for junction 107 : const VariableName _rhoEV_var_name; 108 : /// pressure variable name for junction 109 : const VariableName _pressure_var_name; 110 : /// temperature variable name for junction 111 : const VariableName _temperature_var_name; 112 : /// velocity variable name for junction 113 : const VariableName _velocity_var_name; 114 : 115 : /// Form loss coefficient 116 : const Real & _K; 117 : /// Reference area 118 : const Real & _A_ref; 119 : 120 : public: 121 : static InputParameters validParams(); 122 : };