7 #include "navier_stokes_model.h" 15 template <
int dim,
int nspecies,
int nstate,
typename real>
18 const double ref_length,
19 const double gamma_gas,
20 const double mach_inf,
21 const double angle_of_attack,
22 const double side_slip_angle,
23 const double prandtl_number,
24 const double reynolds_number_inf,
25 const bool use_constant_viscosity,
26 const double constant_viscosity,
27 const double temperature_inf,
28 const double relaxation_coefficient,
29 const double isothermal_wall_temperature,
33 :
ModelBase<dim,nspecies,nstate,real>(manufactured_solution_function)
34 , relaxation_coefficient(relaxation_coefficient)
35 , navier_stokes_physics(
std::make_unique <
NavierStokes<dim,nspecies,nstate,real> > (
44 use_constant_viscosity,
47 isothermal_wall_temperature,
48 thermal_boundary_condition_type,
49 manufactured_solution_function,
50 two_point_num_flux_type))
52 static_assert(nstate==dim+2,
"ModelBase::NavierStokesWithModelSourceTerms() should be created with nstate=dim+2");
54 for (
int s=0; s<nstate; ++s) {
56 for (
int d=0; d<dim; ++d) {
62 template <
int dim,
int nspecies,
int nstate,
typename real>
65 const std::array<real,nstate> &)
const 70 template <
int dim,
int nspecies,
int nstate,
typename real>
73 const std::array<real,nstate> &,
74 const std::array<dealii::Tensor<1,dim,real>,nstate> &,
75 const dealii::types::global_dof_index )
const 80 template <
int dim,
int nspecies,
int nstate,
typename real>
83 const std::array<real,nstate> &,
84 const std::array<dealii::Tensor<1,dim,real>,nstate> &,
85 const std::array<real,nstate> &,
86 const std::array<dealii::Tensor<1,dim,real>,nstate> &,
88 const dealii::types::global_dof_index ,
89 const dealii::Tensor<1,dim,real> &,
93 dissipative_flux_dot_normal.fill(0.0);
98 template <
int dim,
int nspecies,
int nstate,
typename real>
101 const std::array<real,nstate> &,
102 const dealii::Tensor<1,dim,real> &)
const 107 template <
int dim,
int nspecies,
int nstate,
typename real>
111 const real max_eig = 0.0;
115 template <
int dim,
int nspecies,
int nstate,
typename real>
118 const std::array<real,nstate> &,
119 const dealii::Tensor<1,dim,real> &)
const 121 const real max_eig = 0.0;
125 template <
int dim,
int nspecies,
int nstate,
typename real>
128 const dealii::Point<dim,real> &,
129 const std::array<real,nstate> &,
131 const dealii::types::global_dof_index )
const 136 template <
int dim,
int nspecies,
int nstate,
typename real>
139 const dealii::Point<dim,real> &,
140 const std::array<real,nstate> &conservative_soln,
141 const std::array<dealii::Tensor<1,dim,real>,nstate> &,
142 const dealii::types::global_dof_index )
const 144 std::array<real,nstate> physical_source;
147 return physical_source;
150 template <
int dim,
int nspecies,
int nstate,
typename real>
153 const std::array<real,nstate> &)
const 156 std::fill(source_term.begin(), source_term.end(), 0.0);
163 std::cout <<
"ERROR: Cannot run the turbulent channel flow with a non-constant viscosity. Aborting..." << std::endl;
169 const real scaled_viscosity_coefficient = this->
navier_stokes_physics->scale_viscosity_coefficient(viscosity_coefficient);
170 const real expected_mass_flow_rate = scaled_viscosity_coefficient * bulk_reynolds_number / this->
half_channel_height;
Manufactured solution used for grid studies to check convergence orders.
std::array< real, nstate > dissipative_flux_dot_normal(const std::array< real, nstate > &solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const std::array< real, nstate > &filtered_solution, const std::array< dealii::Tensor< 1, dim, real >, nstate > &filtered_solution_gradient, const bool on_boundary, const dealii::types::global_dof_index cell_index, const dealii::Tensor< 1, dim, real > &normal, const int boundary_type) const
Dissipative (i.e. viscous) flux: dot normal vector.
double domain_volume
Domain volume, needed for channel flow case.
Files for the baseline physics.
std::array< real, nstate > source_term(const dealii::Point< dim, real > &pos, const std::array< real, nstate > &solution, const real current_time, const dealii::types::global_dof_index cell_index) const
Source term for manufactured solution functions.
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.
Physics model additional terms and equations to the baseline physics.
double bulk_velocity
Bulk velocity, needed for channel flow case.
double half_channel_height
Half channel height, needed for channel flow case.
std::array< real, nstate > convective_eigenvalues(const std::array< real, nstate > &, const dealii::Tensor< 1, dim, real > &) const override
Convective eigenvalues of the additional models' PDEs.
Main parameter class that contains the various other sub-parameter classes.
std::array< real, nstate > channel_flow_source_term(const std::array< real, nstate > &conservative_soln) const
Channel flow source term.
double resultant_wall_shear_force
Resultant wall shear force, needed for channel flow case.
TwoPointNumericalFlux
Two point numerical flux type for split form.
std::array< dealii::Tensor< 1, dim, real >, nstate > dissipative_flux(const std::array< real, nstate > &conservative_soln, const std::array< dealii::Tensor< 1, dim, real >, nstate > &solution_gradient, const dealii::types::global_dof_index cell_index) const
Dissipative (i.e. viscous) flux: .
double time_step
Current time step.
std::unique_ptr< NavierStokes< dim, nspecies, nstate, real > > navier_stokes_physics
Pointer to Navier-Stokes physics object.
std::array< dealii::Tensor< 1, dim, real >, nstate > zero_tensor_array
Tensor array of zeros.
const double relaxation_coefficient
Relaxation coefficient for the channel flow source term.
Navier Stokes equations with model source term.
std::array< real, nstate > zero_array
Array of zeros.
real max_convective_normal_eigenvalue(const std::array< real, nstate > &soln, const dealii::Tensor< 1, dim, real > &normal) const
Maximum convective normal eigenvalue (used in Lax-Friedrichs) of the additional models' PDEs...
ThermalBoundaryCondition
Types of thermal boundary conditions available.
std::array< dealii::Tensor< 1, dim, real >, nstate > convective_flux(const std::array< real, nstate > &conservative_soln) const
Convective flux: .
double bulk_mass_flow_rate
Bulk mass flow rate, needed for channel flow case.
Navier-Stokes equations. Derived from Euler for the convective terms, which is derived from PhysicsBa...
NavierStokesWithModelSourceTerms(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 temperature_inf, const double relaxation_coefficient, 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, nspecies, real > > manufactured_solution_function=nullptr, const two_point_num_flux_enum two_point_num_flux_type=two_point_num_flux_enum::KG)
Constructor.
real max_convective_eigenvalue(const std::array< real, nstate > &soln) const
Maximum convective eigenvalue of the additional models' PDEs.