[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
channel_flow.h
1 #ifndef __CHANNEL_FLOW_H__
2 #define __CHANNEL_FLOW_H__
3 
4 #include "periodic_turbulence.h"
5 #include "dg/dg_base.hpp"
6 
7 namespace PHiLiP {
8 namespace FlowSolver {
9 
10 #if PHILIP_DIM==1
11 using Triangulation = dealii::Triangulation<PHILIP_DIM>;
12 #else
13 using Triangulation = dealii::parallel::distributed::Triangulation<PHILIP_DIM>;
14 #endif
15 
16 template <int dim, int nspecies, int nstate>
17 class ChannelFlow : public PeriodicTurbulence<dim,nspecies,nstate>
18 {
19 public:
21  ChannelFlow(const Parameters::AllParameters *const parameters_input);
22 
25 
27  std::shared_ptr<Triangulation> generate_grid() const override;
28 
30  void set_higher_order_grid(std::shared_ptr <DGBase<dim, nspecies, double>> dg) const override;
31 
32 protected:
33  const double channel_height;
34  const double half_channel_height;
39  const double pi_val;
40  const double domain_length_x;
41  const double domain_length_y;
42  const double domain_length_z;
43  const double domain_volume;
44 
53 
62 
64 
67 
69  void display_grid_parameters() const override;
70 
72  std::vector<double> get_mesh_step_size_y_direction() const;
73 
77  std::vector<double> get_mesh_step_size_y_direction_HOPW() const;
78 
82  std::vector<double> get_mesh_step_size_y_direction_Gullbrand() const;
83 
87  std::vector<double> get_mesh_step_size_y_direction_carton_de_wiart_et_al() const;
88 
89  dealii::Tensor<2,dim,double> zero_tensor;
90 
92  std::shared_ptr< Physics::NavierStokes_ChannelFlowConstantSourceTerm_WallModel<dim,nspecies,dim+2,double> > navier_stokes_channel_flow_constant_source_term_wall_model_physics;
93 
94 public:
96  double get_adaptive_time_step(std::shared_ptr<DGBase<dim,nspecies,double>> dg) const override;
97 
99  double get_adaptive_time_step_initial(std::shared_ptr<DGBase<dim,nspecies,double>> dg) override;
100 
103  const std::shared_ptr <ODE::ODESolverBase<dim, nspecies, double>> ode_solver,
104  const std::shared_ptr <DGBase<dim, nspecies, double>> dg,
105  const std::shared_ptr<dealii::TableHandler> unsteady_data_table,
106  const bool do_write_unsteady_data_table_file) override;
107 
109  unsigned int get_number_of_degrees_of_freedom_per_state_from_poly_degree(const unsigned int poly_degree_input) const override;
110 
113 
116 
117  double get_bulk_density() const;
118  double get_bulk_velocity() const;
119  double get_bulk_mass_flow_rate() const;
120 
122  double get_skin_friction_coefficient_from_average_wall_shear_stress(const double avg_wall_shear_stress) const;
123 
126 private:
128  double get_stretched_mesh_size(const int i) const;
129 
130  double bulk_density;
132  double bulk_velocity;
133 };
134 
135 } // FlowSolver namespace
136 } // PHiLiP namespace
137 #endif
double get_adaptive_time_step_initial(std::shared_ptr< DGBase< dim, nspecies, double >> dg) override
Function to compute the initial adaptive time step.
const double half_channel_height
Half channel height.
Definition: channel_flow.h:34
const double channel_height
Channel height.
Definition: channel_flow.h:33
double bulk_density
Bulk density.
Definition: channel_flow.h:130
const double channel_bulk_velocity_reynolds_number
Definition: channel_flow.h:52
double get_skin_friction_coefficient_from_average_wall_shear_stress(const double avg_wall_shear_stress) const
Get the skin friction coefficient from the average wall shear stress.
double get_bulk_velocity() const
Getter for the bulk velocity.
const double domain_length_x
Domain length in x-direction.
Definition: channel_flow.h:40
std::shared_ptr< Physics::NavierStokes_ChannelFlowConstantSourceTerm_WallModel< dim, nspecies, dim+2, double > > navier_stokes_channel_flow_constant_source_term_wall_model_physics
Pointer to Navier-Stokes physics object for computing things on the fly.
Definition: channel_flow.h:92
std::shared_ptr< Triangulation > generate_grid() const override
Function to generate the grid.
const double domain_length_y
Domain length in y-direction.
Definition: channel_flow.h:41
Files for the baseline physics.
Definition: ADTypes.hpp:10
const double pi_val
Value of pi.
Definition: channel_flow.h:39
Base class ODE solver.
double get_average_wall_shear_stress_from_wall_model(DGBase< dim, nspecies, double > &dg) const
Get the average wall shear stress from wall model.
ChannelFlow(const Parameters::AllParameters *const parameters_input)
Constructor.
unsigned int get_number_of_degrees_of_freedom_per_state_from_poly_degree(const unsigned int poly_degree_input) const override
Get the number of degrees of freedom per state from a given poly degree.
void display_grid_parameters() const override
Display grid parameters.
double bulk_velocity
Bulk velocity.
Definition: channel_flow.h:132
double get_adaptive_time_step(std::shared_ptr< DGBase< dim, nspecies, double >> dg) const override
Function to compute the adaptive time step.
Main parameter class that contains the various other sub-parameter classes.
double get_stretched_mesh_size(const int i) const
Get the stretched mesh size.
const double domain_length_z
Domain length in z-direction.
Definition: channel_flow.h:42
const double domain_volume
Domain volume.
Definition: channel_flow.h:43
const int number_of_cells_y_direction
Number of cells in y-direction.
Definition: channel_flow.h:37
double get_bulk_mass_flow_rate() const
Getter for the bulk mass flow rate.
double get_bulk_density() const
Getter for the bulk density.
const int number_of_cells_z_direction
Number of cells in z-direction.
Definition: channel_flow.h:38
dealii::Tensor< 2, dim, double > zero_tensor
Tensor of zeros.
Definition: channel_flow.h:89
std::vector< double > get_mesh_step_size_y_direction_HOPW() const
const int number_of_cells_x_direction
Number of cells in x-direction.
Definition: channel_flow.h:36
double get_average_wall_shear_stress(DGBase< dim, nspecies, double > &dg) const
Get the average wall shear stress.
double minimum_approximate_grid_spacing
Minimum approximate grid spacing.
Definition: channel_flow.h:63
void set_bulk_flow_quantities(DGBase< dim, nspecies, double > &dg)
Set the bulk flow quantities.
std::vector< double > get_mesh_step_size_y_direction_Gullbrand() const
std::vector< double > get_mesh_step_size_y_direction_carton_de_wiart_et_al() const
void set_higher_order_grid(std::shared_ptr< DGBase< dim, nspecies, double >> dg) const override
Function to set the higher order grid.
const double channel_friction_velocity_reynolds_number
Channel Reynolds number based on wall friction velocity.
Definition: channel_flow.h:35
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
std::vector< double > get_mesh_step_size_y_direction() const
Return a vector of mesh step sizes in the y-direction based on the desired stretching function...
void display_additional_flow_case_specific_parameters() const override
Display additional more specific flow case parameters.
double bulk_mass_flow_rate
Bulk mass flow rate.
Definition: channel_flow.h:131
void compute_unsteady_data_and_write_to_table(const std::shared_ptr< ODE::ODESolverBase< dim, nspecies, double >> ode_solver, const std::shared_ptr< DGBase< dim, nspecies, double >> dg, const std::shared_ptr< dealii::TableHandler > unsteady_data_table, const bool do_write_unsteady_data_table_file) override
Compute the desired unsteady data and write it to a table.
const double channel_centerline_velocity_reynolds_number
Definition: channel_flow.h:61