LCOV - code coverage report
Current view: top level - src/physics - WCNSFVFlowPhysicsBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: 2bd28b Lines: 212 227 93.4 %
Date: 2025-10-23 22:11:45 Functions: 13 14 92.9 %
Legend: Lines: hit not hit

          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             : #include "WCNSFVFlowPhysicsBase.h"
      11             : #include "WCNSFVTurbulencePhysics.h"
      12             : #include "NSFVBase.h"
      13             : #include "MapConversionUtils.h"
      14             : #include "NS.h"
      15             : 
      16             : InputParameters
      17        1962 : WCNSFVFlowPhysicsBase::validParams()
      18             : {
      19        1962 :   InputParameters params = NavierStokesPhysicsBase::validParams();
      20        1962 :   params.addClassDescription("Base class for Physics defining the Navier Stokes flow equations");
      21             : 
      22        1962 :   params += NSFVBase::commonMomentumEquationParams();
      23        3924 :   params.addParam<bool>("add_flow_equations",
      24        3924 :                         true,
      25             :                         "Whether to add the flow equations. This parameter is not necessary when "
      26             :                         "using the Physics syntax");
      27             : 
      28             :   // We pull in parameters from various flow objects. This helps make sure the parameters are
      29             :   // spelled the same way and match the evolution of other objects.
      30             :   // If we remove these objects, or change their parameters, these parameters should be updated
      31             :   // Downstream actions must either implement all these options, or redefine the parameter with
      32             :   // a restricted MooseEnum, or place an error in the constructor for unsupported configurations
      33             :   // We mostly pull the boundary parameters from NSFV Action
      34             : 
      35        1962 :   params += NSFVBase::commonNavierStokesFlowParams();
      36        3924 :   params.addParam<bool>(
      37             :       "include_deviatoric_stress",
      38        3924 :       false,
      39             :       "Whether to include the full expansion (the transposed term as well) of the stress tensor");
      40             : 
      41             :   // Momentum boundary conditions are important for advection problems as well
      42        1962 :   params += NSFVBase::commonMomentumBoundaryTypesParams();
      43             : 
      44             :   // Specify the weakly compressible boundary flux information. They are used for specifying in flux
      45             :   // boundary conditions for advection physics in WCNSFV
      46        1962 :   params += NSFVBase::commonMomentumBoundaryFluxesParams();
      47        3924 :   params.addParam<std::vector<std::vector<MooseFunctorName>>>(
      48             :       "momentum_wall_functors",
      49             :       {},
      50             :       "Functors for each component of the velocity value on walls. This is only necessary for the "
      51             :       "fixed-velocity momentum wall types.");
      52             : 
      53             :   // Most downstream physics implementations are valid for porous media too
      54             :   // If yours is not, please remember to disable the 'porous_medium_treatment' parameter
      55        1962 :   params.transferParam<bool>(NSFVBase::validParams(), "porous_medium_treatment");
      56        1962 :   params.transferParam<MooseFunctorName>(NSFVBase::validParams(), "porosity");
      57             : 
      58             :   // Initialization parameters
      59        1962 :   params.transferParam<std::vector<FunctionName>>(NSFVBase::validParams(), "initial_velocity");
      60        1962 :   params.transferParam<FunctionName>(NSFVBase::validParams(), "initial_pressure");
      61             : 
      62             :   // Spatial discretization scheme
      63             :   // Specify the numerical schemes for interpolations of velocity and pressure
      64        1962 :   params.transferParam<MooseEnum>(NSFVBase::validParams(), "velocity_interpolation");
      65        1962 :   params.transferParam<MooseEnum>(NSFVBase::validParams(), "momentum_advection_interpolation");
      66        1962 :   params.transferParam<MooseEnum>(NSFVBase::validParams(), "momentum_face_interpolation");
      67        1962 :   params.transferParam<bool>(NSFVBase::validParams(), "momentum_two_term_bc_expansion");
      68        1962 :   params.transferParam<bool>(NSFVBase::validParams(), "pressure_two_term_bc_expansion");
      69        3924 :   MooseEnum coeff_interp_method("average harmonic", "harmonic");
      70        3924 :   params.addParam<MooseEnum>("mu_interp_method",
      71             :                              coeff_interp_method,
      72             :                              "Switch that can select face interpolation method for the viscosity.");
      73             : 
      74             :   // Parameter groups
      75        3924 :   params.addParamNamesToGroup(
      76             :       "velocity_variable pressure_variable initial_pressure initial_velocity", "Variables");
      77        3924 :   params.addParamNamesToGroup("density dynamic_viscosity", "Material properties");
      78        3924 :   params.addParamNamesToGroup("inlet_boundaries momentum_inlet_types momentum_inlet_functors",
      79             :                               "Inlet boundary conditions");
      80        3924 :   params.addParamNamesToGroup("outlet_boundaries momentum_outlet_types pressure_functors",
      81             :                               "Outlet boundary conditions");
      82        3924 :   params.addParamNamesToGroup("wall_boundaries momentum_wall_types momentum_wall_functors",
      83             :                               "Wall boundary conditions");
      84        3924 :   params.addParamNamesToGroup(
      85             :       "include_deviatoric_stress velocity_interpolation momentum_advection_interpolation "
      86             :       "momentum_two_term_bc_expansion pressure_two_term_bc_expansion mu_interp_method "
      87             :       "momentum_face_interpolation",
      88             :       "Numerical scheme");
      89        3924 :   params.addParamNamesToGroup("thermal_expansion", "Gravity treatment");
      90             : 
      91        1962 :   return params;
      92        1962 : }
      93             : 
      94        1962 : WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase(const InputParameters & parameters)
      95             :   : NavierStokesPhysicsBase(parameters),
      96        3924 :     _has_flow_equations(getParam<bool>("add_flow_equations")),
      97        3924 :     _compressibility(getParam<MooseEnum>("compressibility")),
      98        3924 :     _solve_for_dynamic_pressure(getParam<bool>("solve_for_dynamic_pressure")),
      99        3924 :     _porous_medium_treatment(getParam<bool>("porous_medium_treatment")),
     100        3924 :     _porosity_name(getParam<MooseFunctorName>("porosity")),
     101             :     _flow_porosity_functor_name(_porosity_name),
     102        4171 :     _velocity_names(
     103        1962 :         isParamValid("velocity_variable")
     104        1962 :             ? getParam<std::vector<std::string>>("velocity_variable")
     105        1715 :             : (_porous_medium_treatment
     106        1715 :                    ? std::vector<std::string>(NS::superficial_velocity_vector,
     107             :                                               NS::superficial_velocity_vector + 3)
     108             :                    : std::vector<std::string>(NS::velocity_vector, NS::velocity_vector + 3))),
     109        4101 :     _pressure_name(isParamValid("pressure_variable")
     110        2316 :                        ? getParam<NonlinearVariableName>("pressure_variable")
     111             :                        : NS::pressure),
     112        3968 :     _fluid_temperature_name(isParamValid("fluid_temperature_variable")
     113        2050 :                                 ? getParam<NonlinearVariableName>("fluid_temperature_variable")
     114             :                                 : NS::T_fluid),
     115        1962 :     _density_name(getParam<MooseFunctorName>("density")),
     116        3924 :     _density_gravity_name(isParamValid("density_gravity")
     117        1962 :                               ? getParam<MooseFunctorName>("density_gravity")
     118        5886 :                               : getParam<MooseFunctorName>("density")),
     119        1962 :     _dynamic_viscosity_name(getParam<MooseFunctorName>("dynamic_viscosity")),
     120        3924 :     _velocity_interpolation(getParam<MooseEnum>("velocity_interpolation")),
     121        3924 :     _momentum_advection_interpolation(getParam<MooseEnum>("momentum_advection_interpolation")),
     122        3924 :     _momentum_face_interpolation(getParam<MooseEnum>("momentum_face_interpolation")),
     123        3924 :     _friction_blocks(getParam<std::vector<std::vector<SubdomainName>>>("friction_blocks")),
     124        3924 :     _friction_types(getParam<std::vector<std::vector<std::string>>>("friction_types")),
     125        3924 :     _friction_coeffs(getParam<std::vector<std::vector<std::string>>>("friction_coeffs")),
     126        3924 :     _inlet_boundaries(getParam<std::vector<BoundaryName>>("inlet_boundaries")),
     127        3924 :     _outlet_boundaries(getParam<std::vector<BoundaryName>>("outlet_boundaries")),
     128        3924 :     _wall_boundaries(getParam<std::vector<BoundaryName>>("wall_boundaries")),
     129        5886 :     _hydraulic_separators(getParam<std::vector<BoundaryName>>("hydraulic_separator_sidesets")),
     130        3924 :     _flux_inlet_pps(getParam<std::vector<PostprocessorName>>("flux_inlet_pps")),
     131        7848 :     _flux_inlet_directions(getParam<std::vector<Point>>("flux_inlet_directions"))
     132             : {
     133             :   // Inlet boundary parameter checking
     134        3924 :   checkSecondParamSetOnlyIfFirstOneSet("flux_inlet_pps", "flux_inlet_directions");
     135        1962 :   if (_flux_inlet_directions.size())
     136          36 :     checkVectorParamsSameLengthIfSet<PostprocessorName, Point>("flux_inlet_pps",
     137             :                                                                "flux_inlet_directions");
     138             : 
     139             :   // Boussinesq parameters checks
     140        3924 :   checkSecondParamSetOnlyIfFirstOneTrue("boussinesq_approximation", "ref_temperature");
     141        3924 :   checkSecondParamSetOnlyIfFirstOneSet("gravity", "boussinesq_approximation");
     142             : 
     143             :   // Dynamic pressure parameter checks
     144        1962 :   if (_compressibility != "incompressible" && _solve_for_dynamic_pressure)
     145           0 :     paramError("compressibility",
     146             :                "Solving for dynamic pressure is only implemented for incompressible flow");
     147             : 
     148             :   // Boundary parameters checking
     149        3922 :   checkVectorParamAndMultiMooseEnumLength<BoundaryName>("inlet_boundaries", "momentum_inlet_types");
     150        3918 :   checkVectorParamAndMultiMooseEnumLength<BoundaryName>("outlet_boundaries",
     151             :                                                         "momentum_outlet_types");
     152        3914 :   checkVectorParamAndMultiMooseEnumLength<BoundaryName>("wall_boundaries", "momentum_wall_types");
     153             :   checkVectorParamLengthSameAsCombinedOthers<BoundaryName,
     154             :                                              std::vector<MooseFunctorName>,
     155        3910 :                                              PostprocessorName>(
     156             :       "inlet_boundaries", "momentum_inlet_functors", "flux_inlet_pps");
     157        1954 :   checkVectorParamsNoOverlap<BoundaryName>(
     158             :       {"inlet_boundaries", "outlet_boundaries", "wall_boundaries"});
     159             : 
     160             :   // Porous media parameters
     161        3908 :   checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "porosity");
     162             : 
     163        1954 :   if (_define_variables && _porous_medium_treatment)
     164        3366 :     for (const auto & name : NS::velocity_vector)
     165             :     {
     166        2525 :       const auto & it = std::find(_velocity_names.begin(), _velocity_names.end(), name);
     167        2525 :       if (it != _velocity_names.end())
     168           2 :         paramError("velocity_variable",
     169           2 :                    "For porous medium simulations, functor name " + *it +
     170             :                        " is already reserved for the automatically-computed interstitial velocity. "
     171             :                        "Please choose another name for your external velocity variable!");
     172             :     }
     173             : 
     174             :   // Friction parameter checks
     175        1952 :   if (_friction_blocks.size())
     176         348 :     checkVectorParamsSameLength<std::vector<SubdomainName>, std::vector<std::string>>(
     177             :         "friction_blocks", "friction_types");
     178        3902 :   checkTwoDVectorParamsSameLength<std::string, std::string>("friction_types", "friction_coeffs");
     179             : 
     180             :   // Create maps for boundary-restricted parameters
     181        3900 :   _momentum_inlet_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
     182             :       _inlet_boundaries, getParam<MultiMooseEnum>("momentum_inlet_types"));
     183        3900 :   _momentum_outlet_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
     184             :       _outlet_boundaries, getParam<MultiMooseEnum>("momentum_outlet_types"));
     185        3900 :   _momentum_wall_types = Moose::createMapFromVectorAndMultiMooseEnum<BoundaryName>(
     186             :       _wall_boundaries, getParam<MultiMooseEnum>("momentum_wall_types"));
     187        3900 :   if (isParamSetByUser("momentum_inlet_functors"))
     188             :   {
     189             :     // Not all inlet boundary types require the specification of an inlet functor
     190             :     std::vector<BoundaryName> inlet_boundaries_with_functors;
     191        4144 :     for (const auto & boundary : _inlet_boundaries)
     192        2409 :       if (libmesh_map_find(_momentum_inlet_types, boundary) == "fixed-velocity" ||
     193          38 :           libmesh_map_find(_momentum_inlet_types, boundary) == "fixed-pressure")
     194        2371 :         inlet_boundaries_with_functors.push_back(boundary);
     195             :     _momentum_inlet_functors =
     196        3546 :         Moose::createMapFromVectors<BoundaryName, std::vector<MooseFunctorName>>(
     197             :             inlet_boundaries_with_functors,
     198             :             getParam<std::vector<std::vector<MooseFunctorName>>>("momentum_inlet_functors"));
     199        1773 :   }
     200        3900 :   if (isParamSetByUser("pressure_functors"))
     201             :   {
     202             :     // Not all outlet boundary types require the specification of an inlet functor
     203             :     std::vector<BoundaryName> outlet_boundaries_with_functors;
     204        3480 :     for (const auto & boundary : _outlet_boundaries)
     205        3490 :       if (libmesh_map_find(_momentum_outlet_types, boundary) == "fixed-pressure-zero-gradient" ||
     206        1712 :           libmesh_map_find(_momentum_outlet_types, boundary) == "fixed-pressure")
     207        1759 :         outlet_boundaries_with_functors.push_back(boundary);
     208        3404 :     const auto & pressure_functors = getParam<std::vector<MooseFunctorName>>("pressure_functors");
     209        1702 :     if (outlet_boundaries_with_functors.size() != pressure_functors.size())
     210           4 :       paramError("pressure_functors",
     211           2 :                  "Size (" + std::to_string(pressure_functors.size()) +
     212             :                      ") is not the same as the number of pressure outlet boundaries in "
     213           2 :                      "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
     214           2 :                      std::to_string(outlet_boundaries_with_functors.size()) + ")");
     215        1700 :     _pressure_functors = Moose::createMapFromVectors<BoundaryName, MooseFunctorName>(
     216             :         outlet_boundaries_with_functors, pressure_functors);
     217        1700 :   }
     218             : 
     219        3896 :   if (isParamSetByUser("momentum_wall_functors"))
     220             :   {
     221             :     // Not all wall boundary types require the specification of an inlet functor
     222             :     std::vector<BoundaryName> wall_boundaries_with_functors;
     223         362 :     for (const auto & boundary : _wall_boundaries)
     224         286 :       if (libmesh_map_find(_momentum_wall_types, boundary) == "noslip")
     225         286 :         wall_boundaries_with_functors.push_back(boundary);
     226             :     const auto & momentum_wall_functors =
     227         152 :         getParam<std::vector<std::vector<MooseFunctorName>>>("momentum_wall_functors");
     228          76 :     if (wall_boundaries_with_functors.size() != momentum_wall_functors.size())
     229           0 :       paramError("momentum_wall_functors",
     230           0 :                  "Size (" + std::to_string(momentum_wall_functors.size()) +
     231             :                      ") is not the same as the number of momentum_wall wall boundaries with "
     232           0 :                      "no-slip boundary conditions ' (size " +
     233           0 :                      std::to_string(wall_boundaries_with_functors.size()) + ")");
     234             : 
     235             :     _momentum_wall_functors =
     236          76 :         Moose::createMapFromVectors<BoundaryName, std::vector<MooseFunctorName>>(
     237             :             wall_boundaries_with_functors, momentum_wall_functors);
     238          76 :   }
     239        1948 : }
     240             : 
     241             : void
     242        1918 : WCNSFVFlowPhysicsBase::initializePhysicsAdditional()
     243             : {
     244        1918 :   getProblem().needFV();
     245        1918 : }
     246             : 
     247             : void
     248       24963 : WCNSFVFlowPhysicsBase::actOnAdditionalTasks()
     249             : {
     250             :   // Turbulence physics would not be initialized before this task
     251       24963 :   if (_current_task == "get_turbulence_physics")
     252        1910 :     _turbulence_physics = getCoupledTurbulencePhysics();
     253       24963 : }
     254             : 
     255             : void
     256        1888 : WCNSFVFlowPhysicsBase::addFVBCs()
     257             : {
     258        1888 :   addInletBC();
     259        1886 :   addOutletBC();
     260        1886 :   addWallsBC();
     261        1886 :   addSeparatorBC();
     262        1886 : }
     263             : 
     264             : void
     265        1896 : WCNSFVFlowPhysicsBase::addMaterials()
     266             : {
     267        1896 :   if (hasForchheimerFriction() || _porous_medium_treatment)
     268         879 :     addPorousMediumSpeedMaterial();
     269             :   else
     270        1017 :     addNonPorousMediumSpeedMaterial();
     271        1896 : }
     272             : 
     273             : void
     274         879 : WCNSFVFlowPhysicsBase::addPorousMediumSpeedMaterial()
     275             : {
     276         879 :   InputParameters params = getFactory().getValidParams("PINSFVSpeedFunctorMaterial");
     277         879 :   assignBlocks(params, _blocks);
     278             : 
     279        2637 :   for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
     280        3516 :     params.set<MooseFunctorName>(NS::superficial_velocity_vector[dim_i]) = _velocity_names[dim_i];
     281         879 :   if (_porous_medium_treatment)
     282         841 :     params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
     283             :   else
     284          76 :     params.set<MooseFunctorName>(NS::porosity) = "1";
     285         879 :   params.set<bool>("define_interstitial_velocity_components") = _porous_medium_treatment;
     286             : 
     287        2637 :   getProblem().addMaterial("PINSFVSpeedFunctorMaterial", prefix() + "pins_speed_material", params);
     288         879 : }
     289             : 
     290             : void
     291        1017 : WCNSFVFlowPhysicsBase::addNonPorousMediumSpeedMaterial()
     292             : {
     293        1017 :   const std::string class_name = "ADVectorMagnitudeFunctorMaterial";
     294        1017 :   InputParameters params = getFactory().getValidParams(class_name);
     295        1017 :   assignBlocks(params, _blocks);
     296             : 
     297        4068 :   const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
     298        3013 :   for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
     299        3992 :     params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
     300        2034 :   params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
     301             : 
     302        2034 :   getProblem().addMaterial(class_name, prefix() + "ins_speed_material", params);
     303        4068 : }
     304             : 
     305             : void
     306        1904 : WCNSFVFlowPhysicsBase::addInitialConditions()
     307             : {
     308        1916 :   if (!_define_variables && parameters().isParamSetByUser("initial_velocity") &&
     309        3816 :       parameters().isParamSetByUser("velocity_variable") &&
     310        1908 :       getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
     311             :     // TODO: Rework and remove this last statement once the NSFV action is removed
     312           2 :     paramError("initial_velocity",
     313             :                "Velocity is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
     314             :                "conditions");
     315        3804 :   if (!_define_variables && parameters().isParamSetByUser("initial_pressure") &&
     316        1906 :       parameters().isParamSetByUser("pressure_variable"))
     317           2 :     paramError("initial_pressure",
     318             :                "Pressure is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
     319             :                "condition");
     320             : 
     321             :   // Check dimension
     322        7591 :   if (getParam<std::vector<FunctionName>>("initial_velocity").size() != dimension() &&
     323        3802 :       getParam<std::vector<FunctionName>>("initial_velocity").size() != 3 &&
     324        1904 :       getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
     325             :     // TODO: Rework and remove this last statement once the NSFV action is removed
     326           2 :     paramError("initial_velocity",
     327           4 :                "The number of velocity components in the " + type() + " initial condition is not " +
     328           2 :                    std::to_string(dimension()) + " or 3!");
     329             : 
     330        1898 :   InputParameters params = getFactory().getValidParams("FunctionIC");
     331        1898 :   assignBlocks(params, _blocks);
     332        3796 :   auto vvalue = getParam<std::vector<FunctionName>>("initial_velocity");
     333             : 
     334        7554 :   for (const auto d : make_range(dimension()))
     335             :   {
     336        7516 :     params.set<VariableName>("variable") = _velocity_names[d];
     337        3758 :     params.set<FunctionName>("function") = vvalue[d];
     338             : 
     339        7516 :     if (shouldCreateIC(_velocity_names[d],
     340             :                        _blocks,
     341       11274 :                        /*whether IC is a default*/ !isParamSetByUser("initial_velocity"),
     342        7516 :                        /*error if already an IC*/ isParamSetByUser("initial_velocity")))
     343       14104 :       getProblem().addInitialCondition("FunctionIC", prefix() + _velocity_names[d] + "_ic", params);
     344             :   }
     345             : 
     346        3796 :   if (shouldCreateIC(_pressure_name,
     347             :                      _blocks,
     348        5694 :                      /*whether IC is a default*/ !isParamSetByUser("initial_pressure"),
     349        3796 :                      /*error if already an IC*/ isParamSetByUser("initial_pressure")))
     350             :   {
     351        3644 :     params.set<VariableName>("variable") = _pressure_name;
     352        5466 :     params.set<FunctionName>("function") = getParam<FunctionName>("initial_pressure");
     353             : 
     354        7288 :     getProblem().addInitialCondition("FunctionIC", prefix() + _pressure_name + "_ic", params);
     355             :   }
     356        1898 : }
     357             : 
     358             : unsigned short
     359       15318 : WCNSFVFlowPhysicsBase::getNumberAlgebraicGhostingLayersNeeded() const
     360             : {
     361             :   unsigned short ghost_layers = 2;
     362       15318 :   return ghost_layers;
     363             : }
     364             : 
     365             : void
     366        1896 : WCNSFVFlowPhysicsBase::addPostprocessors()
     367             : {
     368        3792 :   const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
     369             : 
     370        4314 :   for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
     371        2418 :     if (momentum_inlet_types[bc_ind] == "flux-mass" ||
     372        2382 :         momentum_inlet_types[bc_ind] == "flux-velocity")
     373             :     {
     374         101 :       const std::string pp_type = "AreaPostprocessor";
     375         101 :       InputParameters params = getFactory().getValidParams(pp_type);
     376         303 :       params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
     377         202 :       params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
     378             : 
     379         101 :       const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
     380         101 :       if (!getProblem().hasUserObject(name_pp))
     381         101 :         getProblem().addPostprocessor(pp_type, name_pp, params);
     382         101 :     }
     383        1896 : }
     384             : 
     385             : VariableName
     386           0 : WCNSFVFlowPhysicsBase::getFlowVariableName(const std::string & short_name) const
     387             : {
     388           0 :   if (short_name == NS::pressure)
     389           0 :     return getPressureName();
     390           0 :   else if (short_name == NS::velocity_x && dimension() > 0)
     391             :     return getVelocityNames()[0];
     392           0 :   else if (short_name == NS::velocity_y && dimension() > 1)
     393             :     return getVelocityNames()[1];
     394           0 :   else if (short_name == NS::velocity_z && dimension() > 2)
     395             :     return getVelocityNames()[2];
     396           0 :   else if (short_name == NS::temperature)
     397           0 :     return getFluidTemperatureName();
     398             :   else
     399           0 :     mooseError("Short Variable name '", short_name, "' not recognized.");
     400             : }
     401             : 
     402             : MooseFunctorName
     403         339 : WCNSFVFlowPhysicsBase::getPorosityFunctorName(bool smoothed) const
     404             : {
     405         339 :   if (smoothed)
     406             :     return _flow_porosity_functor_name;
     407             :   else
     408             :     return _porosity_name;
     409             : }
     410             : 
     411             : const WCNSFVTurbulencePhysics *
     412        1910 : WCNSFVFlowPhysicsBase::getCoupledTurbulencePhysics() const
     413             : {
     414             :   // User passed it, just use that
     415        3820 :   if (isParamValid("coupled_turbulence_physics"))
     416           0 :     return getCoupledPhysics<WCNSFVTurbulencePhysics>(
     417             :         getParam<PhysicsName>("coupled_flow_physics"));
     418             :   // Look for any physics of the right type, and check the block restriction
     419             :   else
     420             :   {
     421        1910 :     const auto all_turbulence_physics = getCoupledPhysics<const WCNSFVTurbulencePhysics>(true);
     422        1910 :     for (const auto physics : all_turbulence_physics)
     423        1089 :       if (checkBlockRestrictionIdentical(
     424             :               physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
     425             :         return physics;
     426        1910 :   }
     427             :   // Did not find one
     428         821 :   return nullptr;
     429             : }

Generated by: LCOV version 1.14