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 "MooseObject.h" 13 : #include "InputParameters.h" 14 : #include "NamingInterface.h" 15 : #include "THMEnums.h" 16 : #include "libmesh/fe_type.h" 17 : 18 : class THMProblem; 19 : class Factory; 20 : class ThermalHydraulicsApp; 21 : class FluidProperties; 22 : class FlowChannelBase; 23 : 24 : /** 25 : * Provides functions to setup the flow model. Should be used by components that has flow in them 26 : */ 27 : class FlowModel : public MooseObject, public NamingInterface 28 : { 29 : public: 30 : FlowModel(const InputParameters & params); 31 : 32 : /** 33 : * Initialize the model 34 : */ 35 4160 : virtual void init() {} 36 : 37 : /** 38 : * Add variables the model uses 39 : */ 40 : virtual void addVariables() = 0; 41 : 42 : /** 43 : * Add initial conditions 44 : */ 45 : virtual void addInitialConditions() = 0; 46 : 47 : /** 48 : * Add MOOSE objects this model uses 49 : */ 50 : virtual void addMooseObjects() = 0; 51 : 52 : protected: 53 : THMProblem & _sim; 54 : 55 : /// The Factory associated with the MooseApp 56 : Factory & _factory; 57 : 58 : /// The flow channel component that built this class 59 : FlowChannelBase & _flow_channel; 60 : 61 : /// The type of FE used for flow 62 : const libMesh::FEType & _fe_type; 63 : 64 : /// The name of the user object that defines fluid properties 65 : const UserObjectName _fp_name; 66 : 67 : /// The component name 68 : const std::string _comp_name; 69 : 70 : /// Gravitational acceleration vector 71 : const RealVectorValue & _gravity_vector; 72 : /// Gravitational acceleration magnitude 73 : const Real _gravity_magnitude; 74 : 75 : // Solution variable names 76 : std::vector<VariableName> _solution_vars; 77 : 78 : // Names of variables for which derivative material properties need to be created 79 : std::vector<VariableName> _derivative_vars; 80 : 81 : /// True if we output velocity as a vector-value field, false for outputting velocity as a scalar 82 : const bool & _output_vector_velocity; 83 : 84 : const FunctionName & getVariableFn(const FunctionName & fn_param_name); 85 : 86 : /** 87 : * Adds variables common to any flow model (A, P_hf, ...) 88 : */ 89 : virtual void addCommonVariables(); 90 : 91 : /** 92 : * Adds initial conditions common to any flow model 93 : */ 94 : virtual void addCommonInitialConditions(); 95 : 96 : /** 97 : * Adds common MOOSE objects 98 : */ 99 : virtual void addCommonMooseObjects(); 100 : 101 : public: 102 : static const std::string AREA; 103 : static const std::string AREA_LINEAR; 104 : static const std::string HEAT_FLUX_WALL; 105 : static const std::string HEAT_FLUX_PERIMETER; 106 : static const std::string NUSSELT_NUMBER; 107 : static const std::string SURFACE_TENSION; 108 : static const std::string TEMPERATURE_WALL; 109 : static const std::string UNITY; 110 : static const std::string DIRECTION; 111 : 112 : static InputParameters validParams(); 113 : };