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 "NavierStokesPhysicsBase.h" 13 : #include "WCNSFVCoupledAdvectionPhysicsHelper.h" 14 : 15 : #define registerWCNSFVScalarTransportBaseTasks(app_name, derived_name) \ 16 : registerMooseAction(app_name, derived_name, "add_variables_physics"); \ 17 : registerMooseAction(app_name, derived_name, "add_ics_physics"); \ 18 : registerMooseAction(app_name, derived_name, "add_fv_kernel"); \ 19 : registerMooseAction(app_name, derived_name, "add_fv_bc"); \ 20 : registerMooseAction(app_name, derived_name, "get_turbulence_physics") 21 : 22 : /** 23 : * Creates all the objects needed to solve the Navier Stokes scalar transport equations 24 : */ 25 : class WCNSFVScalarTransportPhysicsBase : public NavierStokesPhysicsBase, 26 : public WCNSFVCoupledAdvectionPhysicsHelper 27 : { 28 : public: 29 : static InputParameters validParams(); 30 : 31 : WCNSFVScalarTransportPhysicsBase(const InputParameters & parameters); 32 : 33 : /// Get the names of the advected scalar quantity variables 34 : const std::vector<NonlinearVariableName> & getAdvectedScalarNames() const 35 : { 36 : return _passive_scalar_names; 37 : } 38 : 39 : /// Whether the physics is actually creating the scalar advection equations 40 73 : bool hasScalarEquations() const { return _has_scalar_equation; } 41 : 42 : protected: 43 : virtual void actOnAdditionalTasks() override; 44 : virtual void addFVKernels() override; 45 : virtual void addFVBCs() override; 46 189 : virtual void setSlipVelocityParams(InputParameters & /* params */) const {} 47 : 48 : /// Names of the passive scalar variables 49 : std::vector<NonlinearVariableName> _passive_scalar_names; 50 : /// A boolean to help compatibility with the old Modules/NavierStokesFV syntax 51 : /// or to deliberately skip adding the equations (for example for mixtures with a stationary phase) 52 : const bool _has_scalar_equation; 53 : 54 : /// Passive scalar inlet boundary types 55 : MultiMooseEnum _passive_scalar_inlet_types; 56 : /// Functors describing the inlet boundary values. See passive_scalar_inlet_types for what the functors actually represent 57 : std::vector<std::vector<MooseFunctorName>> _passive_scalar_inlet_functors; 58 : 59 : /// Functors for the passive scalar sources. Indexing is scalar variable index 60 : std::vector<MooseFunctorName> _passive_scalar_sources; 61 : /// Functors for the passive scalar (coupled) sources. Inner indexing is scalar variable index 62 : std::vector<std::vector<MooseFunctorName>> _passive_scalar_coupled_sources; 63 : /// Coefficients multiplying for the passive scalar sources. Inner indexing is scalar variable index 64 : std::vector<std::vector<Real>> _passive_scalar_sources_coef; 65 : 66 : private: 67 : virtual void addInitialConditions() override; 68 : 69 : /** 70 : * Functions adding kernels for the incompressible / weakly-compressible scalar transport 71 : * equation 72 : */ 73 : virtual void addScalarTimeKernels() = 0; 74 : virtual void addScalarDiffusionKernels() = 0; 75 : virtual void addScalarAdvectionKernels() = 0; 76 : /// Equivalent of NSFVAction addScalarCoupledSourceKernels 77 : virtual void addScalarSourceKernels() = 0; 78 : 79 : /// Functions adding boundary conditions for the scalar conservation equations. 80 : virtual void addScalarInletBC() = 0; 81 : virtual void addScalarWallBC() = 0; 82 : virtual void addScalarOutletBC() = 0; 83 : 84 : virtual unsigned short getNumberAlgebraicGhostingLayersNeeded() const override; 85 : };