LCOV - code coverage report
Current view: top level - include/base - NS.h (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 5 5 100.0 %
Date: 2026-05-29 20:37:52 Functions: 1 1 100.0 %
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             : #pragma once
      11             : 
      12             : #include <string>
      13             : #include "MathUtils.h"
      14             : #include "MooseUtils.h"
      15             : #include "MooseTypes.h"
      16             : #include "libmesh/vector_value.h"
      17             : #include "HeatConductionNames.h"
      18             : 
      19             : namespace NS
      20             : {
      21             : using namespace HeatConduction;
      22             : 
      23             : static const std::string directions[3] = {"x", "y", "z"};
      24             : 
      25             : // geometric quantities
      26             : static const std::string pebble_diameter = "pebble_diameter";
      27             : static const std::string infinite_porosity = "infinite_porosity";
      28             : static const std::string axis = "axis";
      29             : static const std::string center = "center";
      30             : static const std::string wall_porosity = "wall_porosity";
      31             : static const std::string wall_distance = "wall_distance";
      32             : 
      33             : // Names defined in Navier-Stokes
      34             : static const std::string density = "rho";
      35             : static const std::string superficial_density = "superficial_rho";
      36             : static const std::string momentum_x = "rhou";
      37             : static const std::string momentum_y = "rhov";
      38             : static const std::string momentum_z = "rhow";
      39             : static const std::string momentum_vector[3] = {momentum_x, momentum_y, momentum_z};
      40             : static const std::string superficial_momentum_x = "superficial_rhou";
      41             : static const std::string superficial_momentum_y = "superficial_rhov";
      42             : static const std::string superficial_momentum_z = "superficial_rhow";
      43             : static const std::string superficial_momentum_vector[3] = {
      44             :     superficial_momentum_x, superficial_momentum_y, superficial_momentum_z};
      45             : 
      46             : static const std::string velocity = "velocity";
      47             : static const std::string velocity_x = "vel_x";
      48             : static const std::string velocity_y = "vel_y";
      49             : static const std::string velocity_z = "vel_z";
      50             : const std::string velocity_vector[3] = {velocity_x, velocity_y, velocity_z};
      51             : static const std::string superficial_velocity_x = "superficial_vel_x";
      52             : static const std::string superficial_velocity_y = "superficial_vel_y";
      53             : static const std::string superficial_velocity_z = "superficial_vel_z";
      54             : static const std::string superficial_velocity = "superficial_velocity";
      55             : static const std::string superficial_velocity_vector[3] = {
      56             :     superficial_velocity_x, superficial_velocity_y, superficial_velocity_z};
      57             : static const std::string pressure = "pressure";
      58             : // Starting variable name with pressure so it is displayed next to pressure in outputs
      59             : static const std::string total_pressure = "pressure_total";
      60             : static const std::string temperature = "temperature";
      61             : 
      62             : static const std::string internal_energy = "internal_energy";
      63             : static const std::string specific_internal_energy = "e";
      64             : static const std::string specific_total_energy = "et";
      65             : static const std::string internal_energy_density = "rho_e";
      66             : static const std::string total_energy_density = "rho_et";
      67             : static const std::string superficial_total_energy_density = "superficial_rho_et";
      68             : 
      69             : static const std::string specific_enthalpy = "h";
      70             : static const std::string specific_total_enthalpy = "ht";
      71             : static const std::string enthalpy_density = "rho_h";
      72             : static const std::string total_enthalpy_density = "rho_ht";
      73             : static const std::string superficial_total_enthalpy_density = "superficial_rho_ht";
      74             : 
      75             : static const std::string mixing_length = "mixing_length";
      76             : static const std::string wall_shear_stress = "wall_shear_stress";
      77             : static const std::string wall_yplus = "wall_yplus";
      78             : static const std::string eddy_viscosity = "eddy_viscosity";
      79             : static const std::string total_viscosity = "total_viscosity";
      80             : 
      81             : static const std::string mach_number = "Mach";
      82             : static const std::string specific_volume = "specific_volume";
      83             : 
      84             : static const std::string momentum = "momentum";
      85             : static const std::string v = "v";
      86             : static const std::string acceleration = "acceleration";
      87             : 
      88             : static const std::string fluid = "fp";
      89             : 
      90             : // for Navier-Stokes material props representing gradients of nonlin+aux vars
      91             : inline std::string
      92             : grad(const std::string & var)
      93             : {
      94       29415 :   return MathUtils::gradName(var);
      95             : }
      96             : // for Navier-Stokes material props representing time derivatives of nonlin+aux vars
      97             : inline std::string
      98       11776 : time_deriv(const std::string & var)
      99             : {
     100       11776 :   if (MooseUtils::isFloat(var))
     101           7 :     return "0";
     102             :   else
     103       11769 :     return MathUtils::timeDerivName(var);
     104             : }
     105             : 
     106             : // Navier-Stokes Variables
     107             : // Relating to porous media
     108             : static const std::string porosity = "porosity";
     109             : static const std::string smoothed_porosity = "smoothed_porosity";
     110             : static const std::string T_fluid = "T_fluid";
     111             : static const std::string T_solid = "T_solid";
     112             : static const std::string heat_source = "heat_source";
     113             : 
     114             : // Navier-Stokes Materials
     115             : static const std::string cL = "Darcy_coefficient";
     116             : static const std::string cQ = "Forchheimer_coefficient";
     117             : static const std::string alpha_boussinesq = "alpha_b";
     118             : static const std::string drhos_dTs = "drhos_dTs";
     119             : static const std::string dks_dTs = "dks_dTs";
     120             : static const std::string kappa = "kappa";
     121             : static const std::string kappa_s = "kappa_s";
     122             : static const std::string rho_s = "rho_s";
     123             : static const std::string cp_s = "cp_s";
     124             : static const std::string k_s = "k_s";
     125             : static const std::string cp = "cp";
     126             : static const std::string cv = "cv";
     127             : static const std::string mu = "mu";
     128             : // Turbulent dynamic viscosity
     129             : static const std::string mu_t = "mu_t";
     130             : // Turbulent dynamic scalar viscosity
     131             : static const std::string mu_t_passive_scalar = "mu_t_passive_scalar";
     132             : // Effective viscosity = sum of viscosities
     133             : static const std::string mu_eff = "mu_eff";
     134             : static const std::string k = "k";
     135             : // Turbulence 'conductivity'
     136             : static const std::string k_t = "k_t";
     137             : static const std::string thermal_diffusivity = "thermal_diffusivity";
     138             : static const std::string alpha = "alpha";
     139             : static const std::string alpha_wall = "alpha_wall";
     140             : static const std::string solid = "solid";
     141             : static const std::string Prandtl = "Pr";
     142             : static const std::string turbulent_Prandtl = "Pr_t";
     143             : static const std::string Reynolds = "Re";
     144             : static const std::string Reynolds_hydraulic = "Re_h";
     145             : static const std::string Reynolds_interstitial = "Re_i";
     146             : static const std::string c = "c";
     147             : static const std::string speed = "speed";
     148             : static const std::string sound_speed = "sound_speed";
     149             : 
     150             : // Two phase mixture materials
     151             : static const std::string latent_heat = "latent_heat";
     152             : static const std::string T_liquidus = "T_liquidus";
     153             : static const std::string T_solidus = "T_solidus";
     154             : static const std::string alpha_exchange = "alpha_exchange";
     155             : 
     156             : // other Navier-Stokes terms
     157             : static const std::string component = "component";
     158             : static const std::string source_scaling = "source_scaling";
     159             : 
     160             : // SUPG terms
     161             : static const std::string matrix_tau = "matrix_tau";
     162             : static const std::string vector_tau = "vector_tau";
     163             : static const std::string scalar_tau = "scalar_tau";
     164             : static const std::string diagonal_tau = "diagonal_tau";
     165             : static const std::string A = "A";
     166             : static const std::string R = "R";
     167             : static const std::string S = "S";
     168             : static const std::string dS_dTs = "dS_dTs";
     169             : static const std::string F = "F";
     170             : static const std::string G = "G";
     171             : static const std::string dUdt = "dUdt";
     172             : static const std::string C = "C";
     173             : static const std::string Z = "Z";
     174             : static const std::string K = "K";
     175             : static const std::string mass_flux = "mass_flux";
     176             : 
     177             : // Turbulence
     178             : 
     179             : // Turbulence variables
     180             : static const std::string TKE = "tke";
     181             : static const std::string TKED = "epsilon";
     182             : 
     183             : /**
     184             :  * Wall treatment options
     185             :  */
     186             : enum class WallTreatmentEnum
     187             : {
     188             :   EQ_NEWTON = 0,
     189             :   EQ_INCREMENTAL = 1,
     190             :   EQ_LINEARIZED = 2,
     191             :   NEQ = 3
     192             : };
     193             : 
     194             : /**
     195             :  * CHT side options, we want to make sure these can be used as integers
     196             :  * so we are avoiding the enum class here.
     197             :  */
     198             : enum CHTSide
     199             : {
     200             :   SOLID = 0,
     201             :   FLUID = 1
     202             : };
     203             : 
     204             : // Turbulence constants
     205             : static constexpr Real von_karman_constant = 0.4187;
     206             : static constexpr Real E_turb_constant = 9.793;
     207             : // Lower limit for mu_t
     208             : static constexpr Real mu_t_low_limit = 1.0e-8;
     209             : // Lower limit for epsilon in the k-epsilon
     210             : static constexpr Real epsilon_low_limit = 1.0e-8;
     211             : // Lower limit for y_plus
     212             : static constexpr Real min_y_plus = 1e-10;
     213             : 
     214             : // Boundary condition types
     215             : enum class MomentumInletTypes
     216             : {
     217             :   FIXED_VELOCITY = 0,
     218             :   FLUX_VELOCITY = 1,
     219             :   FLUX_MASS = 2,
     220             :   FIXED_PRESSURE = 3
     221             : };
     222             : }
     223             : 
     224             : namespace NS_DEFAULT_VALUES
     225             : {
     226             : static const Real infinite_porosity = 0.4;
     227             : static const int bed_axis = 2;
     228             : static const Real wall_porosity = 1.0;
     229             : 
     230             : static const Real k_epsilon = 1e-6;
     231             : static const Real vel_epsilon = 1e-8;
     232             : 
     233             : static const RealVectorValue center(0.0, 0.0, 0.0);
     234             : static const RealVectorValue acceleration(0.0, 0.0, 0.0);
     235             : 
     236             : // assumed that the RZ geometry is not annular unless otherwise specified
     237             : static const Real inner_radius = 0.0;
     238             : }
     239             : 
     240             : namespace NS_CONSTANTS
     241             : {
     242             : using namespace HeatConduction::Constants;
     243             : }

Generated by: LCOV version 1.14