[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
parameters_physics_model.cpp
1 #include "parameters/parameters_physics_model.h"
2 
3 namespace PHiLiP {
4 namespace Parameters {
5 
6 void PhysicsModelParam::declare_parameters (dealii::ParameterHandler &prm)
7 {
8  prm.enter_subsection("physics_model");
9  {
10  prm.declare_entry("euler_turbulence","false",
11  dealii::Patterns::Bool(),
12  "Set as false by default (i.e. Navier-Stokes is the baseline physics). "
13  "If true, sets the baseline physics to the Euler equations.");
14 
15  prm.enter_subsection("large_eddy_simulation");
16  {
17  prm.declare_entry("SGS_model_type", "smagorinsky",
18  dealii::Patterns::Selection(
19  " smagorinsky | "
20  " wall_adaptive_local_eddy_viscosity | "
21  " vreman | "
22  " shear_improved_smagorinsky | "
23  " dynamic_smagorinsky | "
24  " small_small_variational_multiscale | "
25  " all_all_variational_multiscale "),
26  "Enum of sub-grid scale models."
27  "Choices are "
28  " <smagorinsky | "
29  " wall_adaptive_local_eddy_viscosity | "
30  " vreman | "
31  " shear_improved_smagorinsky | "
32  " dynamic_smagorinsky | "
33  " small_small_variational_multiscale | "
34  " all_all_variational_multiscale>.");
35 
36  prm.declare_entry("turbulent_prandtl_number", "0.6",
37  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
38  "Turbulent Prandlt number (default is 0.6)");
39 
40  prm.declare_entry("smagorinsky_model_constant", "0.1",
41  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
42  "Smagorinsky model constant (default is 0.1)");
43 
44  prm.declare_entry("WALE_model_constant", "0.325",
45  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
46  "WALE (Wall-Adapting Local Eddy-viscosity) eddy viscosity model constant (default is 0.325)");
47 
48  prm.declare_entry("vreman_model_constant", "0.025",
49  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
50  "Vreman eddy viscosity model constant (default is 0.025)");
51 
52  prm.declare_entry("ratio_of_filter_width_to_cell_size", "1.0",
53  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
54  "Ratio of the large eddy simulation filter width to the cell size (default is 1)");
55 
56  prm.declare_entry("do_compute_filtered_solution", "false",
57  dealii::Patterns::Bool(),
58  "Flag to compute the filtered solution. By default, false.");
59 
60  prm.declare_entry("apply_modal_high_pass_filter_on_filtered_solution", "false",
61  dealii::Patterns::Bool(),
62  "Flag to apply a modal high pass filter the filtered solution. By default, false.");
63 
64  prm.declare_entry("poly_degree_max_large_scales", "0",
65  dealii::Patterns::Integer(0, dealii::Patterns::Integer::max_int_value),
66  "Used for variational-multiscale (VMS) filtering of the solution. "
67  "This represents the maximum polynomial order for the large scales. "
68  "Warning: This must be less than the poly_degree of the solution.");
69 
70  prm.declare_entry("dynamic_smagorinsky_model_constant_clipping_limit", "0.01",
71  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
72  "Clipping limit for the Dynamic Smagorinsky model constant (default is 0.01).");
73 
74  prm.declare_entry("apply_low_reynolds_number_eddy_viscosity_correction", "false",
75  dealii::Patterns::Bool(),
76  "Flag for applying the low Reynolds number eddy viscosity correction. By default, false.");
77 
78  }
79  prm.leave_subsection();
80 
81  prm.enter_subsection("reynolds_averaged_navier_stokes");
82  {
83  prm.declare_entry("euler_turbulence","false",
84  dealii::Patterns::Bool(),
85  "Set as false by default (i.e. Navier-Stokes is the baseline physics). "
86  "If true, sets the baseline physics to the Euler equations.");
87 
88  prm.declare_entry("RANS_model_type", "SA_negative",
89  dealii::Patterns::Selection(
90  " SA_negative "),
91  "Enum of reynolds_averaged_navier_stokes models."
92  "Choices are "
93  " <SA_negative>");
94 
95  prm.declare_entry("turbulent_prandtl_number", "0.6",
96  dealii::Patterns::Double(1e-15, dealii::Patterns::Double::max_double_value),
97  "Turbulent Prandlt number (default is 0.6)");
98 
99  }
100  prm.leave_subsection();
101  }
102  prm.leave_subsection();
103 }
104 
105 void PhysicsModelParam::parse_parameters (dealii::ParameterHandler &prm)
106 {
107  prm.enter_subsection("physics_model");
108  {
109  euler_turbulence = prm.get_bool("euler_turbulence");
110 
111  prm.enter_subsection("large_eddy_simulation");
112  {
113  const std::string SGS_model_type_string = prm.get("SGS_model_type");
114  if(SGS_model_type_string == "smagorinsky") SGS_model_type = smagorinsky;
115  if(SGS_model_type_string == "wall_adaptive_local_eddy_viscosity") SGS_model_type = wall_adaptive_local_eddy_viscosity;
116  if(SGS_model_type_string == "vreman") SGS_model_type = vreman;
117  if(SGS_model_type_string == "shear_improved_smagorinsky") SGS_model_type = shear_improved_smagorinsky;
118  if(SGS_model_type_string == "dynamic_smagorinsky") SGS_model_type = dynamic_smagorinsky;
119  if(SGS_model_type_string == "small_small_variational_multiscale") SGS_model_type = small_small_variational_multiscale;
120  if(SGS_model_type_string == "all_all_variational_multiscale") SGS_model_type = all_all_variational_multiscale;
121 
122  turbulent_prandtl_number = prm.get_double("turbulent_prandtl_number");
123  smagorinsky_model_constant = prm.get_double("smagorinsky_model_constant");
124  WALE_model_constant = prm.get_double("WALE_model_constant");
125  vreman_model_constant = prm.get_double("vreman_model_constant");
126  ratio_of_filter_width_to_cell_size = prm.get_double("ratio_of_filter_width_to_cell_size");
127  do_compute_filtered_solution = prm.get_bool("do_compute_filtered_solution");
129  = prm.get_bool("apply_modal_high_pass_filter_on_filtered_solution");
130  poly_degree_max_large_scales = prm.get_integer("poly_degree_max_large_scales");
132  = prm.get_double("dynamic_smagorinsky_model_constant_clipping_limit");
134  = prm.get_bool("apply_low_reynolds_number_eddy_viscosity_correction");
135  }
136  prm.leave_subsection();
137 
138  prm.enter_subsection("reynolds_averaged_navier_stokes");
139  {
140  euler_turbulence = prm.get_bool("euler_turbulence");
141 
142  const std::string RANS_model_type_string = prm.get("RANS_model_type");
143  if(RANS_model_type_string == "SA_negative") RANS_model_type = SA_negative;
144 
145  turbulent_prandtl_number = prm.get_double("turbulent_prandtl_number");
146  }
147  prm.leave_subsection();
148  }
149  prm.leave_subsection();
150 }
151 
152 } // Parameters namespace
153 } // PHiLiP namespace
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Files for the baseline physics.
Definition: ADTypes.hpp:10
bool do_compute_filtered_solution
Flag to compute the filtered solution.
bool apply_low_reynolds_number_eddy_viscosity_correction
Flag for applying the low Reynolds number eddy viscosity correction.
SubGridScaleModel SGS_model_type
Store the SubGridScale (SGS) model type.
double smagorinsky_model_constant
Eddy-viscosity model constants:
bool apply_modal_high_pass_filter_on_filtered_solution
Flag to apply modal high pass filter on the filtered solution.
unsigned int poly_degree_max_large_scales
Max poly degree representing the large scales for LES VMS filtering.
double vreman_model_constant
Vreman eddy viscosity model constant.
ReynoldsAveragedNavierStokesModel RANS_model_type
Store the Reynolds-averaged Navier-Stokes (RANS) model type.
double turbulent_prandtl_number
Turbulent flow characteristics:
double dynamic_smagorinsky_model_constant_clipping_limit
Clipping limit for the Dynamic Smagorinsky model constant.
double ratio_of_filter_width_to_cell_size
Ratio of the large eddy simulation filter width to the cell size.
double WALE_model_constant
WALE (Wall-Adapting Local Eddy-viscosity) eddy viscosity model constant.