[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
periodic_turbulence.h
1 #ifndef __PERIODIC_TURBULENCE_H__
2 #define __PERIODIC_TURBULENCE_H__
3 
4 #include <deal.II/base/table.h>
5 
6 #include "dg/dg_base.hpp"
7 #include "periodic_cube_flow.h"
8 #include "physics/navier_stokes.h"
9 
10 namespace PHiLiP {
11 namespace FlowSolver {
12 
13 template <int dim, int nstate>
14 class PeriodicTurbulence : public PeriodicCubeFlow<dim,nstate>
15 {
19  static const int NUMBER_OF_INTEGRATED_QUANTITIES = 5;
20 public:
22  explicit PeriodicTurbulence(const Parameters::AllParameters *const parameters_input);
23 
28 
34  double get_integrated_kinetic_energy() const;
35 
41  double get_integrated_enstrophy() const;
42 
50 
57 
64 
71 
74  std::shared_ptr<DGBase<dim,double>> dg,
75  const unsigned int output_file_index,
76  const double current_time) const;
77 
80  const std::shared_ptr <DGBase<dim, double>> dg) const;
81 
84  const double FR_entropy_contribution_RRK_solver,
85  const unsigned int current_iteration,
86  const std::shared_ptr <DGBase<dim, double>> dg);
87 
89  double get_numerical_entropy(const std::shared_ptr <DGBase<dim, double>> /*dg*/) const;
90 
91 protected:
94 
97 
100 
103 
106 
108 
110  std::shared_ptr< Physics::NavierStokes<dim,dim+2,double> > navier_stokes_physics;
111 
112  bool is_taylor_green_vortex = false;
114  bool is_viscous_flow = true;
116 
119 
121  double get_constant_time_step(std::shared_ptr<DGBase<dim,double>> dg) const override;
122 
125 
128 
131 
135  const std::shared_ptr<ODE::ODESolverBase<dim, double>> ode_solver,
136  const std::shared_ptr <DGBase<dim, double>> dg,
137  const std::shared_ptr<dealii::TableHandler> unsteady_data_table) override;
138 
141  kinetic_energy,
142  enstrophy,
143  pressure_dilatation,
144  deviatoric_strain_rate_tensor_magnitude_sqr,
145  strain_rate_tensor_magnitude_sqr
146  };
148  std::array<double,NUMBER_OF_INTEGRATED_QUANTITIES> integrated_quantities;
149 
152 
155 
158 
161 
163  dealii::Table<1,double> output_velocity_field_times;
164 
167 
170 
172  std::shared_ptr<dealii::TableHandler> exact_output_times_of_velocity_field_files_table;
173 };
174 
175 } // FlowSolver namespace
176 } // PHiLiP namespace
177 #endif
const bool output_vorticity_magnitude_field_in_addition_to_velocity
Flag for outputting vorticity magnitude field in addition to velocity field at fixed times...
const bool output_solution_at_exact_fixed_times
Flag for outputting the solution at exact fixed times by decreasing the time step on the fly...
double get_deviatoric_strain_rate_tensor_based_dissipation_rate() const
unsigned int index_of_current_desired_time_to_output_velocity_field
Index of current desired time to output velocity field.
Files for the baseline physics.
Definition: ADTypes.hpp:10
void output_velocity_field(std::shared_ptr< DGBase< dim, double >> dg, const unsigned int output_file_index, const double current_time) const
Output the velocity field to file.
const std::string output_flow_field_files_directory_name
Directory for writting flow field files.
Base class ODE solver.
const std::string unsteady_data_table_filename_with_extension
Filename (with extension) for the unsteady data table.
double initial_numerical_entropy_abs
Numerical entropy at initial time.
double get_numerical_entropy(const std::shared_ptr< DGBase< dim, double >>) const
Retrieves cumulative_numerical_entropy_change_FRcorrected.
std::shared_ptr< dealii::TableHandler > exact_output_times_of_velocity_field_files_table
Data table storing the exact output times for the velocity field files.
double previous_numerical_entropy
Numerical entropy at previous timestep.
Main parameter class that contains the various other sub-parameter classes.
const bool output_velocity_field_at_fixed_times
Flag for outputting velocity field at fixed times.
bool do_calculate_numerical_entropy
Identifies if numerical entropy should be calculated; initialized as false.
void display_additional_flow_case_specific_parameters() const override
Display additional more specific flow case parameters.
PeriodicTurbulence(const Parameters::AllParameters *const parameters_input)
Constructor.
dealii::Table< 1, double > output_velocity_field_times
Times at which to output the velocity field.
bool is_viscous_flow
Identifies if viscous flow; initialized as true.
void compute_and_update_integrated_quantities(DGBase< dim, double > &dg)
double get_constant_time_step(std::shared_ptr< DGBase< dim, double >> dg) const override
Function to compute the constant time step.
const unsigned int number_of_times_to_output_velocity_field
Number of times to output the velocity field.
bool is_decaying_homogeneous_isotropic_turbulence
Identified if DHIT case; initialized as false.
void compute_unsteady_data_and_write_to_table(const std::shared_ptr< ODE::ODESolverBase< dim, double >> ode_solver, const std::shared_ptr< DGBase< dim, double >> dg, const std::shared_ptr< dealii::TableHandler > unsteady_data_table) override
Compute the desired unsteady data and write it to a table.
bool is_taylor_green_vortex
Identifies if taylor green vortex case; initialized as false.
double cumulative_numerical_entropy_change_FRcorrected
Cumulative change in numerical entropy.
double compute_current_integrated_numerical_entropy(const std::shared_ptr< DGBase< dim, double >> dg) const
Calculate numerical entropy by matrix-vector product.
std::shared_ptr< Physics::NavierStokes< dim, dim+2, double > > navier_stokes_physics
Pointer to Navier-Stokes physics object for computing things on the fly.
IntegratedQuantitiesEnum
List of possible integrated quantities over the domain.
double maximum_local_wave_speed
Maximum local wave speed (i.e. convective eigenvalue)
std::array< double, NUMBER_OF_INTEGRATED_QUANTITIES > integrated_quantities
Array for storing the integrated quantities; done for computational efficiency.
std::string flow_field_quantity_filename_prefix
Flow field quantity filename prefix.
DGBase is independent of the number of state variables.
Definition: dg_base.hpp:82
void update_numerical_entropy(const double FR_entropy_contribution_RRK_solver, const unsigned int current_iteration, const std::shared_ptr< DGBase< dim, double >> dg)
Update numerical entropy variables.