8 #include "reynolds_averaged_navier_stokes.h"     9 #include "negative_spalart_allmaras_rans_model.h"    17 template <
int dim, 
int nstate, 
typename real>
    20     const double                                              ref_length,
    21     const double                                              gamma_gas,
    22     const double                                              mach_inf,
    23     const double                                              angle_of_attack,
    24     const double                                              side_slip_angle,
    25     const double                                              prandtl_number,
    26     const double                                              reynolds_number_inf,
    27     const bool                                                use_constant_viscosity,
    28     const double                                              constant_viscosity,
    29     const double                                              turbulent_prandtl_number,
    30     const double                                              temperature_inf,
    31     const double                                              isothermal_wall_temperature,
    43                                                         use_constant_viscosity,
    45                                                         turbulent_prandtl_number,
    47                                                         isothermal_wall_temperature,
    48                                                         thermal_boundary_condition_type,
    49                                                         manufactured_solution_function,
    50                                                         two_point_num_flux_type)
    53 template <
int dim, 
int nstate, 
typename real>
    56     const std::array<real,nstate_navier_stokes> &primitive_soln_rans,
    57     const std::array<real,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const    59     return compute_eddy_viscosity_templated<real>(primitive_soln_rans,primitive_soln_turbulence_model);
    62 template <
int dim, 
int nstate, 
typename real>
    65     const std::array<FadType,nstate_navier_stokes> &primitive_soln_rans,
    66     const std::array<FadType,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const    68     return compute_eddy_viscosity_templated<FadType>(primitive_soln_rans,primitive_soln_turbulence_model);
    71 template <
int dim, 
int nstate, 
typename real>
    72 template<
typename real2>
    75     const std::array<real2,nstate_navier_stokes> &primitive_soln_rans,
    76     const std::array<real2,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const    79     if (primitive_soln_turbulence_model[0]>=0.0)
    82         const real2 laminar_dynamic_viscosity = this->
navier_stokes_physics->compute_viscosity_coefficient(primitive_soln_rans);
    83         const real2 laminar_kinematic_viscosity = laminar_dynamic_viscosity/primitive_soln_rans[0];
    84         const real2 Chi = this->
compute_coefficient_Chi(primitive_soln_turbulence_model[0],laminar_kinematic_viscosity);
    86         eddy_viscosity = primitive_soln_rans[0]*primitive_soln_turbulence_model[0]*f_v1;
    91     return eddy_viscosity;
    94 template <
int dim, 
int nstate, 
typename real>
    95 template<
typename real2>
    98     const real2 coefficient)
 const   100     real2 scaled_coefficient;
   101     if constexpr(std::is_same<real2,real>::value){
   104     else if constexpr(std::is_same<real2,FadType>::value){
   106         scaled_coefficient = coefficient/reynolds_number_inf_fad;
   109         std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> scale_coefficient(): real2 != real or FadType" << std::endl;
   113     return scaled_coefficient;
   116 template <
int dim, 
int nstate, 
typename real>
   119     const std::array<real,nstate_navier_stokes> &primitive_soln_rans,
   120     const std::array<real,nstate_turbulence_model> &primitive_soln_turbulence_model) 
const   122     return compute_effective_viscosity_turbulence_model_templated<real>(primitive_soln_rans,primitive_soln_turbulence_model);
   125 template <
int dim, 
int nstate, 
typename real>
   128     const std::array<FadType,nstate_navier_stokes> &primitive_soln_rans,
   129     const std::array<FadType,nstate_turbulence_model> &primitive_soln_turbulence_model) 
const   131     return compute_effective_viscosity_turbulence_model_templated<FadType>(primitive_soln_rans,primitive_soln_turbulence_model);
   134 template <
int dim, 
int nstate, 
typename real>
   135 template <
typename real2>
   138     const std::array<real2,nstate_navier_stokes> &primitive_soln_rans,
   139     const std::array<real2,nstate_turbulence_model> &primitive_soln_turbulence_model) 
const   141     const real2 laminar_dynamic_viscosity = this->
navier_stokes_physics->compute_viscosity_coefficient(primitive_soln_rans);
   142     const real2 laminar_kinematic_viscosity = laminar_dynamic_viscosity/primitive_soln_rans[0];
   144     const real2 coefficient_f_n = this->
compute_coefficient_f_n(primitive_soln_turbulence_model[0],laminar_kinematic_viscosity);
   146     std::array<real2,nstate_turbulence_model> effective_viscosity_turbulence_model;
   149         if constexpr(std::is_same<real2,real>::value){
   150             effective_viscosity_turbulence_model[i] = (laminar_dynamic_viscosity+coefficient_f_n*primitive_soln_rans[0]*primitive_soln_turbulence_model[0])/sigma;
   152         else if constexpr(std::is_same<real2,FadType>::value){
   153             effective_viscosity_turbulence_model[i] = (laminar_dynamic_viscosity+coefficient_f_n*primitive_soln_rans[0]*primitive_soln_turbulence_model[0])/sigma_fad;
   156             std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> compute_effective_viscosity_turbulence_model_templated(): real2 != real or FadType" << std::endl;
   159         effective_viscosity_turbulence_model[i] = 
scale_coefficient(effective_viscosity_turbulence_model[i]);
   162     return effective_viscosity_turbulence_model;
   165 template <
int dim, 
int nstate, 
typename real>
   166 template<
typename real2>
   169     const real2 nu_tilde,
   170     const real2 laminar_kinematic_viscosity)
 const   173     const real2 Chi = nu_tilde/laminar_kinematic_viscosity;
   178 template <
int dim, 
int nstate, 
typename real>
   179 template<
typename real2>
   182     const real2 coefficient_Chi)
 const   185     const real2 coefficient_Chi_power_3 = pow(coefficient_Chi,3.0);
   186     real2 coefficient_f_v1;
   188     if constexpr(std::is_same<real2,real>::value){ 
   189         coefficient_f_v1 = coefficient_Chi_power_3/(coefficient_Chi_power_3+c_v1*c_v1*c_v1);
   191     else if constexpr(std::is_same<real2,FadType>::value){ 
   192         coefficient_f_v1 = coefficient_Chi_power_3/(coefficient_Chi_power_3+c_v1_fad*c_v1_fad*c_v1_fad);
   195         std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> compute_coefficient_f_v1(): real2 != real or FadType" << std::endl;
   199     return coefficient_f_v1;
   202 template <
int dim, 
int nstate, 
typename real>
   205     const real coefficient_Chi)
 const   208     real coefficient_f_v2;
   211     coefficient_f_v2 = 1.0-coefficient_Chi/(1.0+coefficient_Chi*coefficient_f_v1);
   213     return coefficient_f_v2;
   216 template <
int dim, 
int nstate, 
typename real>
   217 template<
typename real2>
   220     const real2 nu_tilde,
   221     const real2 laminar_kinematic_viscosity)
 const   224     real2 coefficient_f_n;
   227     if constexpr(std::is_same<real2,real>::value){ 
   229             coefficient_f_n = 1.0;
   231             coefficient_f_n = (c_n1+coefficient_Chi_power_3)/(c_n1-coefficient_Chi_power_3);
   233     else if constexpr(std::is_same<real2,FadType>::value){
   234         const FadType const_one_fad = 1.0; 
   236             coefficient_f_n = const_one_fad;
   238             coefficient_f_n = (c_n1_fad+coefficient_Chi_power_3)/(c_n1_fad-coefficient_Chi_power_3);
   241         std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> compute_coefficient_f_n(): real2 != real or FadType" << std::endl;
   245     return coefficient_f_n;
   248 template <
int dim, 
int nstate, 
typename real>
   251     const real coefficient_Chi)
 const   254     real coefficient_f_t2;
   256     coefficient_f_t2 = c_t3*exp(-c_t4*coefficient_Chi*coefficient_Chi);
   258     return coefficient_f_t2;
   261 template <
int dim, 
int nstate, 
typename real>
   264     const real coefficient_g)
 const   267     real coefficient_f_w;
   268     const real cw3_power_6 = pow(c_w3,6.0);
   269     coefficient_f_w = coefficient_g*pow((1.0+cw3_power_6)/(pow(coefficient_g,6.0)+cw3_power_6),1.0/6.0);
   271     return coefficient_f_w;
   274 template <
int dim, 
int nstate, 
typename real>
   279     const real s_tilde)
 const   284     coefficient_r = nu_tilde/(s_tilde*kappa*kappa*d_wall*d_wall); 
   286     coefficient_r = coefficient_r <= r_lim ? coefficient_r : r_lim; 
   288     return coefficient_r;
   291 template <
int dim, 
int nstate, 
typename real>
   294     const real coefficient_r)
 const   299     coefficient_g = coefficient_r+c_w2*(pow(coefficient_r,6.0)-coefficient_r);
   301     return coefficient_g;
   304 template <
int dim, 
int nstate, 
typename real>
   307     const std::array<real,nstate_navier_stokes> &conservative_soln_rans,
   308     const std::array<dealii::Tensor<1,dim,real>,
nstate_navier_stokes> &conservative_soln_gradient_rans)
 const   314     const dealii::Tensor<1,3,real> vorticity 
   315         = this->
navier_stokes_physics->compute_vorticity(conservative_soln_rans,conservative_soln_gradient_rans);
   322 template <
int dim, 
int nstate, 
typename real>
   325     const real coefficient_Chi,
   327     const real d_wall)
 const   333     s_bar = nu_tilde*f_v2/(kappa*kappa*d_wall*d_wall);
   338 template <
int dim, 
int nstate, 
typename real>
   341     const real coefficient_Chi,
   348     const real s_bar = 
compute_s_bar(coefficient_Chi,nu_tilde,d_wall);
   354     if(dimensional_s_bar>=-c_v2*dimensional_s) 
   355         s_tilde = s+scaled_s_bar;
   357         s_tilde = s+s*(c_v2*c_v2*s+c_v3*scaled_s_bar)/((c_v3-2.0*c_v2)*s-scaled_s_bar);
   362 template <
int dim, 
int nstate, 
typename real>
   365     const real coefficient_f_t2,
   369     const real s_tilde)
 const   371     std::array<real,nstate> production_source;
   374         production_source[i] = 0.0;
   384     return production_source;
   387 template <
int dim, 
int nstate, 
typename real>
   390     const real coefficient_f_t2,
   394     const real s_tilde)
 const   399     std::array<real,nstate> dissipation_source;
   402         dissipation_source[i] = 0.0;
   406         dissipation_source[
nstate_navier_stokes] = (c_w1*coefficient_f_w-
c_b1*coefficient_f_t2/(kappa*kappa))*nu_tilde*nu_tilde/(d_wall*d_wall);
   413     return dissipation_source;
   416 template <
int dim, 
int nstate, 
typename real>
   421     const real laminar_kinematic_viscosity,
   422     const std::array<dealii::Tensor<1,dim,real>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   423     const std::array<dealii::Tensor<1,dim,real>,
nstate_turbulence_model> &primitive_solution_gradient_turbulence_model)
 const   425     real cross_nu_tilde_nu_tilde = 0.0;
   426     real cross_rho_nu_tilde = 0.0;
   427     std::array<real,nstate> cross_source;
   431         cross_source[i] = 0.0;
   433     for (
int i=0;i<dim;++i){
   434         cross_nu_tilde_nu_tilde += primitive_solution_gradient_turbulence_model[0][i]*primitive_solution_gradient_turbulence_model[0][i];
   435         cross_rho_nu_tilde += primitive_soln_gradient_rans[0][i]*primitive_solution_gradient_turbulence_model[0][i];
   438     cross_source[
nstate_navier_stokes] = (c_b2*density*cross_nu_tilde_nu_tilde-(laminar_kinematic_viscosity+nu_tilde*coefficient_f_n)*cross_rho_nu_tilde)/sigma;
   444 template <
int dim, 
int nstate, 
typename real>
   447     const std::array<real,nstate_navier_stokes> &primitive_soln_rans,
   448     const std::array<dealii::Tensor<1,dim,real>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   449     const std::array<real,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   451     return compute_Reynolds_heat_flux_templated<real>(primitive_soln_rans,primitive_soln_gradient_rans,primitive_soln_turbulence_model);
   454 template <
int dim, 
int nstate, 
typename real>
   457     const std::array<FadType,nstate_navier_stokes> &primitive_soln_rans,
   458     const std::array<dealii::Tensor<1,dim,FadType>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   459     const std::array<FadType,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   461     return compute_Reynolds_heat_flux_templated<FadType>(primitive_soln_rans,primitive_soln_gradient_rans,primitive_soln_turbulence_model);
   464 template <
int dim, 
int nstate, 
typename real>
   465 template<
typename real2>
   468     const std::array<real2,nstate_navier_stokes> &primitive_soln_rans,
   469     const std::array<dealii::Tensor<1,dim,real2>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   470     const std::array<real2,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   473     real2 eddy_viscosity;
   474     if constexpr(std::is_same<real2,real>::value){ 
   477     else if constexpr(std::is_same<real2,FadType>::value){ 
   481         std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> compute_Reynolds_heat_flux_templated(): real2 != real or FadType" << std::endl;
   492     const dealii::Tensor<1,dim,real2> temperature_gradient = this->
navier_stokes_physics->compute_temperature_gradient(primitive_soln_rans, primitive_soln_gradient_rans);
   495     dealii::Tensor<1,dim,real2> heat_flux_Reynolds = this->
navier_stokes_physics->compute_heat_flux_given_scaled_heat_conductivity_and_temperature_gradient(scaled_heat_conductivity,temperature_gradient);
   497     return heat_flux_Reynolds;
   500 template <
int dim, 
int nstate, 
typename real>
   503     const std::array<real,nstate_navier_stokes> &primitive_soln_rans,
   504     const std::array<dealii::Tensor<1,dim,real>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   505     const std::array<real,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   507     return compute_Reynolds_stress_tensor_templated<real>(primitive_soln_rans,primitive_soln_gradient_rans,primitive_soln_turbulence_model);
   510 template <
int dim, 
int nstate, 
typename real>
   513     const std::array<FadType,nstate_navier_stokes> &primitive_soln_rans,
   514     const std::array<dealii::Tensor<1,dim,FadType>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   515     const std::array<FadType,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   517     return compute_Reynolds_stress_tensor_templated<FadType>(primitive_soln_rans,primitive_soln_gradient_rans,primitive_soln_turbulence_model);
   520 template <
int dim, 
int nstate, 
typename real>
   521 template<
typename real2>
   524     const std::array<real2,nstate_navier_stokes> &primitive_soln_rans,
   525     const std::array<dealii::Tensor<1,dim,real2>,
nstate_navier_stokes> &primitive_soln_gradient_rans,
   526     const std::array<real2,nstate_turbulence_model> &primitive_soln_turbulence_model)
 const   529     real2 eddy_viscosity;
   530     if constexpr(std::is_same<real2,real>::value){ 
   533     else if constexpr(std::is_same<real2,FadType>::value){ 
   537         std::cout << 
"ERROR in physics/negative_spalart_allmaras_rans_model.cpp --> compute_Reynolds_stress_tensor_templated(): real2 != real or FadType" << std::endl;
   545     const dealii::Tensor<2,dim,real2> vel_gradient 
   546         = this->
navier_stokes_physics->extract_velocities_gradient_from_primitive_solution_gradient(primitive_soln_gradient_rans);
   549     const dealii::Tensor<2,dim,real2> strain_rate_tensor 
   553     dealii::Tensor<2,dim,real2> Reynolds_stress_tensor;
   554     Reynolds_stress_tensor = this->
navier_stokes_physics->compute_viscous_stress_tensor_via_scaled_viscosity_and_strain_rate_tensor(scaled_eddy_viscosity,strain_rate_tensor);
   556     return Reynolds_stress_tensor;
   559 template <
int dim, 
int nstate, 
typename real>
   562     const dealii::Point<dim,real> &pos,
   563     const std::array<real,nstate> &conservative_soln,
   564     const std::array<dealii::Tensor<1,dim,real>,nstate> &soln_gradient)
 const   569     const std::array<real,nstate_navier_stokes> primitive_soln_rans = this->
navier_stokes_physics->convert_conservative_to_primitive(conservative_soln_rans); 
   570     const std::array<dealii::Tensor<1,dim,real>,
nstate_navier_stokes> primitive_soln_gradient_rans = this->
navier_stokes_physics->convert_conservative_gradient_to_primitive_gradient(conservative_soln_rans, conservative_soln_gradient_rans);
   574     const real density = conservative_soln_rans[0];
   575     const real nu_tilde = conservative_soln[nstate-1]/conservative_soln_rans[0];
   576     const real laminar_dynamic_viscosity = this->
navier_stokes_physics->compute_viscosity_coefficient(primitive_soln_rans);
   577     const real laminar_kinematic_viscosity = laminar_dynamic_viscosity/density;
   582     const real d_wall = pos[1]+1.0;
   584     const real s = 
compute_s(conservative_soln_rans, conservative_soln_gradient_rans);
   585     const real s_tilde = 
compute_s_tilde(coefficient_Chi, nu_tilde, d_wall, s);
   589     const std::array<real,nstate> cross = 
compute_cross_source(density, nu_tilde, laminar_kinematic_viscosity, primitive_soln_gradient_rans, primitive_soln_gradient_turbulence_model);
   592     for (
int i=0;i<nstate;++i){
   593         physical_source_term[i] = production[i]-dissipation[i]+cross[i];
   599 template <
int dim, 
int nstate, 
typename real>
   602    std::array<real,nstate> &soln_bc,
   603    std::array<dealii::Tensor<1,dim,real>,nstate> &soln_grad_bc)
 const   608         soln_bc[istate] = 0.0;
   609         soln_grad_bc[istate] = 0.0;
   613 template <
int dim, 
int nstate, 
typename real>
   616    const std::array<real,nstate> &soln_int,
   617    const std::array<dealii::Tensor<1,dim,real>,nstate> &soln_grad_int,
   618    std::array<real,nstate> &soln_bc,
   619    std::array<dealii::Tensor<1,dim,real>,nstate> &soln_grad_bc)
 const   622         soln_bc[istate] = soln_int[istate];
   623         soln_grad_bc[istate] = soln_grad_int[istate];
   627 template <
int dim, 
int nstate, 
typename real>
   630    const std::array<real,nstate> &,
   631    const std::array<dealii::Tensor<1,dim,real>,nstate> &soln_grad_int,
   632    std::array<real,nstate> &soln_bc,
   633    std::array<dealii::Tensor<1,dim,real>,nstate> &soln_grad_bc)
 const   636     const real dynamic_viscosity_coefficient_bc = this->
navier_stokes_physics->viscosity_coefficient_inf;
   637     const real kinematic_viscosity_coefficient_bc = dynamic_viscosity_coefficient_bc/density_bc;
   639         soln_bc[istate] = density_bc*3.0*kinematic_viscosity_coefficient_bc;
   640         soln_grad_bc[istate] = soln_grad_int[istate];
   644 template <
int dim, 
int nstate, 
typename real>
   647    std::array<real,nstate> &soln_bc)
 const   650    const real dynamic_viscosity_coefficient_bc = this->
navier_stokes_physics->viscosity_coefficient_inf;
   651    const real kinematic_viscosity_coefficient_bc = dynamic_viscosity_coefficient_bc/density_bc;
   656       soln_bc[istate] = density_bc*3.0*kinematic_viscosity_coefficient_bc;
   660 template <
int dim, 
int nstate, 
typename real>
   663     const dealii::Vector<double>              &uh,
   664     const std::vector<dealii::Tensor<1,dim> > &duh,
   665     const std::vector<dealii::Tensor<2,dim> > &dduh,
   666     const dealii::Tensor<1,dim>               &normals,
   667     const dealii::Point<dim>                  &evaluation_points)
 const   671     unsigned int current_data_index = computed_quantities.size() - 1;
   672     computed_quantities.grow_or_shrink(names.size());
   673     if constexpr (std::is_same<real,double>::value) {
   675         std::array<double, nstate> conservative_soln;
   676         for (
unsigned int s=0; s<nstate; ++s) {
   677             conservative_soln[s] = uh(s);
   682         computed_quantities(++current_data_index) = primitive_soln_turbulence_model[0];
   684     if (computed_quantities.size()-1 != current_data_index) {
   685         std::cout << 
" Did not assign a value to all the data. Missing " << computed_quantities.size() - current_data_index << 
" variables."   686                   << 
" If you added a new output variable, make sure the names and DataComponentInterpretation match the above. "   690     return computed_quantities;
   693 template <
int dim, 
int nstate, 
typename real>
   697     namespace DCI = dealii::DataComponentInterpretation;
   699     interpretation.push_back (DCI::component_is_scalar); 
   702     if (names.size() != interpretation.size()) {
   703         std::cout << 
"Number of DataComponentInterpretation is not the same as number of names for output file" << std::endl;
   705     return interpretation;
   708 template <
int dim, 
int nstate, 
typename real>
   713     names.push_back (
"nu_tilde");
 static const int nstate_navier_stokes
Number of PDEs for RANS equations. 
std::array< real, nstate-(dim+2)> compute_effective_viscosity_turbulence_model(const std::array< real, nstate_navier_stokes > &primitive_soln_rans, const std::array< real, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized effective (total) viscosities for the negative SA model. 
virtual std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > post_get_data_component_interpretation() const
Returns DataComponentInterpretation of the solution to be used by PhysicsPostprocessor to output curr...
real compute_s_bar(const real coefficient_Chi, const real nu_tilde, const real d_wall) const
Correction of vorticity magnitude for the negative SA model. 
std::array< real2, nstate-(dim+2)> convert_conservative_to_primitive_turbulence_model(const std::array< real2, nstate > &conservative_soln) const
real2 scale_coefficient(const real2 coefficient) const
Templated nondimensionalized variables scaled by reynolds_number_inf for the negative SA model...
real2 compute_coefficient_f_v1(const real2 coefficient_Chi) const
Templated coefficient f_v1 for the negative SA model. 
Negative Spalart-Allmaras model. Derived from Reynolds Averaged Navier Stokes. 
void boundary_inflow(const std::array< real, nstate > &soln_int, const std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_int, std::array< real, nstate > &soln_bc, std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_bc) const override
Inflow boundary condition. 
Sacado::Fad::DFad< double > FadType
Sacado AD type for first derivatives. 
real compute_coefficient_r(const real nu_tilde, const real d_wall, const real s_tilde) const
Coefficient r for the negative SA model. 
real compute_coefficient_g(const real coefficient_r) const
Coefficient g for the negative SA model. 
Manufactured solution used for grid studies to check convergence orders. 
FadType compute_eddy_viscosity_fad(const std::array< FadType, nstate_navier_stokes > &primitive_soln_rans, const std::array< FadType, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized eddy viscosity for the negative SA model (Automatic Differentiation Type: FadType)...
static const int nstate_turbulence_model
Number of PDEs for RANS turbulence model. 
dealii::Tensor< 1, dim, real > compute_Reynolds_heat_flux(const std::array< real, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, real >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< real, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized Reynolds heat flux, (q^reynolds)*, for the negative SA model. 
Files for the baseline physics. 
dealii::Tensor< 2, dim, real2 > compute_Reynolds_stress_tensor_templated(const std::array< real2, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, real2 >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< real2, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Templated nondimensionalized Reynolds stress tensor, (tau^reynolds)* for the negative SA model...
std::vector< dealii::DataComponentInterpretation::DataComponentInterpretation > post_get_data_component_interpretation() const override
For post processing purposes, sets the interpretation of each computed quantity as either scalar or v...
real2 compute_coefficient_Chi(const real2 nu_tilde, const real2 laminar_kinematic_viscosity) const
Templated coefficient Chi for the negative SA model. 
std::array< real2, nstate-(dim+2)> compute_effective_viscosity_turbulence_model_templated(const std::array< real2, nstate_navier_stokes > &primitive_soln_rans, const std::array< real2, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Templated nondimensionalized effective (total) viscosities for the negative SA model. 
Main parameter class that contains the various other sub-parameter classes. 
dealii::Tensor< 2, dim, real > compute_Reynolds_stress_tensor(const std::array< real, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, real >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< real, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized Reynolds stress tensor, (tau^reynolds)*, for the negative SA model. 
real compute_s(const std::array< real, nstate_navier_stokes > &conservative_soln_rans, const std::array< dealii::Tensor< 1, dim, real >, nstate_navier_stokes > &conservative_soln_gradient_rans) const
Vorticity magnitude for the negative SA model, sqrt(vorticity_x^2+vorticity_y^2+vorticity_z^2) ...
const real c_b1
Constant coefficients for the negative SA model. 
real compute_coefficient_f_v2(const real coefficient_Chi) const
Coefficient f_v2 for the negative SA model. 
std::array< dealii::Tensor< 1, dim, real2 >, dim+2 > extract_rans_solution_gradient(const std::array< dealii::Tensor< 1, dim, real2 >, nstate > &solution_gradient) const
Returns the conservative solutions gradient of Reynolds-averaged Navier-Stokes equations (without add...
real compute_eddy_viscosity(const std::array< real, nstate_navier_stokes > &primitive_soln_rans, const std::array< real, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized eddy viscosity for the negative SA model. 
std::array< real, nstate > compute_production_source(const real coefficient_f_t2, const real density, const real nu_tilde, const real s, const real s_tilde) const
Production source term for the negative SA model. 
TwoPointNumericalFlux
Two point numerical flux type for split form. 
std::vector< std::string > post_get_names() const override
For post processing purposes, sets the base names (with no prefix or suffix) of the computed quantiti...
void boundary_wall(std::array< real, nstate > &soln_bc, std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_bc) const override
Wall boundary condition. 
std::unique_ptr< NavierStokes< dim, nstate_navier_stokes, real > > navier_stokes_physics
Pointer to Navier-Stokes physics object. 
std::array< FadType, nstate-(dim+2)> compute_effective_viscosity_turbulence_model_fad(const std::array< FadType, nstate_navier_stokes > &primitive_soln_rans, const std::array< FadType, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized effective (total) viscosities for the negative SA model (Automatic Differentiation...
Reynolds-Averaged Navier-Stokes (RANS) equations. Derived from Navier-Stokes for modifying the stress...
real compute_coefficient_f_t2(const real coefficient_Chi) const
Coefficient f_t2 for the negative SA model. 
ReynoldsAveragedNavierStokes_SAneg(const Parameters::AllParameters *const parameters_input, const double ref_length, const double gamma_gas, const double mach_inf, const double angle_of_attack, const double side_slip_angle, const double prandtl_number, const double reynolds_number_inf, const bool use_constant_viscosity, const double constant_viscosity, const double turbulent_prandtl_number, const double temperature_inf=273.15, const double isothermal_wall_temperature=1.0, const thermal_boundary_condition_enum thermal_boundary_condition_type=thermal_boundary_condition_enum::adiabatic, std::shared_ptr< ManufacturedSolutionFunction< dim, real > > manufactured_solution_function=nullptr, const two_point_num_flux_enum two_point_num_flux_type=two_point_num_flux_enum::KG)
std::array< real, nstate > compute_production_dissipation_cross_term(const dealii::Point< dim, real > &pos, const std::array< real, nstate > &conservative_solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient) const
Physical source term (production, dissipation source terms and source term with cross derivatives) fo...
real2 compute_coefficient_f_n(const real2 nu_tilde, const real2 laminar_kinematic_viscosity) const
Templated coefficient f_n for the negative SA model. 
dealii::Tensor< 1, dim, real2 > compute_Reynolds_heat_flux_templated(const std::array< real2, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, real2 >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< real2, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Templated nondimensionalized Reynolds heat flux, (q^reynolds)* for the negative SA model...
std::array< real, nstate > compute_dissipation_source(const real coefficient_f_t2, const real density, const real nu_tilde, const real d_wall, const real s_tilde) const
Dissipation source term for the negative SA model. 
real compute_s_tilde(const real coefficient_Chi, const real nu_tilde, const real d_wall, const real s) const
Modified vorticity magnitude for the negative SA model. 
real compute_coefficient_f_w(const real coefficient_g) const
Coefficient f_t2 for the negative SA model. 
const double turbulent_prandtl_number
Turbulent Prandtl number. 
real2 get_vector_magnitude_sqr(const dealii::Tensor< 1, 3, real2 > &vector) const
Returns the square of the magnitude of the vector. 
real2 compute_eddy_viscosity_templated(const std::array< real2, nstate_navier_stokes > &primitive_soln_rans, const std::array< real2, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Templated nondimensionalized eddy viscosity for the negative SA model. 
void boundary_farfield(std::array< real, nstate > &soln_bc) const override
Farfield boundary conditions based on freestream values. 
std::array< real, nstate > compute_cross_source(const real density, const real nu_tilde, const real laminar_kinematic_viscosity, const std::array< dealii::Tensor< 1, dim, real >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< dealii::Tensor< 1, dim, real >, nstate_turbulence_model > &primitive_solution_gradient_turbulence_model) const
Source term with cross derivatives for the negative SA model. 
void boundary_outflow(const std::array< real, nstate > &soln_int, const std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_int, std::array< real, nstate > &soln_bc, std::array< dealii::Tensor< 1, dim, real >, nstate > &soln_grad_bc) const override
Outflow boundary condition. 
dealii::Tensor< 1, dim, FadType > compute_Reynolds_heat_flux_fad(const std::array< FadType, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, FadType >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< FadType, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized Reynolds heat flux, (q^reynolds)* (Automatic Differentiation Type: FadType)...
ThermalBoundaryCondition
Types of thermal boundary conditions available. 
virtual dealii::Vector< double > post_compute_derived_quantities_vector(const dealii::Vector< double > &uh, const std::vector< dealii::Tensor< 1, dim > > &, const std::vector< dealii::Tensor< 2, dim > > &, const dealii::Tensor< 1, dim > &, const dealii::Point< dim > &) const
Returns current vector solution to be used by PhysicsPostprocessor to output current solution...
std::array< dealii::Tensor< 1, dim, real2 >, nstate-(dim+2)> convert_conservative_gradient_to_primitive_gradient_turbulence_model(const std::array< real2, nstate > &conservative_soln, const std::array< dealii::Tensor< 1, dim, real2 >, nstate > &solution_gradient) const
std::array< real2, dim+2 > extract_rans_conservative_solution(const std::array< real2, nstate > &conservative_soln) const
Returns the conservative solutions of Reynolds-averaged Navier-Stokes equations (without additional R...
virtual std::vector< std::string > post_get_names() const
Returns names of the solution to be used by PhysicsPostprocessor to output current solution...
dealii::Tensor< 2, dim, FadType > compute_Reynolds_stress_tensor_fad(const std::array< FadType, nstate_navier_stokes > &primitive_soln_rans, const std::array< dealii::Tensor< 1, dim, FadType >, nstate_navier_stokes > &primitive_soln_gradient_rans, const std::array< FadType, nstate_turbulence_model > &primitive_soln_turbulence_model) const
Nondimensionalized Reynolds stress tensor, (tau^reynolds)* (Automatic Differentiation Type: FadType)...
std::array< real, nstate > physical_source_term(const dealii::Point< dim, real > &pos, const std::array< real, nstate > &conservative_solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const dealii::types::global_dof_index cell_index) const override
Physical source term. 
dealii::Vector< double > post_compute_derived_quantities_vector(const dealii::Vector< double > &uh, const std::vector< dealii::Tensor< 1, dim > > &, const std::vector< dealii::Tensor< 2, dim > > &, const dealii::Tensor< 1, dim > &, const dealii::Point< dim > &) const override
For post processing purposes, returns conservative and primitive solution variables for the negative ...