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