[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
all_parameters.cpp
1 #include <deal.II/base/mpi.h>
2 #include <deal.II/base/utilities.h>
3 #include <deal.II/base/patterns.h>
4 
5 #include "parameters/all_parameters.h"
6 
7 //for checking output directories
8 #include <sys/types.h>
9 #include <sys/stat.h>
10 
11 namespace PHiLiP {
12 namespace Parameters {
13 
15  : manufactured_convergence_study_param(ManufacturedConvergenceStudyParam())
16  , ode_solver_param(ODESolverParam())
17  , linear_solver_param(LinearSolverParam())
18  , euler_param(EulerParam())
19  , navier_stokes_param(NavierStokesParam())
20  , reduced_order_param(ReducedOrderModelParam())
21  , hyper_reduction_param(HyperReductionParam())
22  , burgers_param(BurgersParam())
23  , physics_model_param(PhysicsModelParam())
24  , grid_refinement_study_param(GridRefinementStudyParam())
25  , artificial_dissipation_param(ArtificialDissipationParam())
26  , limiter_param(LimiterParam())
27  , flow_solver_param(FlowSolverParam())
28  , mesh_adaptation_param(MeshAdaptationParam())
29  , functional_param(FunctionalParam())
30  , time_refinement_study_param(TimeRefinementStudyParam())
31  , pcout(std::cout, dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)==0)
32 { }
33 
34 void AllParameters::declare_parameters (dealii::ParameterHandler &prm)
35 {
36  const int mpi_rank = dealii::Utilities::MPI::this_mpi_process(MPI_COMM_WORLD);
37  dealii::ConditionalOStream pcout(std::cout, mpi_rank==0);
38  pcout << "Declaring inputs." << std::endl;
39  prm.declare_entry("dimension", "-1",
40  dealii::Patterns::Integer(),
41  "Number of dimensions");
42 
43  prm.declare_entry("number_of_species", "1",
44  dealii::Patterns::Integer(1, dealii::Patterns::Integer::max_int_value),
45  "Number of species. "
46  "Default number of species is 1. For number_of_species > 1, only real_gas pde_type can be used.");
47 
48  prm.declare_entry("run_type", "integration_test",
49  dealii::Patterns::Selection(
50  " integration_test | "
51  " flow_simulation"),
52  "Type of run (default is integration_test). "
53  "Choices are <integration_test | flow_simulation>.");
54 
55  prm.declare_entry("mesh_type", "default_triangulation",
56  dealii::Patterns::Selection(
57  " default_triangulation | "
58  " triangulation | "
59  " parallel_shared_triangulation | "
60  " parallel_distributed_triangulation"),
61  "Type of triangulation to be used."
62  "Note: parralel_distributed_triangulation not availible int 1D."
63  " <default_triangulation | "
64  " triangulation | "
65  " parallel_shared_triangulation |"
66  " parallel_distributed_triangulation>.");
67 
68  prm.declare_entry("overintegration", "0",
69  dealii::Patterns::Integer(),
70  "Number of extra quadrature points to use."
71  "If overintegration=0, then we use n_quad = soln_degree + 1.");
72 
73  prm.declare_entry("use_weak_form", "true",
74  dealii::Patterns::Bool(),
75  "Use weak form by default. If false, use strong form.");
76 
77  prm.declare_entry("flux_nodes_type", "GL",
78  dealii::Patterns::Selection(
79  "GL | GLL"),
80  "Flux nodes type, default is GL for uncollocated. NOTE: Solution nodes are type GLL."
81  "Choices are <GL | GLL>.");
82 
83  prm.declare_entry("use_split_form", "false",
84  dealii::Patterns::Bool(),
85  "Use original form by defualt. Otherwise, split the fluxes.");
86 
87  prm.declare_entry("two_point_num_flux_type", "KG",
88  dealii::Patterns::Selection(
89  "KG | IR | CH | Ra"),
90  "Two point flux type. "
91  "Choices for single species are <KG | IR | CH | Ra>."
92  "Multi-species only supports <KG>.");
93 
94  prm.declare_entry("use_curvilinear_split_form", "false",
95  dealii::Patterns::Bool(),
96  "Use original form by defualt. Otherwise, split the curvilinear fluxes.");
97 
98  prm.declare_entry("store_residual_cpu_time", "false",
99  dealii::Patterns::Bool(),
100  "Do not store the residual local processor cpu time by default. Store the residual cpu time if true.");
101 
102  prm.declare_entry("use_weight_adjusted_mass", "false",
103  dealii::Patterns::Bool(),
104  "Use original form by defualt. Otherwise, use the weight adjusted low storage mass matrix for curvilinear.");
105 
106  prm.declare_entry("all_boundaries_are_periodic", "false",
107  dealii::Patterns::Bool(),
108  "Flag to signal that all boundaries are periodic; if true surface flux nodes will not be stored for efficiency. "
109  "Default is false; hence surface flux nodes are indeed stored by default.");
110 
111  prm.declare_entry("check_same_coords_in_weak_dg", "true",
112  dealii::Patterns::Bool(),
113  "Flag to check if the coordinates of two points are same where expected in weak DG."
114  "Default is true; set to false if you have periodic boundaries in your domain since it currently does not consider that case and will print large warning messages.");
115 
116  prm.declare_entry("use_curvilinear_grid", "false",
117  dealii::Patterns::Bool(),
118  "Use straight grid by default. Curvilinear is true. Only used in taylor_green_scaling test.");
119 
120  prm.declare_entry("use_energy", "false",
121  dealii::Patterns::Bool(),
122  "Not calculate energy by default. Otherwise, get energy per iteration.");
123 
124  prm.declare_entry("use_L2_norm", "false",
125  dealii::Patterns::Bool(),
126  "Not calculate L2 norm by default (M+K). Otherwise, get L2 norm per iteration.");
127 
128  prm.declare_entry("flux_reconstruction", "cDG",
129  dealii::Patterns::Selection(
130  "cDG | cSD | cHU | cNegative | cNegative2 | cPlus | c10Thousand | cHULumped | user_specified_value"),
131  "Flux Reconstruction. "
132  "Choices are "
133  " <cDG | cSD | cHU | cNegative | cNegative2 | cPlus | c10Thousand | cHULumped | user_specified_value>.");
134 
135  prm.declare_entry("FR_user_specified_correction_parameter_value", "0.0",
136  dealii::Patterns::Double(-dealii::Patterns::Double::max_double_value, dealii::Patterns::Double::max_double_value),
137  "User specified flux recontruction correction parameter value. "
138  "Enter a 1D correction parameter. "
139  "Internally, the input c value is divided by 2 to account for the basis and adjusted for the deal.ii reference element. "
140  "Default value is 0.0. ");
141 
142  prm.declare_entry("flux_reconstruction_aux", "kDG",
143  dealii::Patterns::Selection(
144  "kDG | kSD | kHU | kNegative | kNegative2 | kPlus | k10Thousand"),
145  "Flux Reconstruction for Auxiliary Equation. "
146  "Choices are <kDG | kSD | kHU | kNegative | kNegative2 | kPlus | k10Thousand>.");
147 
148  prm.declare_entry("sipg_penalty_factor", "1.0",
149  dealii::Patterns::Double(1.0,1e200),
150  "Scaling of Symmetric Interior Penalty term to ensure coercivity.");
151 
152  prm.declare_entry("use_invariant_curl_form", "false",
153  dealii::Patterns::Bool(),
154  "Use conservative curl form for metric cofactor by default. If true, then use invariant curl form.");
155 
156  prm.declare_entry("use_inverse_mass_on_the_fly", "false",
157  dealii::Patterns::Bool(),
158  "Build global mass inverse matrix and apply it. Otherwise, use inverse mass on-the-fly by default for explicit timestepping.");
159 
160  prm.declare_entry("check_valid_metric_Jacobian", "true",
161  dealii::Patterns::Bool(),
162  "Check validty of metric Jacobian when high-order grid is constructed by default. Do not check if false. Not checking is useful if the metric terms are built on the fly with operators, it reduces the memory cost for high polynomial grids. The metric Jacobian is never checked for strong form, regardless of the user input.");
163 
164  prm.declare_entry("energy_file", "energy_file",
165  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
166  "Input file for energy test.");
167 
168  prm.declare_entry("test_type", "run_control",
169  dealii::Patterns::Selection(
170  " run_control | "
171  " grid_refinement_study | "
172  " stability_fr_parameter_range | "
173  " advection_limiter | "
174  " burgers_limiter | "
175  " burgers_energy_stability | "
176  " diffusion_exact_adjoint | "
177  " optimization_inverse_manufactured | "
178  " euler_gaussian_bump | "
179  " euler_gaussian_bump_enthalpy | "
180  " euler_gaussian_bump_adjoint | "
181  " euler_cylinder | "
182  " euler_cylinder_adjoint | "
183  " euler_vortex | "
184  " euler_entropy_waves | "
185  " euler_split_taylor_green | "
186  " taylor_green_scaling | "
187  " euler_bump_optimization | "
188  " euler_naca_optimization | "
189  " shock_1d | "
190  " euler_naca0012 | "
191  " reduced_order | "
192  " unsteady_reduced_order |"
193  " convection_diffusion_periodicity |"
194  " POD_adaptation | "
195  " POD_adaptive_sampling_run | "
196  " adaptive_sampling_testing | "
197  " finite_difference_sensitivity | "
198  " advection_periodicity | "
199  " dual_weighted_residual_mesh_adaptation | "
200  " anisotropic_mesh_adaptation | "
201  " taylor_green_vortex_energy_check | "
202  " taylor_green_vortex_restart_check | "
203  " homogeneous_isotropic_turbulence_initialization_check | "
204  " turbulent_channel_flow_skin_friction_check | "
205  " dipole_wall_collision_quantity_check | "
206  " turbulent_channel_flow_quantity_check | "
207  " time_refinement_study | "
208  " time_refinement_study_reference | "
209  " rrk_numerical_entropy_conservation_check | "
210  " euler_entropy_conserving_split_forms_check | "
211  " h_refinement_study_isentropic_vortex | "
212  " build_NNLS_problem |"
213  " hyper_reduction_comparison |"
214  " hyper_adaptive_sampling_run |"
215  " hyper_reduction_post_sampling |"
216  " ROM_error_post_sampling |"
217  " HROM_error_post_sampling | "
218  " hyper_adaptive_sampling_new_error |"
219  " halton_sampling_run |"
220  " naca0012_unsteady_check_quick | "
221  " khi_robustness | "
222  " low_density | "
223  " multi_species_vortex_advection | "
224  " real_gas_split_taylor_green"),
225  "The type of test we want to solve. "
226  "Choices are "
227  " <run_control | "
228  " grid_refinement_study | "
229  " stability_fr_parameter_range | "
230  " advection_limiter | "
231  " burgers_limiter | "
232  " burgers_energy_stability | "
233  " diffusion_exact_adjoint | "
234  " optimization_inverse_manufactured | "
235  " euler_gaussian_bump | "
236  " euler_gaussian_bump_enthalpy | "
237  " euler_gaussian_bump_adjoint | "
238  " euler_cylinder | "
239  " euler_cylinder_adjoint | "
240  " euler_vortex | "
241  " euler_entropy_waves | "
242  " euler_split_taylor_green |"
243  " taylor_green_scaling | "
244  " euler_bump_optimization | "
245  " euler_naca_optimization | "
246  " shock_1d | "
247  " euler_naca0012 | "
248  " convection_diffusion_periodicity |"
249  " reduced_order | "
250  " unsteady_reduced_order | "
251  " POD_adaptation | "
252  " POD_adaptive_sampling_run | "
253  " adaptive_sampling_testing | "
254  " finite_difference_sensitivity | "
255  " advection_periodicity | "
256  " dual_weighted_residual_mesh_adaptation | "
257  " anisotropic_mesh_adaptation | "
258  " taylor_green_vortex_energy_check | "
259  " taylor_green_vortex_restart_check | "
260  " homogeneous_isotropic_turbulence_initialization_check | "
261  " turbulent_channel_flow_skin_friction_check | "
262  " dipole_wall_collision_quantity_check | "
263  " turbulent_channel_flow_quantity_check | "
264  " time_refinement_study | "
265  " time_refinement_study_reference | "
266  " rrk_numerical_entropy_conservation_check | "
267  " euler_entropy_conserving_split_forms_check | "
268  " h_refinement_study_isentropic_vortex | "
269  " build_NNLS_problem |"
270  " hyper_reduction_comparison |"
271  " hyper_adaptive_sampling_run |"
272  " hyper_reduction_post_sampling |"
273  " ROM_error_post_sampling |"
274  " HROM_error_post_sampling | "
275  " hyper_adaptive_sampling_new_error |"
276  " halton_sampling_run |"
277  " naca0012_unsteady_check_quick | "
278  " khi_robustness | "
279  " low_density | "
280  " multi_species_vortex_advection | "
281  " real_gas_split_taylor_green>.");
282 
283  prm.declare_entry("pde_type", "advection",
284  dealii::Patterns::Selection(
285  " advection | "
286  " diffusion | "
287  " convection_diffusion | "
288  " advection_vector | "
289  " burgers_inviscid | "
290  " burgers_viscous | "
291  " burgers_rewienski | "
292  " euler |"
293  " mhd |"
294  " navier_stokes |"
295  " navier_stokes_channel_flow_constant_source_term | "
296  " navier_stokes_channel_flow_constant_source_term_wall_model | "
297  " physics_model_filtered |"
298  " physics_model |"
299  " real_gas"),
300  "The PDE we want to solve. "
301  "Choices are "
302  " <advection | "
303  " diffusion | "
304  " convection_diffusion | "
305  " advection_vector | "
306  " burgers_inviscid | "
307  " burgers_viscous | "
308  " burgers_rewienski | "
309  " euler | "
310  " mhd |"
311  " navier_stokes |"
312  " navier_stokes_channel_flow_constant_source_term | "
313  " navier_stokes_channel_flow_constant_source_term_wall_model | "
314  " physics_model_filtered |"
315  " physics_model |"
316  " real_gas>.");
317 
318  prm.declare_entry("model_type", "large_eddy_simulation",
319  dealii::Patterns::Selection(
320  " large_eddy_simulation |"
321  " reynolds_averaged_navier_stokes |"
322  " navier_stokes_model"),
323  "Enum of physics models "
324  "(i.e. model equations and/or terms additional to Navier-Stokes or a chosen underlying baseline physics)."
325  "Choices are "
326  " <large_eddy_simulation | reynolds_averaged_navier_stokes | navier_stokes_model>.");
327 
328  prm.declare_entry("conv_num_flux", "lax_friedrichs",
329  dealii::Patterns::Selection(
330  " lax_friedrichs | "
331  " roe | "
332  " l2roe | "
333  " central_flux | "
334  " two_point_flux | "
335  " two_point_flux_with_lax_friedrichs_dissipation | "
336  " two_point_flux_with_roe_dissipation | "
337  " two_point_flux_with_l2roe_dissipation"),
338  "Convective numerical flux. "
339  "Choices are "
340  " <lax_friedrichs | "
341  " roe | "
342  " l2roe | "
343  " central_flux | "
344  " two_point_flux | "
345  " two_point_flux_with_lax_friedrichs_dissipation | "
346  " two_point_flux_with_roe_dissipation | "
347  " two_point_flux_with_l2roe_dissipation>.");
348 
349  prm.declare_entry("diss_num_flux", "symm_internal_penalty",
350  dealii::Patterns::Selection("symm_internal_penalty | bassi_rebay_2 | central_visc_flux"),
351  "Dissipative numerical flux. "
352  "Choices are <symm_internal_penalty | bassi_rebay_2 | central_visc_flux>.");
353 
354  prm.declare_entry("non_physical_behavior", "return_big_number",
355  dealii::Patterns::Selection("return_big_number | abort_run | print_warning"),
356  "Behavior when a nonphysical result is detected in physics, "
357  "For example negative density or NaN. "
358  "return_big_number will set the quantity to BIG_NUMBER without any warnings "
359  "abort_run will std::abort() "
360  "print_warning will return BIG_NUMBER and print a warning to console. "
361  "Choices are <return_big_number | abort_run | print_warning>.");
362 
363  prm.declare_entry("solution_vtk_files_directory_name", ".",
364  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
365  "Name of directory for writing solution vtk files. Current directory by default.");
366 
367  prm.declare_entry("output_high_order_grid", "false",
368  dealii::Patterns::Bool(),
369  "Outputs the high-order mesh vtu files. False by default");
370 
371  prm.declare_entry("enable_higher_order_vtk_output", "true",
372  dealii::Patterns::Bool(),
373  "Enable writing of higher-order vtk files. True by default; "
374  "number of subdivisions is chosen according to the max of grid_degree and poly_degree.");
375 
376  prm.declare_entry("output_face_results_vtk", "false",
377  dealii::Patterns::Bool(),
378  "Outputs the surface solution vtk files. False by default");
379 
380  prm.declare_entry("do_renumber_dofs", "true",
381  dealii::Patterns::Bool(),
382  "Flag for renumbering DOFs using Cuthill-McKee renumbering. True by default. Set to false if doing 3D unsteady flow simulations.");
383 
384  prm.declare_entry("renumber_dofs_type", "CuthillMckee",
385  dealii::Patterns::Selection(
386  "CuthillMckee"),
387  "Renumber the dof handler type. Currently the only choice is Cuthill-Mckee.");
388 
389  prm.declare_entry("matching_surface_jac_det_tolerance", "1.3e-11",
390  dealii::Patterns::Double(0, dealii::Patterns::Double::max_double_value),
391  "Tolerance for checking that the determinant of surface jacobians at element faces matches. "
392  "Note: Currently only used in weak dg.");
393 
394  prm.declare_entry("chemistry_input_file", "",
395  dealii::Patterns::FileName(dealii::Patterns::FileName::FileType::input),
396  "Filename of the chemistry data file that contains the properties of the species used in simulation. (ex. H2_O2.kinetics");
397 
398  prm.declare_entry("wall_model_input_from_second_element", "true",
399  dealii::Patterns::Bool(),
400  "Flag for using second element as wall model input. If false, uses buffer (i.e. wall-adjacent) element.");
401 
402  prm.declare_entry("use_projected_entropy_variables_for_nsfr_boundary_term", "false",
403  dealii::Patterns::Bool(),
404  "Flag for using projected entropy variables for NSFR boundary term. "
405  "Default is false since boundary condition was verified using conservative solution.");
406 
423 
424  pcout << "Done declaring inputs." << std::endl;
425 }
426 
427 void AllParameters::parse_parameters (dealii::ParameterHandler &prm)
428 {
429  pcout << "Parsing main input..." << std::endl;
430 
431  dimension = prm.get_integer("dimension");
432  number_of_species = prm.get_integer("number_of_species");
433 
434  const std::string run_type_string = prm.get("run_type");
435  if (run_type_string == "integration_test") { run_type = integration_test; }
436  else if (run_type_string == "flow_simulation") { run_type = flow_simulation; }
437 
438  const std::string mesh_type_string = prm.get("mesh_type");
439  if (mesh_type_string == "default_triangulation") { mesh_type = default_triangulation; }
440  else if (mesh_type_string == "triangulation") { mesh_type = triangulation; }
441  else if (mesh_type_string == "parallel_shared_triangulation") { mesh_type = parallel_shared_triangulation; }
442  else if (mesh_type_string == "parallel_distributed_triangulation") { mesh_type = parallel_distributed_triangulation; }
443 
444 const std::string test_string = prm.get("test_type");
445  if (test_string == "run_control") { test_type = run_control; }
446  else if (test_string == "grid_refinement_study") { test_type = grid_refinement_study; }
447  else if (test_string == "stability_fr_parameter_range") { test_type = stability_fr_parameter_range; }
448  else if (test_string == "advection_limiter") { test_type = advection_limiter; }
449  else if (test_string == "burgers_limiter") { test_type = burgers_limiter; }
450  else if (test_string == "burgers_energy_stability") { test_type = burgers_energy_stability; }
451  else if (test_string == "diffusion_exact_adjoint") { test_type = diffusion_exact_adjoint; }
452  else if (test_string == "euler_gaussian_bump") { test_type = euler_gaussian_bump; }
453  else if (test_string == "euler_gaussian_bump_enthalpy") { test_type = euler_gaussian_bump_enthalpy; }
454  else if (test_string == "euler_gaussian_bump_adjoint") { test_type = euler_gaussian_bump_adjoint; }
455  else if (test_string == "euler_cylinder") { test_type = euler_cylinder; }
456  else if (test_string == "euler_cylinder_adjoint") { test_type = euler_cylinder_adjoint; }
457  else if (test_string == "euler_vortex") { test_type = euler_vortex; }
458  else if (test_string == "euler_entropy_waves") { test_type = euler_entropy_waves; }
459  else if (test_string == "advection_periodicity") { test_type = advection_periodicity; }
460  else if (test_string == "convection_diffusion_periodicity") { test_type = convection_diffusion_periodicity; }
461  else if (test_string == "euler_split_taylor_green") { test_type = euler_split_taylor_green; }
462  else if (test_string == "taylor_green_scaling") { test_type = taylor_green_scaling; }
463  else if (test_string == "euler_bump_optimization") { test_type = euler_bump_optimization; }
464  else if (test_string == "euler_naca_optimization") { test_type = euler_naca_optimization; }
465  else if (test_string == "shock_1d") { test_type = shock_1d; }
466  else if (test_string == "reduced_order") { test_type = reduced_order; }
467  else if (test_string == "unsteady_reduced_order") { test_type = unsteady_reduced_order; }
468  else if (test_string == "POD_adaptation") { test_type = POD_adaptation; }
469  else if (test_string == "POD_adaptive_sampling_run") { test_type = POD_adaptive_sampling_run; }
470  else if (test_string == "adaptive_sampling_testing") { test_type = adaptive_sampling_testing; }
471  else if (test_string == "finite_difference_sensitivity") { test_type = finite_difference_sensitivity; }
472  else if (test_string == "euler_naca0012") { test_type = euler_naca0012; }
473  else if (test_string == "optimization_inverse_manufactured") { test_type = optimization_inverse_manufactured; }
474  else if (test_string == "dual_weighted_residual_mesh_adaptation") { test_type = dual_weighted_residual_mesh_adaptation; }
475  else if (test_string == "anisotropic_mesh_adaptation") { test_type = anisotropic_mesh_adaptation; }
476  else if (test_string == "taylor_green_vortex_energy_check") { test_type = taylor_green_vortex_energy_check; }
477  else if (test_string == "taylor_green_vortex_restart_check") { test_type = taylor_green_vortex_restart_check; }
478  else if (test_string == "homogeneous_isotropic_turbulence_initialization_check")
479  { test_type = homogeneous_isotropic_turbulence_initialization_check; }
480  else if (test_string == "turbulent_channel_flow_skin_friction_check")
481  { test_type = turbulent_channel_flow_skin_friction_check; }
482  else if (test_string == "dipole_wall_collision_quantity_check") { test_type = dipole_wall_collision_quantity_check; }
483  else if (test_string == "turbulent_channel_flow_quantity_check") { test_type = turbulent_channel_flow_quantity_check; }
484  else if (test_string == "time_refinement_study") { test_type = time_refinement_study; }
485  else if (test_string == "time_refinement_study_reference") { test_type = time_refinement_study_reference; }
486  else if (test_string == "h_refinement_study_isentropic_vortex") { test_type = h_refinement_study_isentropic_vortex; }
487  else if (test_string == "rrk_numerical_entropy_conservation_check") { test_type = rrk_numerical_entropy_conservation_check; }
488  else if (test_string == "euler_entropy_conserving_split_forms_check")
489  { test_type = euler_entropy_conserving_split_forms_check; }
490  else if (test_string == "h_refinement_study_isentropic_vortex") { test_type = h_refinement_study_isentropic_vortex; }
491  else if (test_string == "khi_robustness") { test_type = khi_robustness; }
492  else if (test_string == "build_NNLS_problem") { test_type = build_NNLS_problem; }
493  else if (test_string == "hyper_reduction_comparison") { test_type = hyper_reduction_comparison; }
494  else if (test_string == "hyper_adaptive_sampling_run") { test_type = hyper_adaptive_sampling_run; }
495  else if (test_string == "hyper_reduction_post_sampling") { test_type = hyper_reduction_post_sampling; }
496  else if (test_string == "ROM_error_post_sampling") { test_type = ROM_error_post_sampling; }
497  else if (test_string == "HROM_error_post_sampling") { test_type = HROM_error_post_sampling; }
498  else if (test_string == "hyper_adaptive_sampling_new_error") { test_type = hyper_adaptive_sampling_new_error; }
499  else if (test_string == "halton_sampling_run") { test_type = halton_sampling_run; }
500  else if (test_string == "low_density") { test_type = low_density; }
501  else if (test_string == "naca0012_unsteady_check_quick") { test_type = naca0012_unsteady_check_quick; }
502  else if (test_string == "multi_species_vortex_advection") { test_type = multi_species_vortex_advection; }
503  else if (test_string == "real_gas_split_taylor_green") { test_type = real_gas_split_taylor_green; }
504 
505  // WARNING: Must assign model_type before pde_type
506  const std::string model_string = prm.get("model_type");
507  if (model_string == "large_eddy_simulation") { model_type = large_eddy_simulation; }
508  else if (model_string == "navier_stokes_model") { model_type = navier_stokes_model; }
509  else if (model_string == "reynolds_averaged_navier_stokes") { model_type = reynolds_averaged_navier_stokes; }
510 
511  const std::string pde_string = prm.get("pde_type");
512  if (pde_string == "advection") {
513  pde_type = advection;
514  nstate = 1;
515  } else if (pde_string == "advection_vector") {
516  pde_type = advection_vector;
517  nstate = 2;
518  } else if (pde_string == "diffusion") {
519  pde_type = diffusion;
520  nstate = 1;
521  } else if (pde_string == "convection_diffusion") {
522  pde_type = convection_diffusion;
523  nstate = 1;
524  } else if (pde_string == "burgers_inviscid") {
525  pde_type = burgers_inviscid;
526  nstate = dimension;
527  } else if (pde_string == "burgers_viscous") {
528  pde_type = burgers_viscous;
529  nstate = dimension;
530  } else if (pde_string == "burgers_rewienski") {
531  pde_type = burgers_rewienski;
532  nstate = dimension;
533  } else if (pde_string == "euler") {
534  pde_type = euler;
535  nstate = dimension+2;
536  }
537  else if (pde_string == "navier_stokes") {
538  pde_type = navier_stokes;
539  nstate = dimension+2;
540  }
541  else if (pde_string == "navier_stokes_channel_flow_constant_source_term") {
542  pde_type = navier_stokes_channel_flow_constant_source_term;
543  nstate = dimension+2;
544  }
545  else if (pde_string == "navier_stokes_channel_flow_constant_source_term_wall_model") {
546  pde_type = navier_stokes_channel_flow_constant_source_term_wall_model;
547  nstate = dimension+2;
548  using_wall_model = true;
549  }
550  else if (pde_string == "physics_model") {
551  pde_type = physics_model;
552  if (model_type == large_eddy_simulation || model_type == navier_stokes_model) {
553  nstate = dimension+2;
554  } else if (model_type == reynolds_averaged_navier_stokes) {
555  nstate = dimension+3;
556  }
557  } else if (pde_string == "physics_model_filtered") {
558  pde_type = physics_model_filtered;
559  if (model_type == large_eddy_simulation || model_type == navier_stokes_model) {
560  nstate = dimension+2;
561  }
562  } else if (pde_string == "real_gas") {
563  pde_type = real_gas;
565  }
566 
567  overintegration = prm.get_integer("overintegration");
568 
569  use_weak_form = prm.get_bool("use_weak_form");
570 
571  const std::string flux_nodes_string = prm.get("flux_nodes_type");
572  if (flux_nodes_string == "GL") { flux_nodes_type = FluxNodes::GL; }
573  if (flux_nodes_string == "GLL") { flux_nodes_type = FluxNodes::GLL; }
574 
575  use_collocated_nodes = (flux_nodes_type==FluxNodes::GLL) && (overintegration==0);
576 
577  use_split_form = prm.get_bool("use_split_form");
578 
579  const std::string two_point_num_flux_string = prm.get("two_point_num_flux_type");
580  if (two_point_num_flux_string == "KG") { two_point_num_flux_type = TwoPointNumericalFlux::KG; }
581  if (two_point_num_flux_string == "IR") { two_point_num_flux_type = TwoPointNumericalFlux::IR; }
582  if (two_point_num_flux_string == "CH") { two_point_num_flux_type = TwoPointNumericalFlux::CH; }
583  if (two_point_num_flux_string == "Ra") { two_point_num_flux_type = TwoPointNumericalFlux::Ra; }
584 
585  use_curvilinear_split_form = prm.get_bool("use_curvilinear_split_form");
586  use_curvilinear_grid = prm.get_bool("use_curvilinear_grid");
587  store_residual_cpu_time = prm.get_bool("store_residual_cpu_time");
588  use_weight_adjusted_mass = prm.get_bool("use_weight_adjusted_mass");
589  all_boundaries_are_periodic = prm.get_bool("all_boundaries_are_periodic");
590  check_same_coords_in_weak_dg = prm.get_bool("check_same_coords_in_weak_dg");
591  use_energy = prm.get_bool("use_energy");
592  use_L2_norm = prm.get_bool("use_L2_norm");
593  sipg_penalty_factor = prm.get_double("sipg_penalty_factor");
594  use_invariant_curl_form = prm.get_bool("use_invariant_curl_form");
595  use_inverse_mass_on_the_fly = prm.get_bool("use_inverse_mass_on_the_fly");
596  check_valid_metric_Jacobian = prm.get_bool("check_valid_metric_Jacobian");
597  if(!use_weak_form){
599  }
600 
601  energy_file = prm.get("energy_file");
602 
603  const std::string conv_num_flux_string = prm.get("conv_num_flux");
604  if (conv_num_flux_string == "lax_friedrichs") { conv_num_flux_type = ConvectiveNumericalFlux::lax_friedrichs; }
605  if (conv_num_flux_string == "roe") { conv_num_flux_type = ConvectiveNumericalFlux::roe; }
606  if (conv_num_flux_string == "l2roe") { conv_num_flux_type = ConvectiveNumericalFlux::l2roe; }
607  if (conv_num_flux_string == "central_flux") { conv_num_flux_type = ConvectiveNumericalFlux::central_flux; }
608  if (conv_num_flux_string == "two_point_flux") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux; }
609  if (conv_num_flux_string == "two_point_flux_with_lax_friedrichs_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_lax_friedrichs_dissipation; }
610  if (conv_num_flux_string == "two_point_flux_with_roe_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_roe_dissipation; }
611  if (conv_num_flux_string == "two_point_flux_with_l2roe_dissipation") { conv_num_flux_type = ConvectiveNumericalFlux::two_point_flux_with_l2roe_dissipation; }
612 
613  const std::string diss_num_flux_string = prm.get("diss_num_flux");
614  if (diss_num_flux_string == "symm_internal_penalty") { diss_num_flux_type = symm_internal_penalty; }
615  if (diss_num_flux_string == "bassi_rebay_2") {
616  diss_num_flux_type = bassi_rebay_2;
617  sipg_penalty_factor = 0.0;
618  }
619  if (diss_num_flux_string == "central_visc_flux") diss_num_flux_type = central_visc_flux;
620 
621  const std::string flux_reconstruction_string = prm.get("flux_reconstruction");
622  if (flux_reconstruction_string == "cDG") { flux_reconstruction_type = cDG; }
623  if (flux_reconstruction_string == "cSD") { flux_reconstruction_type = cSD; }
624  if (flux_reconstruction_string == "cHU") { flux_reconstruction_type = cHU; }
625  if (flux_reconstruction_string == "cNegative") { flux_reconstruction_type = cNegative; }
626  if (flux_reconstruction_string == "cNegative2") { flux_reconstruction_type = cNegative2; }
627  if (flux_reconstruction_string == "cPlus") { flux_reconstruction_type = cPlus; }
628  if (flux_reconstruction_string == "c10Thousand") { flux_reconstruction_type = c10Thousand; }
629  if (flux_reconstruction_string == "cHULumped") { flux_reconstruction_type = cHULumped; }
630  if (flux_reconstruction_string == "user_specified_value")
631  { flux_reconstruction_type = user_specified_value; }
632 
633  FR_user_specified_correction_parameter_value = prm.get_double("FR_user_specified_correction_parameter_value");
634  if ( abs(FR_user_specified_correction_parameter_value ) >1E-13 && flux_reconstruction_type != user_specified_value){
635  pcout << "Warning: User-specified FR parameter has been set, but flux_reconstruction_type is " << std::endl
636  << "not chosen as user_specified_value. This may be unintended." << std::endl;
637  }
638 
639  const std::string flux_reconstruction_aux_string = prm.get("flux_reconstruction_aux");
640  if (flux_reconstruction_aux_string == "kDG") { flux_reconstruction_aux_type = kDG; }
641  if (flux_reconstruction_aux_string == "kSD") { flux_reconstruction_aux_type = kSD; }
642  if (flux_reconstruction_aux_string == "kHU") { flux_reconstruction_aux_type = kHU; }
643  if (flux_reconstruction_aux_string == "kNegative") { flux_reconstruction_aux_type = kNegative; }
644  if (flux_reconstruction_aux_string == "kNegative2") { flux_reconstruction_aux_type = kNegative2; }
645  if (flux_reconstruction_aux_string == "kPlus") { flux_reconstruction_aux_type = kPlus; }
646  if (flux_reconstruction_aux_string == "k10Thousand") { flux_reconstruction_aux_type = k10Thousand; }
647 
648  const std::string non_physical_behavior_string = prm.get("non_physical_behavior");
649  if (non_physical_behavior_string == "return_big_number") { non_physical_behavior_type = NonPhysicalBehaviorEnum::return_big_number;}
650  if (non_physical_behavior_string == "abort_run") { non_physical_behavior_type = NonPhysicalBehaviorEnum::abort_run;}
651  if (non_physical_behavior_string == "print_warning") { non_physical_behavior_type = NonPhysicalBehaviorEnum::print_warning;}
652 
653  solution_vtk_files_directory_name = prm.get("solution_vtk_files_directory_name");
654  // Check if directory exists - see https://stackoverflow.com/a/18101042
655  struct stat info_vtk;
656  if( stat( solution_vtk_files_directory_name.c_str(), &info_vtk ) != 0 ){
657  pcout << "Error: No solution vtk files directory named " << solution_vtk_files_directory_name << " exists." << std::endl
658  << "Please create the directory and restart. Aborting..." << std::endl;
659  std::abort();
660  }
661  output_high_order_grid = prm.get_bool("output_high_order_grid");
662  enable_higher_order_vtk_output = prm.get_bool("enable_higher_order_vtk_output");
663  output_face_results_vtk = prm.get_bool("output_face_results_vtk");
664  do_renumber_dofs = prm.get_bool("do_renumber_dofs");
665 
666  const std::string renumber_dofs_type_string = prm.get("renumber_dofs_type");
667  if (renumber_dofs_type_string == "CuthillMckee") { renumber_dofs_type = RenumberDofsType::CuthillMckee; }
668 
669  matching_surface_jac_det_tolerance = prm.get_double("matching_surface_jac_det_tolerance");
670  wall_model_input_from_second_element = prm.get_bool("wall_model_input_from_second_element");
671  use_projected_entropy_variables_for_nsfr_boundary_term = prm.get_bool("use_projected_entropy_variables_for_nsfr_boundary_term");
672 
673  chemistry_input_file = prm.get("chemistry_input_file");
674 
675  pcout << "Parsing linear solver subsection..." << std::endl;
677 
678  pcout << "Parsing ODE solver subsection..." << std::endl;
680 
681  pcout << "Parsing manufactured convergence study subsection..." << std::endl;
683 
684  pcout << "Parsing euler subsection..." << std::endl;
686 
687  pcout << "Parsing navier stokes subsection..." << std::endl;
689 
690  pcout << "Parsing reduced order subsection..." << std::endl;
692 
693  pcout << "Parsing hyperreduction subsection..." << std::endl;
695 
696  pcout << "Parsing Burgers subsection..." << std::endl;
698 
699  pcout << "Parsing physics model subsection..." << std::endl;
701 
702  pcout << "Parsing grid refinement study subsection..." << std::endl;
704 
705  pcout << "Parsing artificial dissipation subsection..." << std::endl;
707 
708  pcout << "Parsing limiter subsection..." << std::endl;
710 
711  pcout << "Parsing flow solver subsection..." << std::endl;
713 
714  pcout << "Parsing mesh adaptation subsection..." << std::endl;
716 
717  pcout << "Parsing functional subsection..." << std::endl;
719 
720  pcout << "Parsing time refinement study subsection..." << std::endl;
722 
723  pcout << "Done parsing." << std::endl;
724 
726 }
727 
729  if(flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::channel_flow) {
737  pcout << "Setting freestream parameters for channel flow case to be based on bulk velocity Reynolds number... " << std::flush;
738  const double channel_bulk_velocity_reynolds_number = pow(0.073, -4.0/7.0)*pow(2.0, 5.0/7.0)*pow(flow_solver_param.turbulent_channel_friction_velocity_reynolds_number, 8.0/7.0);
739  // - Freestream Reynolds number
740  navier_stokes_param.reynolds_number_inf = channel_bulk_velocity_reynolds_number;
741  // - Reference length
742  euler_param.ref_length = flow_solver_param.turbulent_channel_domain_length_y_direction/2.0; // corresponds to half channel height
743 
744  pcout << "done." << std::endl;
745  }
746  if((pde_type == PartialDifferentialEquation::navier_stokes || (pde_type == PartialDifferentialEquation::navier_stokes_channel_flow_constant_source_term ||
747  (pde_type == PartialDifferentialEquation::navier_stokes_channel_flow_constant_source_term_wall_model ||
748  (pde_type == PartialDifferentialEquation::physics_model || pde_type == PartialDifferentialEquation::physics_model_filtered)))) &&
749  (flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::taylor_green_vortex ||
750  (flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::channel_flow ||
751  (flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::dipole_wall_collision_normal ||
752  (flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::dipole_wall_collision_oblique ||
753  flow_solver_param.flow_case_type == flow_solver_param.FlowCaseType::decaying_homogeneous_isotropic_turbulence)))))
754  {
755  pcout << "Setting non_physical_behavior_type = NonPhysicalBehaviorEnum::abort_run... " << std::flush;
756  non_physical_behavior_type = NonPhysicalBehaviorEnum::abort_run;
757  pcout << "done." << std::endl;
758  }
759 }
760 
761 } // Parameters namespace
762 } // PHiLiP namespace
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
TwoPointNumericalFlux two_point_num_flux_type
Store selected TwoPointNumericalFlux from the input file.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
bool use_curvilinear_grid
Flag to use curvilinear grid.
LimiterParam limiter_param
Contains parameters for limiter.
FlowCaseType flow_case_type
Selected FlowCaseType from the input file.
bool all_boundaries_are_periodic
Flag to signal that all boundaries are periodic; if true surface flux nodes will not be stored for ef...
Parameters related to the linear solver.
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.
TimeRefinementStudyParam time_refinement_study_param
Contains the parameters for time refinement study.
NonPhysicalBehaviorEnum non_physical_behavior_type
Specify behavior on nonphysical results.
unsigned int number_of_species
Number of species. Note that it has to match the CMake variable NUMBER_OF_SPECIES.
std::string chemistry_input_file
Name of file containing NASA CAP data for species.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
double turbulent_channel_domain_length_y_direction
For channel flow, domain length in y-direction.
Parameters related to the manufactured convergence study.
bool output_face_results_vtk
Flag for outputting the surface solution vtk files.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
Parameters related to time refinement studies.
double turbulent_channel_friction_velocity_reynolds_number
For channel flow, channel Reynolds number based on wall friction velocity.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
bool use_energy
Flag to use an energy monotonicity test.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
void parse_parameters(dealii::ParameterHandler &prm)
Function to parse parameters.
Files for the baseline physics.
Definition: ADTypes.hpp:10
GridRefinementStudyParam grid_refinement_study_param
Contains the parameters for grid refinement study.
bool use_weak_form
Flag to use weak or strong form of DG.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
dealii::ConditionalOStream pcout
Parallel std::cout that only outputs on mpi_rank==0.
bool use_invariant_curl_form
Flag to use invariant curl form for metric cofactor operator.
Parameters related to reduced-order model.
double reynolds_number_inf
Farfield Reynolds number.
ReducedOrderModelParam reduced_order_param
Contains parameters for the Reduced-Order model.
Flux_Reconstruction_Aux flux_reconstruction_aux_type
Store flux reconstruction type for the auxiliary variables.
EulerParam euler_param
Contains parameters for the Euler equations non-dimensionalization.
void parse_parameters(dealii::ParameterHandler &prm)
Parse parameters.
Parameters related to the limiter.
unsigned int dimension
Number of dimensions. Note that it has to match the executable PHiLiP_xD.
RunType run_type
Selected RunType from the input file.
MeshAdaptationParam mesh_adaptation_param
Constains parameters for mesh adaptation.
std::string energy_file
Energy file.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
static void declare_parameters(dealii::ParameterHandler &prm)
Function to declare parameters.
ManufacturedConvergenceStudyParam manufactured_convergence_study_param
Contains parameters for manufactured convergence study.
void modify_parameters()
Modify parameters after parsing for certain cases.
bool enable_higher_order_vtk_output
Enable writing of higher-order vtk results.
Flux_Reconstruction flux_reconstruction_type
Store flux reconstruction type.
double ref_length
Reference length.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
ODESolverParam ode_solver_param
Contains parameters for ODE solver.
Parameters related to reduced-order model.
NavierStokesParam navier_stokes_param
Contains parameters for the Navier-Stokes equations non-dimensionalization.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
LinearSolverParam linear_solver_param
Contains parameters for linear solver.
bool do_renumber_dofs
Flag for renumbering DOFs.
Parameters related to the flow solver.
TestType test_type
Store selected TestType from the input file.
bool check_valid_metric_Jacobian
Flag to check if the metric Jacobian is valid when high-order grid is constructed.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
bool use_L2_norm
Flag to use an L2 energy monotonicity test (for FR)
double FR_user_specified_correction_parameter_value
User specified flux recontruction correction parameter value.
Parameters related to the Navier Stokes equations.
bool use_split_form
Flag to use split form.
Parameterse related to the functional object.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
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.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Parameters related to Physics Models.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
ConvectiveNumericalFlux conv_num_flux_type
Store convective flux type.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
bool use_inverse_mass_on_the_fly
Flag to use inverse mass matrix on-the-fly for explicit solves.
int nstate
Number of state variables. Will depend on PDE.
void parse_parameters(dealii::ParameterHandler &prm)
Retrieve parameters from dealii::ParameterHandler.
std::string solution_vtk_files_directory_name
Name of directory for writing solution vtk files.
Parameters related to collection of grid refinement runs.
FluxNodes flux_nodes_type
Store selected FluxNodes from the input file.
Parameters related to the ODE solver.
bool use_projected_entropy_variables_for_nsfr_boundary_term
Flag for using projected entropy variables for NSFR boundary term.
bool wall_model_input_from_second_element
Flag for using second element as wall model input; if false, uses buffer (i.e. wall-adjacent) element...
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
FunctionalParam functional_param
Contains parameters for functional.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
DissipativeNumericalFlux diss_num_flux_type
Store diffusive flux type.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
Parameters related to the artificial dissipation.
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters that can be set as inputs and set up the default options.
double sipg_penalty_factor
Scaling of Symmetric Interior Penalty term to ensure coercivity.
bool use_weight_adjusted_mass
Flag to use weight-adjusted Mass Matrix for curvilinear elements.
ModelType model_type
Store the model type.
HyperReductionParam hyper_reduction_param
Contains parameters for Hyperreduction.
ArtificialDissipationParam artificial_dissipation_param
Contains parameters for artificial dissipation.
bool output_high_order_grid
Flag for outputting the high-order grid vtk files.
RenumberDofsType renumber_dofs_type
Store selected RenumberDofsType from the input file.
bool use_curvilinear_split_form
Flag to use curvilinear metric split form.
PhysicsModelParam physics_model_param
Contains parameters for Physics Model.
MeshType mesh_type
Store selected MeshType from the input file.
BurgersParam burgers_param
Contains parameters for Burgers equation.
bool use_collocated_nodes
Flag for using collocated nodes; determined based on flux_nodes_type and overintegration input parame...
Parameters related to the linear solver.
int overintegration
Number of additional quadrature points to use.
static void declare_parameters(dealii::ParameterHandler &prm)
Declare parameters.
void parse_parameters(dealii::ParameterHandler &prm)
Function to parse parameters.
static void declare_parameters(dealii::ParameterHandler &prm)
Function to declare parameters.
bool store_residual_cpu_time
Flag to store the residual local processor cpu time.
Parameters related to reduced-order model.
bool using_wall_model
Flag for using wall model (initialized as false)
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.