[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
initial_condition_function.cpp
1 #include <deal.II/base/function.h>
2 #include "initial_condition_function.h"
3 // For initial conditions which need to refer to physics
4 #include "physics/physics_factory.h"
5 
6 namespace PHiLiP {
7 
8 // =========================================================
9 // Initial Condition Base Class
10 // =========================================================
11 template <int dim, int nstate, typename real>
14  : dealii::Function<dim,real>(nstate)//,0.0) // 0.0 denotes initial time (t=0)
15 {
16  // Nothing to do here yet
17 }
18 
19 // ========================================================
20 // TAYLOR GREEN VORTEX -- Initial Condition (Uniform density)
21 // ========================================================
22 template <int dim, int nstate, typename real>
25  Parameters::AllParameters const *const param)
26  : InitialConditionFunction_EulerBase<dim, nstate, real>(param)
27  , gamma_gas(param->euler_param.gamma_gas)
28  , mach_inf(param->euler_param.mach_inf)
29  , mach_inf_sqr(mach_inf*mach_inf)
30 {}
31 template <int dim, int nstate, typename real>
33 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
34 {
35  // Note: This is in non-dimensional form (free-stream values as reference)
36  real value = 0.;
37  if constexpr(dim == 3) {
38  const real x = point[0], y = point[1], z = point[2];
39 
40  if(istate==0) {
41  // density
42  value = this->density(point);
43  }
44  if(istate==1) {
45  // x-velocity
46  value = sin(x)*cos(y)*cos(z);
47  }
48  if(istate==2) {
49  // y-velocity
50  value = -cos(x)*sin(y)*cos(z);
51  }
52  if(istate==3) {
53  // z-velocity
54  value = 0.0;
55  }
56  if(istate==4) {
57  // pressure
58  value = 1.0/(this->gamma_gas*this->mach_inf_sqr) + (1.0/16.0)*(cos(2.0*x)+cos(2.0*y))*(cos(2.0*z)+2.0);
59  }
60  }
61  return value;
62 }
63 
64 template <int dim, int nstate, typename real>
66 ::density(const dealii::Point<dim,real> &/*point*/) const
67 {
68  // Note: This is in non-dimensional form (free-stream values as reference)
69  real value = 0.;
70  // density
71  value = 1.0;
72  return value;
73 }
74 
75 // ========================================================
76 // TAYLOR GREEN VORTEX -- Initial Condition (Isothermal density)
77 // ========================================================
78 template <int dim, int nstate, typename real>
81  Parameters::AllParameters const *const param)
82  : InitialConditionFunction_TaylorGreenVortex<dim,nstate,real>(param)
83 {}
84 
85 template <int dim, int nstate, typename real>
87 ::density(const dealii::Point<dim,real> &point) const
88 {
89  // Note: This is in non-dimensional form (free-stream values as reference)
90  real value = 0.;
91  // density
92  value = this->primitive_value(point, 4); // get pressure
93  value *= this->gamma_gas*this->mach_inf_sqr;
94  return value;
95 }
96 
97 // ========================================================
98 // 1D BURGERS REWIENSKI -- Initial Condition
99 // ========================================================
100 template <int dim, int nstate, typename real>
103  : InitialConditionFunction<dim,nstate,real>()
104 {
105  // Nothing to do here yet
106 }
107 
108 template <int dim, int nstate, typename real>
110 ::value(const dealii::Point<dim,real> &/*point*/, const unsigned int /*istate*/) const
111 {
112  real value = 1.0;
113  return value;
114 }
115 
116 // ========================================================
117 // 1D BURGERS VISCOUS -- Initial Condition
118 // ========================================================
119 template <int dim, int nstate, typename real>
122  : InitialConditionFunction<dim,nstate,real>()
123 {
124  // Nothing to do here yet
125 }
126 
127 template <int dim, int nstate, typename real>
129 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
130 {
131  real value = 0;
132  if(point[0] >= 0 && point[0] <= 0.25){
133  value = sin(4*dealii::numbers::PI*point[0]);
134  }
135  return value;
136 
137 }
138 
139 // ========================================================
140 // 1D BURGERS Inviscid -- Initial Condition
141 // ========================================================
142 template <int dim, int nstate, typename real>
145  : InitialConditionFunction<dim,nstate,real>()
146 {
147  // Nothing to do here yet
148 }
149 
150 template <int dim, int nstate, typename real>
152 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
153 {
154  real value = 1.0;
155  if constexpr(dim >= 1)
156  value *= cos(dealii::numbers::PI*point[0]);
157  if constexpr(dim >= 2)
158  value *= cos(dealii::numbers::PI*point[1]);
159  if constexpr(dim == 3)
160  value *= cos(dealii::numbers::PI*point[2]);
161 
162  return value;
163 }
164 
165 // ========================================================
166 // 1D BURGERS Inviscid Energy-- Initial Condition
167 // ========================================================
168 template <int dim, int nstate, typename real>
171  : InitialConditionFunction<dim,nstate,real>()
172 {
173  // Nothing to do here yet
174 }
175 
176 template <int dim, int nstate, typename real>
178 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
179 {
180  real value = 1.0;
181  if constexpr(dim >= 1)
182  value *= sin(dealii::numbers::PI*point[0]);
183  if constexpr(dim >= 2)
184  value *= sin(dealii::numbers::PI*point[1]);
185  if constexpr(dim == 3)
186  value *= sin(dealii::numbers::PI*point[2]);
187 
188  value += 0.01;
189  return value;
190 }
191 
192 // ========================================================
193 // Advection -- Initial Condition
194 // ========================================================
195 template <int dim, int nstate, typename real>
198  : InitialConditionFunction<dim,nstate,real>()
199 {
200  // Nothing to do here yet
201 }
202 
203 template <int dim, int nstate, typename real>
205 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
206 {
207  real value = 1.0;
208  if constexpr(dim >= 1)
209  value *= exp(-20.0*point[0]*point[0]);
210  if constexpr(dim >= 2)
211  value *= exp(-20.0*point[1]*point[1]);
212  if constexpr(dim == 3)
213  value *= exp(-20.0*point[2]*point[2]);
214 
215  return value;
216 }
217 
218 // ========================================================
219 // Advection OOA -- Initial Condition
220 // ========================================================
221 template <int dim, int nstate, typename real>
224  : InitialConditionFunction<dim,nstate,real>()
225 {
226  // Nothing to do here yet
227 }
228 
229 template <int dim, int nstate, typename real>
231 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
232 {
233  real value = 1.0;
234  if constexpr(dim >= 1)
235  value *= sin(2.0*dealii::numbers::PI*point[0]);
236  if constexpr(dim >= 2)
237  value *= sin(2.0*dealii::numbers::PI*point[1]);
238  if constexpr(dim == 3)
239  value *= sin(2.0*dealii::numbers::PI*point[2]);
240 
241  return value;
242 }
243 
244 // ========================================================
245 // Convection_diffusion -- Initial Condition
246 // ========================================================
247 template <int dim, int nstate, typename real>
250  : InitialConditionFunction<dim,nstate,real>()
251 {
252  // Nothing to do here yet
253 }
254 
255 template <int dim, int nstate, typename real>
257 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
258 {
259  real value = 1.0;
260  if constexpr(dim >= 1)
261  value *= sin(dealii::numbers::PI*point[0]);
262  if constexpr(dim >= 2)
263  value *= sin(dealii::numbers::PI*point[1]);
264  if constexpr(dim == 3)
265  value *= sin(dealii::numbers::PI*point[2]);
266 
267  return value;
268 }
269 
270 // ========================================================
271 // Convection_diffusion Energy -- Initial Condition
272 // ========================================================
273 template <int dim, int nstate, typename real>
276  : InitialConditionFunction<dim,nstate,real>()
277 {
278  // Nothing to do here yet
279 }
280 
281 template <int dim, int nstate, typename real>
283 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
284 {
285  real value = 1.0;
286  if constexpr(dim >= 1)
287  value *= sin(dealii::numbers::PI*point[0]);
288  if constexpr(dim >= 2)
289  value *= sin(dealii::numbers::PI*point[1]);
290  if constexpr(dim == 3)
291  value *= sin(dealii::numbers::PI*point[2]);
292 
293  value += 0.1;
294 
295  return value;
296 }
297 
298 // ========================================================
299 // 1D SINE -- Initial Condition for advection_explicit_time_study
300 // ========================================================
301 template <int dim, int nstate, typename real>
304  : InitialConditionFunction<dim,nstate,real>()
305 {
306  // Nothing to do here yet
307 }
308 
309 template <int dim, int nstate, typename real>
311 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
312 {
313  real value = 0;
314  real pi = dealii::numbers::PI;
315  if(point[0] >= 0.0 && point[0] <= 2.0){
316  value = sin(2*pi*point[0]/2.0);
317  }
318  return value;
319 }
320 
321 // ========================================================
322 // Inviscid Isentropic Vortex
323 // ========================================================
324 template <int dim, int nstate, typename real>
327  Parameters::AllParameters const *const param)
328  : InitialConditionFunction<dim,nstate,real>()
329 {
330  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
331  // This test should only be used for Euler
332  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,dim+2,double>>(
334 }
335 
336 template <int dim, int nstate, typename real>
338 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
339 {
340  // Setting constants
341  const double pi = dealii::numbers::PI;
342  const double gam = 1.4;
343  const double M_infty = sqrt(2/gam);
344  const double R = 1;
345  const double sigma = 1;
346  const double beta = M_infty * 5 * sqrt(2.0)/4.0/pi * exp(1.0/2.0);
347  const double alpha = pi/4; //rad
348 
349  // Centre of the vortex at t=0
350  const double x0 = 0.0;
351  const double y0 = 0.0;
352  const double x = point[0] - x0;
353  const double y = point[1] - y0;
354 
355  const double Omega = beta * exp(-0.5/sigma/sigma* (x/R * x/R + y/R * y/R));
356  const double delta_Ux = -y/R * Omega;
357  const double delta_Uy = x/R * Omega;
358  const double delta_T = -(gam-1.0)/2.0 * Omega * Omega;
359 
360  // Primitive
361  std::array<real,nstate> soln_primitive;
362  soln_primitive[0] = pow((1 + delta_T), 1.0/(gam-1.0));
363  soln_primitive[1] = M_infty * cos(alpha) + delta_Ux;
364  soln_primitive[2] = M_infty * sin(alpha) + delta_Uy;
365  #if PHILIP_DIM==3
366  soln_primitive[3] = 0;
367  #endif
368  soln_primitive[nstate-1] = 1.0/gam*pow(1+delta_T, gam/(gam-1.0));
369 
370  const std::array<real,nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
371  return soln_conservative[istate];
372 }
373 
374 // ========================================================
375 // KELVIN-HELMHOLTZ INSTABILITY
376 // See Chan et al., On the entropy projection..., 2022, Pg. 15
377 // Note that some equations are not typed correctly
378 // See github.com/trixi-framework/paper-2022-robustness-entropy-projection
379 // for initial condition which is implemented herein
380 // ========================================================
381 template <int dim, int nstate, typename real>
384  Parameters::AllParameters const *const param)
385  : InitialConditionFunction<dim,nstate,real>()
386  , atwood_number(param->flow_solver_param.atwood_number)
387 {
388  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
389  // This test should only be used for Euler
390  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,dim+2,double>>(
392 }
393 
394 template <int dim, int nstate, typename real>
396 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
397 {
398  const double pi = dealii::numbers::PI;
399 
400  const double B = 0.5 * (tanh(15*point[1] + 7.5) - tanh(15*point[1] - 7.5));
401 
402  const double rho1 = 0.5;
403  const double rho2 = rho1 * (1 + atwood_number) / (1 - atwood_number);
404 
405  std::array<real,nstate> soln_primitive;
406  soln_primitive[0] = rho1 + B * (rho2-rho1);
407  soln_primitive[nstate-1] = 1;
408  soln_primitive[1] = B - 0.5;
409  soln_primitive[2] = 0.1 * sin(2 * pi * point[0]);
410 
411  const std::array<real,nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
412  return soln_conservative[istate];
413 }
414 
415 // ========================================================
416 // Initial Condition - Euler Base
417 // ========================================================
418 template <int dim, int nstate, typename real>
421  Parameters::AllParameters const* const param)
422  : InitialConditionFunction<dim, nstate, real>()
423 {
424  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
425  // Note that Euler primitive/conservative vars are the same as NS
426  PHiLiP::Parameters::AllParameters parameters_euler = *param;
427  parameters_euler.pde_type = Parameters::AllParameters::PartialDifferentialEquation::euler;
428  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,dim+2,double>>(
430 }
431 
432 template <int dim, int nstate, typename real>
435  const dealii::Point<dim, real>& point, const unsigned int istate) const
436 {
437  real value = 0.0;
438  std::array<real, nstate> soln_primitive;
439 
440  soln_primitive[0] = primitive_value(point, 0);
441  soln_primitive[1] = primitive_value(point, 1);
442  soln_primitive[2] = primitive_value(point, 2);
443 
444  if constexpr (dim > 1)
445  soln_primitive[3] = primitive_value(point, 3);
446  if constexpr (dim > 2)
447  soln_primitive[4] = primitive_value(point, 4);
448 
449  const std::array<real, nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
450  value = soln_conservative[istate];
451 
452  return value;
453 }
454 
455 template <int dim, int nstate, typename real>
457 ::value(const dealii::Point<dim, real>& point, const unsigned int istate) const
458 {
459  real value = 0.0;
460  value = convert_primitive_to_conversative_value(point, istate);
461  return value;
462 }
463 
464 // ========================================================
465 // 1D Sod Shock tube -- Initial Condition
466 // See Chen & Shu, Entropy stable high order..., 2017, Pg. 25
467 // ========================================================
468 template <int dim, int nstate, typename real>
471  Parameters::AllParameters const* const param)
472  : InitialConditionFunction_EulerBase<dim,nstate,real>(param)
473 {}
474 
475 template <int dim, int nstate, typename real>
477 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
478 {
479  real value = 0.0;
480  if constexpr (dim == 1 && nstate == (dim+2)) {
481  const real x = point[0];
482  if (x < 0) {
483  if (istate == 0) {
484  // density
485  value = 1.0;
486  }
487  if (istate == 1) {
488  // x-velocity
489  value = 0.0;
490  }
491  if (istate == 2) {
492  // pressure
493  value = 1.0;
494  }
495  } else {
496  if (istate == 0) {
497  // density
498  value = 0.125;
499  }
500  if (istate == 1) {
501  // x-velocity
502  value = 0.0;
503  }
504  if (istate == 2) {
505  // pressure
506  value = 0.1;
507  }
508  }
509  }
510  return value;
511 }
512 
513 // ========================================================
514 // 2D Low Density Euler -- Initial Condition
515 // See Zhang & Shu, On positivity-preserving..., 2010 Pg. 10
516 // ========================================================
517 template <int dim, int nstate, typename real>
520  Parameters::AllParameters const* const param)
521  : InitialConditionFunction_EulerBase<dim, nstate, real>(param)
522 {}
523 
524 template <int dim, int nstate, typename real>
526 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
527 {
528  real value = 0.0;
529  if constexpr (dim == 2 && nstate == (dim + 2)) {
530  const real x = point[0];
531  const real y = point[1];
532  if (istate == 0) {
533  // density
534  value = 1 + 0.99 * sin(x + y);
535  }
536  if (istate == 1) {
537  // x-velocity
538  value = 1.0;
539  }
540  if (istate == 2) {
541  // y-velocity
542  value = 1.0;
543  }
544  if (istate == 3) {
545  // pressure
546  value = 1.0;
547  }
548  }
549  return value;
550 }
551 
552 // ========================================================
553 // 1D Leblanc Shock tube -- Initial Condition
554 // See Zhang & Shu, On positivity-preserving..., 2010 Pg. 14
555 // ========================================================
556 template <int dim, int nstate, typename real>
559  Parameters::AllParameters const* const param)
560  : InitialConditionFunction_EulerBase<dim, nstate, real>(param)
561 {}
562 
563 template <int dim, int nstate, typename real>
565 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
566 {
567  real value = 0.0;
568  if constexpr (dim == 1 && nstate == (dim + 2)) {
569  const real x = point[0];
570  if (x < 0) {
571  if (istate == 0) {
572  // density
573  value = 2.0;
574  }
575  if (istate == 1) {
576  // x-velocity
577  value = 0.0;
578  }
579  if (istate == 2) {
580  // pressure
581  value = pow(10.0, 9.0);
582  }
583  }
584  else {
585  if (istate == 0) {
586  // density
587  value = 0.001;
588  }
589  if (istate == 1) {
590  // x-velocity
591  value = 0.0;
592  }
593  if (istate == 2) {
594  // pressure
595  value = 1.0;
596  }
597  }
598  }
599  return value;
600 }
601 
602 // ========================================================
603 // 1D Shu-Osher Problem -- Initial Condition
604 // See Johnsen et al., Assessment of high-resolution..., 2010 Pg. 7
605 // ========================================================
606 template <int dim, int nstate, typename real>
609  Parameters::AllParameters const* const param)
610  : InitialConditionFunction_EulerBase<dim, nstate, real>(param)
611 {}
612 
613 template <int dim, int nstate, typename real>
615 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
616 {
617  real value = 0.0;
618  if constexpr (dim == 1 && nstate == (dim + 2)) {
619  const real x = point[0];
620  if (x < -4.0) {
621  if (istate == 0) {
622  // density
623  value = 3.857143;
624  }
625  else if (istate == 1) {
626  // x-velocity
627  value = 2.629369;
628  }
629  else if (istate == 2) {
630  // pressure
631  value = 10.33333;
632  }
633  }
634  else {
635  if (istate == 0) {
636  // density
637  value = 1 + 0.2 * sin(5 * x);
638  }
639  else if (istate == 1) {
640  // x-velocity
641  value = 0.0;
642  }
643  else if (istate == 2) {
644  // pressure
645  value = 1.0;
646  }
647  }
648  }
649  return value;
650 }
651 
652 // ========================================================
653 // ZERO INITIAL CONDITION
654 // ========================================================
655 template <int dim, int nstate, typename real>
658  : InitialConditionFunction<dim,nstate,real>()
659 {
660  // Nothing to do here yet
661 }
662 
663 template <int dim, int nstate, typename real>
665 ::value(const dealii::Point<dim,real> &/*point*/, const unsigned int /*istate*/) const
666 {
667  return 0.0;
668 }
669 
670 // =========================================================
671 // Initial Condition Factory
672 // =========================================================
673 template <int dim, int nstate, typename real>
674 std::shared_ptr<InitialConditionFunction<dim, nstate, real>>
676  Parameters::AllParameters const *const param)
677 {
678  // Get the flow case type
679  const FlowCaseEnum flow_type = param->flow_solver_param.flow_case_type;
680  if (flow_type == FlowCaseEnum::taylor_green_vortex) {
681  if constexpr (dim==3 && nstate==dim+2){
682  // Get the density initial condition type
683  const DensityInitialConditionEnum density_initial_condition_type = param->flow_solver_param.density_initial_condition_type;
684  if(density_initial_condition_type == DensityInitialConditionEnum::uniform) {
685  return std::make_shared<InitialConditionFunction_TaylorGreenVortex<dim,nstate,real> >(
686  param);
687  } else if (density_initial_condition_type == DensityInitialConditionEnum::isothermal) {
688  return std::make_shared<InitialConditionFunction_TaylorGreenVortex_Isothermal<dim,nstate,real> >(
689  param);
690  }
691  }
692  } else if (flow_type == FlowCaseEnum::decaying_homogeneous_isotropic_turbulence) {
693  if constexpr (dim==3 && nstate==dim+2) return nullptr; // nullptr since DHIT case initializes values from file
694  } else if (flow_type == FlowCaseEnum::burgers_rewienski_snapshot) {
695  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersRewienski<dim,nstate,real> > ();
696  } else if (flow_type == FlowCaseEnum::burgers_viscous_snapshot) {
697  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersViscous<dim,nstate,real> > ();
698  } else if (flow_type == FlowCaseEnum::naca0012 || flow_type == FlowCaseEnum::gaussian_bump) {
699  if constexpr ((dim==2 || dim==3) && nstate==dim+2) {
701  param,
702  param->euler_param.ref_length,
703  param->euler_param.gamma_gas,
704  param->euler_param.mach_inf,
705  param->euler_param.angle_of_attack,
706  param->euler_param.side_slip_angle);
707  return std::make_shared<FreeStreamInitialConditions<dim,nstate,real>>(euler_physics_double);
708  }
709  } else if (flow_type == FlowCaseEnum::burgers_inviscid && param->use_energy==false) {
710  if constexpr (nstate==dim && dim<3) return std::make_shared<InitialConditionFunction_BurgersInviscid<dim, nstate, real> >();
711  } else if (flow_type == FlowCaseEnum::burgers_inviscid && param->use_energy==true) {
712  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersInviscidEnergy<dim,nstate,real> > ();
713  } else if (flow_type == FlowCaseEnum::advection && param->use_energy==true) {
714  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_AdvectionEnergy<dim,nstate,real> > ();
715  } else if (flow_type == FlowCaseEnum::advection && param->use_energy==false) {
716  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_Advection<dim,nstate,real> > ();
717  } else if (flow_type == FlowCaseEnum::convection_diffusion && !param->use_energy) {
718  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_ConvDiff<dim,nstate,real> > ();
719  } else if (flow_type == FlowCaseEnum::convection_diffusion && param->use_energy) {
720  return std::make_shared<InitialConditionFunction_ConvDiffEnergy<dim,nstate,real> > ();
721  } else if (flow_type == FlowCaseEnum::periodic_1D_unsteady) {
722  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_1DSine<dim,nstate,real> > ();
723  } else if (flow_type == FlowCaseEnum::isentropic_vortex) {
724  if constexpr (dim>1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_IsentropicVortex<dim,nstate,real> > (param);
725  } else if (flow_type == FlowCaseEnum::kelvin_helmholtz_instability) {
726  if constexpr (dim>1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_KHI<dim,nstate,real> > (param);
727  } else if (flow_type == FlowCaseEnum::non_periodic_cube_flow) {
728  if constexpr (dim==2 && nstate==1) return std::make_shared<InitialConditionFunction_Zero<dim,nstate,real> > ();
729  } else if (flow_type == FlowCaseEnum::sod_shock_tube) {
730  if constexpr (dim==1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_SodShockTube<dim,nstate,real> > (param);
731  } else if (flow_type == FlowCaseEnum::low_density_2d) {
732  if constexpr (dim==2 && nstate==dim+2) return std::make_shared<InitialConditionFunction_LowDensity2D<dim,nstate,real> > (param);
733  } else if (flow_type == FlowCaseEnum::leblanc_shock_tube) {
734  if constexpr (dim==1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_LeblancShockTube<dim,nstate,real> > (param);
735  } else if (flow_type == FlowCaseEnum::shu_osher_problem) {
736  if constexpr (dim == 1 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_ShuOsherProblem<dim, nstate, real> >(param);
737  } else if (flow_type == FlowCaseEnum::advection_limiter) {
738  if constexpr (dim < 3 && nstate == 1) return std::make_shared<InitialConditionFunction_Advection<dim, nstate, real> >();
739  } else if (flow_type == FlowCaseEnum::burgers_limiter) {
740  if constexpr (nstate==dim && dim<3) return std::make_shared<InitialConditionFunction_BurgersInviscid<dim, nstate, real> >();
741  }else {
742  std::cout << "Invalid Flow Case Type. You probably forgot to add it to the list of flow cases in initial_condition_function.cpp" << std::endl;
743  std::abort();
744  }
745  return nullptr;
746 }
747 
760 #if PHILIP_DIM==1
768 #endif
769 #if PHILIP_DIM==3
772 #endif
773 #if PHILIP_DIM>1
775 #endif
776 #if PHILIP_DIM==2
780 #endif
781 // functions instantiated for all dim
793 
794 } // PHiLiP namespace
InitialConditionFunction_1DSine()
< dealii::Function we are templating on
InitialConditionFunction_BurgersInviscidEnergy()
< dealii::Function we are templating on
FlowCaseType
Selects the flow case to be simulated.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
Initial Condition Function: Advection Energy.
Initial Condition Function: Taylor Green Vortex (isothermal density)
FlowCaseType flow_case_type
Selected FlowCaseType from the input file.
const double mach_inf
Farfield Mach number.
Definition: euler.h:113
real primitive_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition expressed in terms of primitive variables.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
const double angle_of_attack
Angle of attack.
Definition: euler.h:118
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
Initial Condition Function: 1D Burgers Viscous.
InitialConditionFunction_EulerBase(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
Initial Condition Function: 1D Sod Shock Tube.
InitialConditionFunction()
< dealii::Function we are templating on
bool use_energy
Flag to use an energy monotonicity test.
InitialConditionFunction_BurgersRewienski()
< dealii::Function we are templating on
InitialConditionFunction_TaylorGreenVortex_Isothermal(Parameters::AllParameters const *const param)
Constructor for TaylorGreenVortex_InitialCondition with isothermal density.
InitialConditionFunction_LeblancShockTube(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
Files for the baseline physics.
Definition: ADTypes.hpp:10
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition expressed in terms of conservative variables.
real primitive_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition expressed in terms of primitive variables.
Initial Condition Function: Euler Equations (primitive values)
const double side_slip_angle
Sideslip angle.
Definition: euler.h:122
Initial Condition Function: 1D Shu Osher Problem.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
Initial Condition Function: Convection Diffusion Orders of Accuracy.
real convert_primitive_to_conversative_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const
Converts value from: primitive to conservative.
Initial Condition Function: Isentropic vortex.
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
Main parameter class that contains the various other sub-parameter classes.
InitialConditionFunction_ShuOsherProblem(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
InitialConditionFunction_BurgersInviscid()
< dealii::Function we are templating on
InitialConditionFunction_LowDensity2D(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
virtual real density(const dealii::Point< dim, real > &point) const
Value of initial condition for density.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
InitialConditionFunction_ConvDiffEnergy()
< dealii::Function we are templating on
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Returns zero.
real density(const dealii::Point< dim, real > &point) const override
Value of initial condition for density.
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
Initial Condition Function: 1D Burgers Inviscid Energy.
Initial condition function factory.
real primitive_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition expressed in terms of primitive variables.
real primitive_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition expressed in terms of primitive variables.
real primitive_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const
Value of initial condition expressed in terms of primitive variables.
InitialConditionFunction_TaylorGreenVortex(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
Euler equations. Derived from PhysicsBase.
Definition: euler.h:78
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
Initial Condition Function: 1D Burgers Inviscid.
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
InitialConditionFunction_Advection()
< dealii::Function we are templating on
Initial Condition Function: 2D Low Density Euler.
Initial condition function used to initialize a particular flow setup/case.
Initial Condition Function: 1D Burgers Rewienski.
Kelvin-Helmholtz Instability, parametrized by Atwood number.
InitialConditionFunction_ConvDiff()
< dealii::Function we are templating on
InitialConditionFunction_SodShockTube(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
static std::shared_ptr< PhysicsBase< dim, nstate, real > > create_Physics(const Parameters::AllParameters *const parameters_input, std::shared_ptr< ModelBase< dim, nstate, real > > model_input=nullptr)
Factory to return the correct physics given input file.
InitialConditionFunction_AdvectionEnergy()
< dealii::Function we are templating on
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
InitialConditionFunction_BurgersViscous()
< dealii::Function we are templating on
InitialConditionFunction_KHI(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
Initial Condition Function: 1D Burgers Inviscid.
Initial Condition Function: 1D Leblanc Shock Tube.
DensityInitialConditionType
For taylor green vortex, selects the type of density initialization.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
const double ref_length
Reference length.
Definition: euler.h:104
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
Initial Condition Function: Taylor Green Vortex (uniform density)
InitialConditionFunction_Zero()
< dealii::Function we are templating on
Initial Condition Function: Convection Diffusion Energy.
static std::shared_ptr< InitialConditionFunction< dim, nstate, real > > create_InitialConditionFunction(Parameters::AllParameters const *const param)
Construct InitialConditionFunction object from global parameter file.
InitialConditionFunction_IsentropicVortex(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
DensityInitialConditionType density_initial_condition_type
Selected DensityInitialConditionType from the input file.