[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 nspecies, 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 // Turbulent Channel Flow -- Initial Condition (Laminar x-velocity)
21 // ========================================================
22 template <int dim, int nspecies, int nstate, typename real>
25  const Physics::NavierStokes<dim,nspecies,nstate,double> navier_stokes_physics_,
26  const double channel_friction_velocity_reynolds_number_,
27  const double domain_length_x_,
28  const double domain_length_y_,
29  const double domain_length_z_)
30  : InitialConditionFunction<dim,nspecies,nstate,real>()
31  , navier_stokes_physics(navier_stokes_physics_)
32  , channel_friction_velocity_reynolds_number(channel_friction_velocity_reynolds_number_)
33  , domain_length_x(domain_length_x_)
34  , domain_length_y(domain_length_y_)
35  , domain_length_z(domain_length_z_)
36  , channel_height(domain_length_y)
37  , half_channel_height(0.5*channel_height)
38 {}
39 
40 template <int dim, int nspecies, int nstate, typename real>
42 ::get_distance_from_wall(const dealii::Point<dim,real> &point) const
43 {
44  // Get closest wall normal distance
45  real y = point[1]; // y-coordinate of position
46  real dist_from_wall = half_channel_height; // represents distance normal to top/bottom wall (which ever is closer); y-domain bounds are [-half_channel_height, half_channel_height]
47  if(y > 0.0){
48  dist_from_wall -= y; // distance from top wall
49  } else if(y < 0.0) {
50  dist_from_wall += y; // distance from bottom wall
51  }
52  return dist_from_wall;
53 }
54 
55 template <int dim, int nspecies, int nstate, typename real>
57 ::x_velocity(const dealii::Point<dim,real> &point, const real /*density*/, const real /*temperature*/) const
58 {
59  // Laminar velocity profile
60  // Reference: G. LODATO, P. CASTONGUAY AND A. JAMESON, "Discrete filter operators for large-eddy simulation using high-order spectral difference methods", Int. J. Numer. Meth. Fluids (2012)
61  const real x_velocity = (15.0/8.0)*pow(1.0-pow(point[1]/half_channel_height,2.0),2.0);
62  return x_velocity;
63 }
64 
65 template <int dim, int nspecies, int nstate, typename real>
67 ::y_velocity(const dealii::Point<dim,real> &point) const
68 {
69  // Setup perturbed velocity
70  const real C = 0.1; // Reference: G. LODATO, P. CASTONGUAY AND A. JAMESON, "Discrete filter operators for large-eddy simulation using high-order spectral difference methods", Int. J. Numer. Meth. Fluids (2012)
71  const real x_loc = 0.0; // x-point at which to center the disturbance <-- Reference: R. Rossi / Journal of Computational Physics 228 (2009) 1639–1657
72  const real y_loc = 0.0; // y-point at which to center the disturbance <-- Reference: R. Rossi / Journal of Computational Physics 228 (2009) 1639–1657
73  const real pi_val = 3.141592653589793238;
74  const real beta = 4.0*pi_val; // Reference: G. LODATO, P. CASTONGUAY AND A. JAMESON, "Discrete filter operators for large-eddy simulation using high-order spectral difference methods", Int. J. Numer. Meth. Fluids (2012)
75  const real x_scale = domain_length_x;
76  const real y_scale = domain_length_y;
77  const real z_scale = domain_length_z;
78  const real half_domain_length_z = 0.5*domain_length_z;
79 
80  // extract coordinates
81  const real x = point[0];
82  const real y = point[1];
83  const real z = point[2];
84 
85  // return perturbed vertical velocity component
86  // Reference: Eq.(2.30) -- P. Andersson, L. Brandt, A. Bottaro and D. S. Henningson, "On the breakdown of boundary layer streaks"
87  // Reference for z_scale term: G. LODATO, P. CASTONGUAY AND A. JAMESON, "Discrete filter operators for large-eddy simulation using high-order spectral difference methods", Int. J. Numer. Meth. Fluids (2012)
88  const real F = C*exp(-pow((x-x_loc)/x_scale,2.0))*exp(-pow((y-y_loc)/y_scale,2.0))*cos(beta*(z+half_domain_length_z)/z_scale); // we do (z+half_domain_length_z) because reference has z\in[0,domain_length_z], whereas we center about the z-axis
89  return F;
90 }
91 
92 template <int dim, int nspecies, int nstate, typename real>
94 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
95 {
96  std::array<real,nstate> primitive_soln;
97 
98  //------------------------------------------------------
99  // density
100  //------------------------------------------------------
101  // Reference: L. Wei, A. Pollard / Computers & Fluids 47 (2011) 85–100
102  const real density = 1.0; // freestream non-dimensionalized
103  primitive_soln[0] = density;
104 
105  //------------------------------------------------------
106  // x-velocity
107  //------------------------------------------------------
108  // Reference: L. Wei, A. Pollard / Computers & Fluids 47 (2011) 85–100
109  const real temperature = navier_stokes_physics.isothermal_wall_temperature;
110  primitive_soln[1] = this->x_velocity(point,density,temperature);
111 
112  //------------------------------------------------------
113  // y-velocity
114  //------------------------------------------------------
115  primitive_soln[2] = y_velocity(point);
116 
117  //------------------------------------------------------
118  // z-velocity
119  //------------------------------------------------------
120  // Reference: R. Rossi / Journal of Computational Physics 228 (2009) 1639–1657
121  primitive_soln[3] = 0.0;
122 
123  //------------------------------------------------------
124  // pressure
125  //------------------------------------------------------
126  primitive_soln[4] = navier_stokes_physics.compute_pressure_from_density_temperature(density, temperature);
127 
128  //------------------------------------------------------
129  // --> Get conservative solution
130  //------------------------------------------------------
131  std::array<real,nstate> conservative_soln = navier_stokes_physics.convert_primitive_to_conservative(primitive_soln);
132 
133  return conservative_soln[istate];
134 }
135 
136 // ========================================================
137 // Turbulent Channel Flow -- Initial Condition (Turbulent x-velocity)
138 // ========================================================
139 template <int dim, int nspecies, int nstate, typename real>
142  const Physics::NavierStokes<dim,nspecies,nstate,double> navier_stokes_physics_,
143  const double channel_friction_velocity_reynolds_number_,
144  const double domain_length_x_,
145  const double domain_length_y_,
146  const double domain_length_z_)
147  : InitialConditionFunction_TurbulentChannelFlow<dim,nspecies,nstate,real>(
148  navier_stokes_physics_,
149  channel_friction_velocity_reynolds_number_,
150  domain_length_x_,
151  domain_length_y_,
152  domain_length_z_)
153 {}
154 
155 template <int dim, int nspecies, int nstate, typename real>
157 ::x_velocity(const dealii::Point<dim,real> &point, const real density, const real temperature) const
158 {
159  // Turbulent velocity profile using Reichart's law of the wall
160  // -- apply initial condition symmetrically w.r.t. the top/bottom walls of the channel
161  const real dist_from_wall = this->get_distance_from_wall(point);
162 
163  // Get the nondimensional (w.r.t. freestream) friction velocity
164  const real viscosity_coefficient = this->navier_stokes_physics.compute_viscosity_coefficient_from_temperature(temperature);
165  const real friction_velocity = viscosity_coefficient*this->channel_friction_velocity_reynolds_number/(density*this->half_channel_height*this->navier_stokes_physics.reynolds_number_inf);
166 
167  // Reichardt law of the wall (provides a smoothing between the linear and the log regions)
168  // References:
169  /* Frere, Carton de Wiart, Hillewaert, Chatelain, and Winckelmans
170  "Application of wall-models to discontinuous Galerkin LES", Phys. Fluids 29, 2017
171 
172  (Original paper) J. M. Osterlund, A. V. Johansson, H. M. Nagib, and M. H. Hites, “A note
173  on the overlap region in turbulent boundary layers,” Phys. Fluids 12, 1–4, (2000).
174  */
175  const real kappa = 0.38; // von Karman's constant
176  const real C = 4.1;
177  const real y_plus = this->navier_stokes_physics.reynolds_number_inf*density*friction_velocity*dist_from_wall/viscosity_coefficient;
178  const real u_plus = (1.0/kappa)*log(1.0+kappa*y_plus) + (C - (1.0/kappa)*log(kappa))*(1.0 - exp(-y_plus/11.0) - (y_plus/11.0)*exp(-y_plus/3.0));
179  const real x_velocity = u_plus*friction_velocity;
180  return x_velocity;
181 }
182 
183 // ========================================================
184 // Turbulent Channel Flow -- Initial Condition (Manufactured x-velocity)
185 // ========================================================
186 template <int dim, int nspecies, int nstate, typename real>
189  const Physics::NavierStokes<dim,nspecies,nstate,double> navier_stokes_physics_,
190  const double channel_friction_velocity_reynolds_number_,
191  const double domain_length_x_,
192  const double domain_length_y_,
193  const double domain_length_z_)
195  navier_stokes_physics_,
196  channel_friction_velocity_reynolds_number_,
197  domain_length_x_,
198  domain_length_y_,
199  domain_length_z_)
200 {}
201 
202 template <int dim, int nspecies, int nstate, typename real>
204 ::y_velocity(const dealii::Point<dim,real> &/*point*/) const
205 {
206  // Manufactured velocity profile so that it is purely based on the x-velocity
207  const real y_velocity = 0.0;
208  return y_velocity;
209 }
210 
211 // ========================================================
212 // NavierStokesBase -- Initial Condition
213 // ========================================================
214 template <int dim, int nspecies, int nstate, typename real>
217  Parameters::AllParameters const *const param)
218  : InitialConditionFunction<dim,nspecies,nstate,real>()
219  , gamma_gas(param->euler_param.gamma_gas)
220  , mach_inf(param->euler_param.mach_inf)
221  , mach_inf_sqr(mach_inf*mach_inf)
222 {
223  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
224  // Note that Euler primitive/conservative vars are the same as NS
225  PHiLiP::Parameters::AllParameters parameters_euler = *param;
226  parameters_euler.pde_type = Parameters::AllParameters::PartialDifferentialEquation::euler;
227  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,nspecies,dim+2,double>>(
229 }
230 
231 template <int dim, int nspecies, int nstate, typename real>
234  const dealii::Point<dim,real> &point, const unsigned int istate) const
235 {
236  real value = 0.0;
237 
238  std::array<real,nstate> soln_primitive;
239  for (int i=0; i<nstate; ++i){
240  soln_primitive[i] = primitive_value(point,i);
241  }
242  const std::array<real,nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
243  value = soln_conservative[istate];
244 
245  return value;
246 }
247 
248 template <int dim, int nspecies, int nstate, typename real>
250 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
251 {
252  real value = 0.0;
253  value = convert_primitive_to_conversative_value(point,istate);
254  return value;
255 }
256 
257 // ========================================================
258 // TAYLOR GREEN VORTEX -- Initial Condition (Uniform density)
259 // ========================================================
260 template <int dim, int nspecies, int nstate, typename real>
263  Parameters::AllParameters const *const param)
264  : InitialConditionFunction_NavierStokesBase<dim,nspecies,nstate,real>(param)
265 {}
266 
267 template <int dim, int nspecies, int nstate, typename real>
269 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
270 {
271  // Note: This is in non-dimensional form (free-stream values as reference)
272  real value = 0.;
273  if constexpr(dim == 3) {
274  const real x = point[0], y = point[1], z = point[2];
275 
276  if(istate==0) {
277  // density
278  value = this->density(point);
279  }
280  if(istate==1) {
281  // x-velocity
282  value = sin(x)*cos(y)*cos(z);
283  }
284  if(istate==2) {
285  // y-velocity
286  value = -cos(x)*sin(y)*cos(z);
287  }
288  if(istate==3) {
289  // z-velocity
290  value = 0.0;
291  }
292  if(istate==4) {
293  // pressure
294  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);
295  }
296  }
297  return value;
298 }
299 
300 template <int dim, int nspecies, int nstate, typename real>
302 ::density(const dealii::Point<dim,real> &/*point*/) const
303 {
304  // Note: This is in non-dimensional form (free-stream values as reference)
305  real value = 0.;
306  // density
307  value = 1.0;
308  return value;
309 }
310 
311 // ========================================================
312 // TAYLOR GREEN VORTEX -- Initial Condition (Isothermal density)
313 // ========================================================
314 template <int dim, int nspecies, int nstate, typename real>
317  Parameters::AllParameters const *const param)
318  : InitialConditionFunction_TaylorGreenVortex<dim,nspecies,nstate,real>(param)
319 {}
320 
321 template <int dim, int nspecies, int nstate, typename real>
323 ::density(const dealii::Point<dim,real> &point) const
324 {
325  // Note: This is in non-dimensional form (free-stream values as reference)
326  real value = 0.;
327  // density
328  value = this->primitive_value(point, 4); // get pressure
329  value *= this->gamma_gas*this->mach_inf_sqr;
330  return value;
331 }
332 
333 // ========================================================
334 // Dipole Wall Collision -- Initial Condition
335 // ========================================================
336 template <int dim, int nspecies, int nstate, typename real>
339  Parameters::AllParameters const *const param,
340  const real extremum_vorticity_value_,
341  const real dipole_radius,
342  const real dipole_axis_angle_wrt_x_axis_in_degrees)
343  : InitialConditionFunction_NavierStokesBase<dim,nspecies,nstate,real>(param)
344  , extremum_vorticity_value(extremum_vorticity_value_)
345  , r0(dipole_radius)
346  , x1(dipole_radius*cos(dipole_axis_angle_wrt_x_axis_in_degrees*(3.141592653589793238/180.0)))
347  , y1(dipole_radius*sin(dipole_axis_angle_wrt_x_axis_in_degrees*(3.141592653589793238/180.0)))
348  , x2(-dipole_radius*cos(dipole_axis_angle_wrt_x_axis_in_degrees*(3.141592653589793238/180.0)))
349  , y2(-dipole_radius*sin(dipole_axis_angle_wrt_x_axis_in_degrees*(3.141592653589793238/180.0)))
350 { }
351 
352 template <int dim, int nspecies, int nstate, typename real>
354 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
355 {
356  // Note: This is in non-dimensional form (free-stream values as reference)
357  real value = 0.;
358  if constexpr(dim == 2) {
359  const real x = point[0], y = point[1];
360  // corresponding radii (non-dimensional)
361  const real r1 = sqrt((x-this->x1)*(x-this->x1) + (y-this->y1)*(y-this->y1));
362  const real r2 = sqrt((x-this->x2)*(x-this->x2) + (y-this->y2)*(y-this->y2));
363 
364  if(istate==0) {
365  // density
366  value = 1.0;
367  }
368  if(istate==1) {
369  // x-velocity
370  value = -0.5*abs(extremum_vorticity_value)*(y-this->y1)*exp(-(r1/this->r0)*(r1/this->r0))
371  +0.5*abs(extremum_vorticity_value)*(y-this->y2)*exp(-(r2/this->r0)*(r2/this->r0));
372  }
373  if(istate==2) {
374  // y-velocity
375  value = 0.5*abs(extremum_vorticity_value)*(x-this->x1)*exp(-(r1/this->r0)*(r1/this->r0))
376  -0.5*abs(extremum_vorticity_value)*(x-this->x2)*exp(-(r2/this->r0)*(r2/this->r0));
377  }
378  if(istate==3) {
379  // pressure
380  value = 1.0/(this->gamma_gas*this->mach_inf_sqr)
381  - (1.0/16.0)*pow(this->extremum_vorticity_value*this->r0,2.0)*(exp(-2.0*(r1/this->r0)*(r1/this->r0))+exp(-2.0*(r2/this->r0)*(r2/this->r0)));
382  }
383  }
384  return value;
385 }
386 
387 // ========================================================
388 // Dipole Wall Collision Normal -- Initial Condition
389 // ========================================================
390 template <int dim, int nspecies, int nstate, typename real>
393  Parameters::AllParameters const *const param)
394  : InitialConditionFunction_DipoleWallCollision<dim,nspecies,nstate,real>(
395  param,
396  299.528385375226, // reference: Keetels G, D’Ortona U, Kramer W, Clercx H, Schneider K, Van Heijst G. Fourier spectral and wavelet solvers for the incompressible Navier–Stokes equations with volume-penalization: Convergence of a dipole-wall collision. J Comput Phys 2007;227(2):919–45.
397  0.1, // dipole radius
398  90.0) // dipole axis angle wrt to x-axis
399 {}
400 
401 // ========================================================
402 // Dipole Wall Collision Oblique -- Initial Condition
403 // ========================================================
404 template <int dim, int nspecies, int nstate, typename real>
407  Parameters::AllParameters const *const param)
408  : InitialConditionFunction_DipoleWallCollision<dim,nspecies,nstate,real>(
409  param,
410  299.528385375226, // reference: Keetels G, D’Ortona U, Kramer W, Clercx H, Schneider K, Van Heijst G. Fourier spectral and wavelet solvers for the incompressible Navier–Stokes equations with volume-penalization: Convergence of a dipole-wall collision. J Comput Phys 2007;227(2):919–45.
411  0.1, // dipole radius
412  30.0) // dipole axis angle wrt to x-axis
413 {}
414 
415 // ========================================================
416 // 1D BURGERS REWIENSKI -- Initial Condition
417 // ========================================================
418 template <int dim, int nspecies, int nstate, typename real>
421  : InitialConditionFunction<dim,nspecies,nstate,real>()
422 {
423  // Nothing to do here yet
424 }
425 
426 template <int dim, int nspecies, int nstate, typename real>
428 ::value(const dealii::Point<dim,real> &/*point*/, const unsigned int /*istate*/) const
429 {
430  real value = 1.0;
431  return value;
432 }
433 
434 // ========================================================
435 // 1D BURGERS VISCOUS -- Initial Condition
436 // ========================================================
437 template <int dim, int nspecies, int nstate, typename real>
440  : InitialConditionFunction<dim,nspecies,nstate,real>()
441 {
442  // Nothing to do here yet
443 }
444 
445 template <int dim, int nspecies, int nstate, typename real>
447 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
448 {
449  real value = 0;
450  if(point[0] >= 0 && point[0] <= 0.25){
451  value = sin(4*dealii::numbers::PI*point[0]);
452  }
453  return value;
454 
455 }
456 
457 // ========================================================
458 // 1D BURGERS Inviscid -- Initial Condition
459 // ========================================================
460 template <int dim, int nspecies, int nstate, typename real>
463  : InitialConditionFunction<dim,nspecies,nstate,real>()
464 {
465  // Nothing to do here yet
466 }
467 
468 template <int dim, int nspecies, int nstate, typename real>
470 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
471 {
472  real value = 1.0;
473  if constexpr(dim >= 1)
474  value *= cos(dealii::numbers::PI*point[0]);
475  if constexpr(dim >= 2)
476  value *= cos(dealii::numbers::PI*point[1]);
477  if constexpr(dim == 3)
478  value *= cos(dealii::numbers::PI*point[2]);
479 
480  return value;
481 }
482 
483 // ========================================================
484 // 1D BURGERS Inviscid Energy-- Initial Condition
485 // ========================================================
486 template <int dim, int nspecies, int nstate, typename real>
489  : InitialConditionFunction<dim,nspecies,nstate,real>()
490 {
491  // Nothing to do here yet
492 }
493 
494 template <int dim, int nspecies, int nstate, typename real>
496 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
497 {
498  real value = 1.0;
499  if constexpr(dim >= 1)
500  value *= sin(dealii::numbers::PI*point[0]);
501  if constexpr(dim >= 2)
502  value *= sin(dealii::numbers::PI*point[1]);
503  if constexpr(dim == 3)
504  value *= sin(dealii::numbers::PI*point[2]);
505 
506  value += 0.01;
507  return value;
508 }
509 
510 // ========================================================
511 // Advection -- Initial Condition
512 // ========================================================
513 template <int dim, int nspecies, int nstate, typename real>
516  : InitialConditionFunction<dim,nspecies,nstate,real>()
517 {
518  // Nothing to do here yet
519 }
520 
521 template <int dim, int nspecies, int nstate, typename real>
523 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
524 {
525  real value = 1.0;
526  if constexpr(dim >= 1)
527  value *= exp(-20.0*point[0]*point[0]);
528  if constexpr(dim >= 2)
529  value *= exp(-20.0*point[1]*point[1]);
530  if constexpr(dim == 3)
531  value *= exp(-20.0*point[2]*point[2]);
532 
533  return value;
534 }
535 
536 // ========================================================
537 // Advection OOA -- Initial Condition
538 // ========================================================
539 template <int dim, int nspecies, int nstate, typename real>
542  : InitialConditionFunction<dim,nspecies,nstate,real>()
543 {
544  // Nothing to do here yet
545 }
546 
547 template <int dim, int nspecies, int nstate, typename real>
549 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
550 {
551  real value = 1.0;
552  if constexpr(dim >= 1)
553  value *= sin(2.0*dealii::numbers::PI*point[0]);
554  if constexpr(dim >= 2)
555  value *= sin(2.0*dealii::numbers::PI*point[1]);
556  if constexpr(dim == 3)
557  value *= sin(2.0*dealii::numbers::PI*point[2]);
558 
559  return value;
560 }
561 
562 // ========================================================
563 // Convection_diffusion -- Initial Condition
564 // ========================================================
565 template <int dim, int nspecies, int nstate, typename real>
568  : InitialConditionFunction<dim,nspecies,nstate,real>()
569 {
570  // Nothing to do here yet
571 }
572 
573 template <int dim, int nspecies, int nstate, typename real>
575 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
576 {
577  real value = 1.0;
578  if constexpr(dim >= 1)
579  value *= sin(dealii::numbers::PI*point[0]);
580  if constexpr(dim >= 2)
581  value *= sin(dealii::numbers::PI*point[1]);
582  if constexpr(dim == 3)
583  value *= sin(dealii::numbers::PI*point[2]);
584 
585  return value;
586 }
587 
588 // ========================================================
589 // Convection_diffusion Energy -- Initial Condition
590 // ========================================================
591 template <int dim, int nspecies, int nstate, typename real>
594  : InitialConditionFunction<dim,nspecies,nstate,real>()
595 {
596  // Nothing to do here yet
597 }
598 
599 template <int dim, int nspecies, int nstate, typename real>
601 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
602 {
603  real value = 1.0;
604  if constexpr(dim >= 1)
605  value *= sin(dealii::numbers::PI*point[0]);
606  if constexpr(dim >= 2)
607  value *= sin(dealii::numbers::PI*point[1]);
608  if constexpr(dim == 3)
609  value *= sin(dealii::numbers::PI*point[2]);
610 
611  value += 0.1;
612 
613  return value;
614 }
615 
616 // ========================================================
617 // 1D SINE -- Initial Condition for advection_explicit_time_study
618 // ========================================================
619 template <int dim, int nspecies, int nstate, typename real>
622  : InitialConditionFunction<dim,nspecies,nstate,real>()
623 {
624  // Nothing to do here yet
625 }
626 
627 template <int dim, int nspecies, int nstate, typename real>
629 ::value(const dealii::Point<dim,real> &point, const unsigned int /*istate*/) const
630 {
631  real value = 0;
632  real pi = dealii::numbers::PI;
633  if(point[0] >= 0.0 && point[0] <= 2.0){
634  value = sin(2*pi*point[0]/2.0);
635  }
636  return value;
637 }
638 
639 // ========================================================
640 // Inviscid Isentropic Vortex
641 // ========================================================
642 template <int dim, int nspecies, int nstate, typename real>
645  Parameters::AllParameters const *const param)
646  : InitialConditionFunction<dim,nspecies,nstate,real>()
647 {
648  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
649  // This test should only be used for Euler
650  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,nspecies,dim+2,double>>(
652 }
653 
654 template <int dim, int nspecies, int nstate, typename real>
656 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
657 {
658  // Setting constants
659  const double pi = dealii::numbers::PI;
660  const double gam = 1.4;
661  const double M_infty = sqrt(2/gam);
662  const double R = 1;
663  const double sigma = 1;
664  const double beta = M_infty * 5 * sqrt(2.0)/4.0/pi * exp(1.0/2.0);
665  const double alpha = pi/4; //rad
666 
667  // Centre of the vortex at t=0
668  const double x0 = 0.0;
669  const double y0 = 0.0;
670  const double x = point[0] - x0;
671  const double y = point[1] - y0;
672 
673  const double Omega = beta * exp(-0.5/sigma/sigma* (x/R * x/R + y/R * y/R));
674  const double delta_Ux = -y/R * Omega;
675  const double delta_Uy = x/R * Omega;
676  const double delta_T = -(gam-1.0)/2.0 * Omega * Omega;
677 
678  // Primitive
679  std::array<real,nstate> soln_primitive;
680  soln_primitive[0] = pow((1 + delta_T), 1.0/(gam-1.0));
681  soln_primitive[1] = M_infty * cos(alpha) + delta_Ux;
682  soln_primitive[2] = M_infty * sin(alpha) + delta_Uy;
683  #if PHILIP_DIM==3
684  soln_primitive[3] = 0;
685  #endif
686  soln_primitive[nstate-1] = 1.0/gam*pow(1+delta_T, gam/(gam-1.0));
687 
688  const std::array<real,nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
689  return soln_conservative[istate];
690 }
691 
692 // ========================================================
693 // KELVIN-HELMHOLTZ INSTABILITY
694 // See Chan et al., On the entropy projection..., 2022, Pg. 15
695 // Note that some equations are not typed correctly
696 // See github.com/trixi-framework/paper-2022-robustness-entropy-projection
697 // for initial condition which is implemented herein
698 // ========================================================
699 template <int dim, int nspecies, int nstate, typename real>
702  Parameters::AllParameters const *const param)
703  : InitialConditionFunction<dim,nspecies,nstate,real>()
704  , atwood_number(param->flow_solver_param.atwood_number)
705 {
706  // Euler object; create using dynamic_pointer_cast and the create_Physics factory
707  // This test should only be used for Euler
708  this->euler_physics = std::dynamic_pointer_cast<Physics::Euler<dim,nspecies,dim+2,double>>(
710 }
711 
712 template <int dim, int nspecies, int nstate, typename real>
714 ::value(const dealii::Point<dim,real> &point, const unsigned int istate) const
715 {
716  const double pi = dealii::numbers::PI;
717 
718  const double B = 0.5 * (tanh(15*point[1] + 7.5) - tanh(15*point[1] - 7.5));
719 
720  const double rho1 = 0.5;
721  const double rho2 = rho1 * (1 + atwood_number) / (1 - atwood_number);
722 
723  std::array<real,nstate> soln_primitive;
724  soln_primitive[0] = rho1 + B * (rho2-rho1);
725  soln_primitive[nstate-1] = 1;
726  soln_primitive[1] = B - 0.5;
727  soln_primitive[2] = 0.1 * sin(2 * pi * point[0]);
728 
729  const std::array<real,nstate> soln_conservative = this->euler_physics->convert_primitive_to_conservative(soln_primitive);
730  return soln_conservative[istate];
731 }
732 
733 // ========================================================
734 // Initial Condition - Real Gas Base
735 // ========================================================
736 template <int dim, int nspecies, int nstate, typename real>
739  Parameters::AllParameters const* const param)
740  : InitialConditionFunction<dim, nspecies, nstate, real>()
741 {
742  // Real Gas object; create using dynamic_pointer_cast and the create_Physics factory
743  PHiLiP::Parameters::AllParameters parameters_real_gas = *param;
744  parameters_real_gas.pde_type = Parameters::AllParameters::PartialDifferentialEquation::real_gas;
745  this->real_gas_physics = std::dynamic_pointer_cast<Physics::RealGas<dim,nspecies,dim+nspecies+1,double>>(
747 }
748 
749 template <int dim, int nspecies, int nstate, typename real>
752  const dealii::Point<dim, real>& point, const unsigned int istate) const
753 {
754  real value = 0.0;
755  std::array<real, nstate> soln_primitive;
756 
757  for(int istate = 0; istate < nstate; ++istate) {
758  soln_primitive[istate] = primitive_value(point, istate);
759  }
760 
761  const std::array<real, nstate> soln_conservative = this->real_gas_physics->convert_primitive_to_conservative(soln_primitive);
762  value = soln_conservative[istate];
763 
764  return value;
765 }
766 
767 template <int dim, int nspecies, int nstate, typename real>
769 ::value(const dealii::Point<dim, real>& point, const unsigned int istate) const
770 {
771  real value = 0.0;
772  value = convert_primitive_to_conversative_value(point, istate);
773  return value;
774 }
775 
776 // ========================================================
777 // 1D Sod Shock tube -- Initial Condition
778 // See Chen & Shu, Entropy stable high order..., 2017, Pg. 25
779 // 2D and 3D can be run by extruding grid in those directions
780 // ========================================================
781 template <int dim, int nspecies, int nstate, typename real>
784  Parameters::AllParameters const* const param)
785  : InitialConditionFunction_NavierStokesBase<dim,nspecies,nstate,real>(param)
786 {}
787 
788 template <int dim, int nspecies, int nstate, typename real>
790 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
791 {
792  real value = 0.0;
793  if constexpr (dim == 1 && nstate == (dim+2)) {
794  const real x = point[0];
795  if (x < 0) {
796  if (istate == 0) {
797  // density
798  value = 1.0;
799  }
800  if (istate == nstate - 1) {
801  // pressure
802  value = 1.0;
803  }
804  } else {
805  if (istate == 0) {
806  // density
807  value = 0.125;
808  }
809  if (istate == nstate - 1) {
810  // pressure
811  value = 0.1;
812  }
813  }
814  }
815 
816  return value;
817 }
818 
819 // ========================================================
820 // 1D Leblanc Shock tube -- Initial Condition
821 // See Zhang & Shu, On positivity-preserving..., 2010 Pg. 14
822 // ========================================================
823 template <int dim, int nspecies, int nstate, typename real>
826  Parameters::AllParameters const* const param)
827  : InitialConditionFunction_NavierStokesBase<dim,nspecies,nstate,real>(param)
828 {}
829 
830 template <int dim, int nspecies, int nstate, typename real>
832 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
833 {
834  real value = 0.0;
835  if constexpr (dim == 1 && nstate == (dim + 2)) {
836  const real x = point[0];
837  if (x < 0) {
838  if (istate == 0) {
839  // density
840  value = 2.0;
841  }
842  if (istate == 1) {
843  // x-velocity
844  value = 0.0;
845  }
846  if (istate == 2) {
847  // pressure
848  value = pow(10.0, 9.0);
849  }
850  }
851  else {
852  if (istate == 0) {
853  // density
854  value = 0.001;
855  }
856  if (istate == 1) {
857  // x-velocity
858  value = 0.0;
859  }
860  if (istate == 2) {
861  // pressure
862  value = 1.0;
863  }
864  }
865  }
866  return value;
867 }
868 
869 // ========================================================
870 // 1D Shu-Osher Problem -- Initial Condition
871 // See Johnsen et al., Assessment of high-resolution..., 2010 Pg. 7
872 // ========================================================
873 template <int dim, int nspecies, int nstate, typename real>
876  Parameters::AllParameters const* const param)
877  : InitialConditionFunction_NavierStokesBase<dim,nspecies,nstate,real>(param)
878 {}
879 
880 template <int dim, int nspecies, int nstate, typename real>
882 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
883 {
884  real value = 0.0;
885  if constexpr (dim == 1 && nstate == (dim + 2)) {
886  const real x = point[0];
887  if (x < -4) {
888  if (istate == 0) {
889  // density
890  value = 3.857143;
891  }
892  else if (istate == 1) {
893  // x-velocity
894  value = 2.629369;
895  }
896  else if (istate == 2) {
897  // pressure
898  value = 10.33333;
899  }
900  }
901  else {
902  if (istate == 0) {
903  // density
904  value = 1 + 0.2 * sin(5 * x);
905  }
906  else if (istate == 1) {
907  // x-velocity
908  value = 0.0;
909  }
910  else if (istate == 2) {
911  // pressure
912  value = 1.0;
913  }
914  }
915  }
916  return value;
917 }
918 
919 // =====================================================================
920 // Low Density Euler -- Initial Condition
921 // See Dzanic & Martinelli, High-order limiting..., 2025, Pg. 15
922 // =====================================================================
923 template <int dim, int nspecies, int nstate, typename real>
926  Parameters::AllParameters const* const param)
927  : InitialConditionFunction_NavierStokesBase<dim, nspecies, nstate, real>(param)
928 {}
929 
930 template <int dim, int nspecies, int nstate, typename real>
932 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
933 {
934  real value = 0.0;
935  if constexpr (dim == 1 && nstate == (dim + 2)) {
936  const real x = point[0];
937  if (istate == 0) {
938  // density
939  value = 0.01 + exp(-500.0*pow(x,2.0));
940  }
941  else {
942  value = 1.0;
943  }
944  }
945 
946  if constexpr (dim == 2 && nstate == (dim + 2)) {
947  const real x = point[0];
948  const real y = point[1];
949 
950  if (istate == 0) {
951  // density
952  value = 0.01 + exp(-500.0*(pow(x, 2.0)+pow(y, 2.0)));
953  }
954  else {
955  // x-velocity
956  value = 1.0;
957  }
958  }
959  return value;
960 }
961 
962 // ==================================================================
963 // Double Mach Reflection Problem (2D) -- Initial Condition
964 // See Lin, Chan, and Tomas. "A positivity preserving ...", 2023, p20
965 // ==================================================================
966 template <int dim, int nspecies, int nstate, typename real>
969  Parameters::AllParameters const* const param)
970  : InitialConditionFunction_NavierStokesBase<dim, nspecies, nstate, real>(param)
971 {}
972 
973 template <int dim, int nspecies, int nstate, typename real>
975 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
976 {
977  real value = 0.0;
978  if constexpr (dim == 2 && nstate == (dim + 2)) {
979  const real x = point[0];
980  const real y = point[1];
981  if (y > sqrt(3)*(x - (1.0/6.0))) {
982  if (istate == 0) {
983  // density
984  value = 8.0;
985  }
986  else if (istate == 1) {
987  // x-velocity
988  value = 33.0*sqrt(3.0)/8.0;
989  }
990  else if (istate == 2) {
991  // y-velocity
992  value = -33.0/8.0;
993  }
994  else if (istate == 3) {
995  // pressure
996  value = 116.5;
997  }
998  }
999  else {
1000  if (istate == 0) {
1001  // density
1002  value = 1.4;
1003  }
1004  else if (istate == 1) {
1005  // x-velocity
1006  value = 0.0;
1007  }
1008  else if (istate == 2) {
1009  // y-velocity
1010  value = 0.0;
1011  }
1012  else if (istate == 3) {
1013  // pressure
1014  value = 1.0;
1015  }
1016  }
1017  }
1018  return value;
1019 }
1020 
1021 // ========================================================
1022 // Shock Diffraction (backwards facing step) (2D) -- Initial Condition
1023 // See Zhang & Shu, On positivity-preserving..., 2010 Pg. 15
1024 // ========================================================
1025 template <int dim, int nspecies, int nstate, typename real>
1028  Parameters::AllParameters const* const param)
1029  : InitialConditionFunction_NavierStokesBase<dim, nspecies, nstate, real>(param)
1030 {}
1031 
1032 template <int dim, int nspecies, int nstate, typename real>
1034 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
1035 {
1036  real value = 0.0;
1037  const real x = point[0];
1038  //real y = point[1];
1039  if constexpr (dim == 2 && nstate == (dim + 2)) {
1040  if (x <= 0.5) {
1041  if (istate == 0) {
1042  // density
1043  value = 7.041132906907898;
1044  }
1045  else if (istate == 1) {
1046  // x-velocity
1047  value = 4.07794695481336;
1048  }
1049  else if (istate == 2) {
1050  // y-velocity
1051  value = 0.0;
1052  }
1053  else if (istate == 3) {
1054  // pressure
1055  value = 30.05945;
1056  }
1057  }
1058  else {
1059  if (istate == 0) {
1060  // density
1061  value = 1.4;
1062  }
1063  else if (istate == 1) {
1064  // x-velocity
1065  value = 0.0;
1066  }
1067  else if (istate == 2) {
1068  // y-velocity
1069  value = 0.0;
1070  }
1071  else if (istate == 3) {
1072  // pressure
1073  value = 1.0;
1074  }
1075  }
1076  }
1077  return value;
1078 }
1079 
1080 
1081 // ========================================================
1082 // Astrophysical Mach Jet (2D) -- Initial Condition
1083 // See Zhang & Shu, On positivity-preserving..., 2010 Pg. 14
1084 // ========================================================
1085 template <int dim, int nspecies, int nstate, typename real>
1088  Parameters::AllParameters const* const param)
1089  : InitialConditionFunction_NavierStokesBase<dim, nspecies, nstate, real>(param)
1090 {}
1091 
1092 template <int dim, int nspecies, int nstate, typename real>
1094 ::primitive_value(const dealii::Point<dim, real>& /*point*/, const unsigned int istate) const
1095 {
1096  real value = 0.0;
1097  if constexpr (dim == 2 && nstate == (dim + 2)) {
1098 
1099  if (istate == 0) {
1100  // density
1101  value = 0.5;
1102  }
1103  else if (istate == 1) {
1104  // x-velocity
1105  value = 0.0;
1106  }
1107  else if (istate == 2) {
1108  // y-velocity
1109  value = 0.0;
1110  }
1111  else if (istate == 3) {
1112  // pressure
1113  value = 0.4127;
1114  }
1115  }
1116  return value;
1117 }
1118 
1119 
1120 // ========================================================
1121 // Strong Vortex Shock Wave Interaction (2D) -- Initial Condition
1122 // See High Fidelity CFD Workshop 2022
1123 // Unsteady Supersonic/Hypersonic Test Suite
1124 // ========================================================
1125 template <int dim, int nspecies, int nstate, typename real>
1128  Parameters::AllParameters const* const param)
1129  : InitialConditionFunction_NavierStokesBase<dim, nspecies, nstate, real>(param)
1130 {}
1131 
1132 template <int dim, int nspecies, int nstate, typename real>
1134 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
1135 {
1136  real value = 0.0;
1137  const real x = point[0];
1138  const real y = point[1];
1139 
1140  if constexpr (dim == 2 && nstate == (dim + 2)) {
1141  // Ideal gas
1142  const real gamma = 1.4;
1143  const real R = 1.0;
1144 
1145  // Upstream conditions
1146  const real rho_u = 1.0;
1147  const real u_u = 1.5*sqrt(1.4);
1148  const real v_u = 0.0;
1149  const real p_u = 1.0;
1150  const real t_u = p_u/(rho_u*R);
1151 
1152 
1153 
1154  // Shock condition
1155  const real M_s = 1.5;
1156 
1157  // Downstream conditions
1158  const real rho_d = (rho_u * (gamma + 1.0) * M_s * M_s) / (2.0 + (gamma - 1.0) * M_s * M_s);
1159  const real u_d = (u_u * (2.0 + ((gamma - 1.0) * M_s * M_s)))/((gamma + 1.0) * M_s * M_s);
1160  const real v_d = 0.0;
1161  const real p_d = p_u * (1.0 + (2.0 * gamma / (gamma + 1.0)) * (M_s * M_s - 1.0));
1162 
1163  if (x <= 0.5){
1164  if (istate == 0) {
1165  // density
1166  value = rho_u;
1167  }
1168  else if (istate == 1) {
1169  // x-velocity
1170  value = u_u;
1171  }
1172  else if (istate == 2) {
1173  // y-velocity
1174  value = v_u;
1175  }
1176  else if (istate == 3) {
1177  // pressure
1178  value = p_u;
1179  }
1180  } else {
1181  if (istate == 0) {
1182  // density
1183  value = rho_d;
1184  }
1185  else if (istate == 1) {
1186  // x-velocity
1187  value = u_d;
1188  }
1189  else if (istate == 2) {
1190  // y-velocity
1191  value = v_d;
1192  }
1193  else if (istate == 3) {
1194  // pressure
1195  value = p_d;
1196  }
1197  }
1198 
1199  if(x <= 0.5) {
1200  // Vortex location
1201  const real x_c = 0.25; const real y_c = 0.5;
1202 
1203  // Vortex sizes
1204  const real a = 0.075; const real b = 0.175;
1205 
1206  // Vortex strength
1207  const real M_v = 0.9; const real v_m = M_v * sqrt(gamma);
1208 
1209  // Distance from vortex
1210  const real dx = x - x_c;
1211  const real dy = y - y_c;
1212  const real r = sqrt((dx*dx) + (dy*dy));
1213 
1214  real temperature = 0.0;
1215 
1216  // Superimpose vortex
1217  if (r<=b) {
1218  const double sin_theta = dy/r;
1219  const double cos_theta = dx/r;
1220 
1221  if (r<=a) {
1222  const real mag = v_m * r / a;
1223  if(istate == 1)
1224  value = u_u - mag*sin_theta;
1225  else if(istate == 2)
1226  value = v_u + mag*cos_theta;
1227  else {
1228  // Temperature at a, integrated from ODE
1229  real radial_term = -2.0 * b * b * log(b) - (0.5 * a * a) + (2.0 * b * b * log(a)) + (0.5 * b * b * b * b / (a * a));
1230  const real t_a = t_u - (gamma - 1.0) * pow(v_m * a / (a * a - b * b), 2.0) * radial_term / (R * gamma);
1231  radial_term = 0.5 * (1.0 - r * r / (a * a));
1232  temperature = t_a - (gamma - 1.0) * v_m * v_m * radial_term / (R * gamma);
1233  }
1234  } else {
1235  const real mag = v_m * a * (r - b * b / r)/(a * a - b * b);
1236  if(istate == 1)
1237  value = u_u - mag * sin_theta;
1238  else if (istate == 2)
1239  value = v_u + mag * cos_theta;
1240  else {
1241  const real radial_term = -2.0 * b * b * log(b) - (0.5 * r * r) + (2.0 * b * b * log(r)) + (0.5 * b * b * b * b / (r * r));
1242  temperature = t_u - (gamma - 1.0) * pow(v_m * a/(a * a - b * b), 2.0) * radial_term / (R * gamma);
1243  }
1244  }
1245 
1246  if (istate == 0)
1247  value = rho_u * pow(temperature/t_u, 1.0/(gamma - 1.0));
1248  else if (istate == 3)
1249  value = p_u * pow(temperature/t_u, gamma/(gamma - 1.0));
1250  }
1251  }
1252  }
1253  return value;
1254 }
1255 
1256 // ========================================================
1257 // Multispecies Vortex advection (Multispecies) -- Initial Condition
1258 // ========================================================
1259 template <int dim, int nspecies, int nstate, typename real>
1262  Parameters::AllParameters const *const param, bool high_temperature)
1264  , use_high_temp_ic(high_temperature)
1265 {}
1266 
1267 template <int dim, int nspecies, int nstate, typename real>
1269 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
1270 {
1271  // Note: This is in non-dimensional form (free-stream values as reference)
1272  real value = 0.0;
1273  const real x = point[0];
1274  const real x_0 = 5.0;
1275  real y = 0.0; real y_0 = 0.0; real z = 0.0; real z_0 = 0.0;
1276  if (dim > 1){
1277  y = point[1];
1278  y_0 = 5.0;
1279  }
1280  if (dim > 2){
1281  z = point[2];
1282  z_0 = 5.0;
1283  }
1284  const real r = sqrt(pow(x-x_0,2.0) + pow(y-y_0,2.0) + pow(z-z_0,2.0));
1285  const real T_0 = 300.0; // [K]
1286  const real big_gamma = 50.0;
1287  const real gamma_0 = 1.4;
1288  const real y_H2_0 = 0.01277;
1289  const real a_1 = 0.005;
1290  const real pi = dealii::numbers::PI;
1291 
1292  real pressure = 101325; // [N/m^2]
1293  if(this->use_high_temp_ic) pressure *= 5.0;
1294 
1295  const real velocity = 100.0; // [m/s]
1296  const real exp = std::exp(0.50*(1-r*r));
1297  const real coeff = 2*pi/(gamma_0*big_gamma);
1298 
1299  real temperature = T_0 - (gamma_0-1.0)*big_gamma*big_gamma/(8.0*gamma_0*pi)*exp;
1300  if(this->use_high_temp_ic) temperature *= 5.0;
1301 
1302  const real y_H2 = (y_H2_0 - a_1*coeff*exp);
1303 
1304  const std::array<real,nspecies> Rs = this->real_gas_physics->compute_Rs(this->real_gas_physics->Ru);
1305  real y_O2;
1306  real R_mixture;
1307  // For a 2 species test
1308  if constexpr(nspecies==2 && nstate==dim+nspecies+1) {
1309  y_O2 = 1.0 - y_H2;
1310  R_mixture = (y_H2*Rs[0] + y_O2*Rs[1])*this->real_gas_physics->R_ref;
1311  }
1312  // For a 3 species test
1313  if constexpr(nspecies==3 && nstate==dim+nspecies+1) {
1314  const real y_O2_0 = 0.101;
1315  const real a_2 = 0.03;
1316  y_O2 = (y_O2_0 - a_2*coeff*exp);
1317  const real y_N2 = 1.0 - y_H2 - y_O2;
1318  R_mixture = (y_H2*Rs[0] + y_O2*Rs[1] + y_N2*Rs[2])*this->real_gas_physics->R_ref;
1319  }
1320  const real density = pressure/(R_mixture*temperature);
1321 
1322  // dimensionalized above, non-dimensionalized below
1323  if(istate==0) {
1324  // mixture density
1325  value = density / this->real_gas_physics->density_ref;
1326  }
1327  if(istate==1) {
1328  // x-velocity
1329  value = velocity / this->real_gas_physics->u_ref;
1330  }
1331  if(dim==2 && istate==2) {
1332  // y-velocity
1333  value = velocity / this->real_gas_physics->u_ref;
1334  }
1335  if(dim==3 && istate==3) {
1336  // z-velocity
1337  value = velocity / this->real_gas_physics->u_ref;
1338  }
1339  if(istate==dim+1) {
1340  // pressure
1341  value = pressure / (this->real_gas_physics->density_ref*this->real_gas_physics->u_ref_sqr);
1342  }
1343  if(istate==dim+2){
1344  // other species density (N2)
1345  value = y_H2;
1346  }
1347  if(nspecies==3 && istate==dim+3){
1348  // other species density (O2)
1349  value = y_O2;
1350  }
1351 
1352  return value;
1353 }
1354 
1355 // ========================================================
1356 // 1D Multispecies Sod Shock tube -- Initial Condition
1357 // See Partial characteristic decomposition for multi-species..
1358 // Wang et al 2019
1359 // ========================================================
1360 template <int dim, int nspecies, int nstate, typename real>
1363  Parameters::AllParameters const* const param)
1365 {}
1366 
1367 template <int dim, int nspecies, int nstate, typename real>
1369 ::primitive_value(const dealii::Point<dim, real>& point, const unsigned int istate) const
1370 {
1371  // Note: This is in non-dimensional form (free-stream values as reference)
1372  real value = 0.0;
1373  if constexpr(dim==1) {
1374  const real x = point[0];
1375 
1376  if (x <= 0.5) {
1377  if(istate == 0) {
1378  //density
1379  value = 1.0;
1380  }
1381  else if (istate == 1) {
1382  //velocity
1383  value = 0.0;
1384  }
1385  else if (istate == 2) {
1386  //pressure
1387  value = 1.0;
1388  }
1389  else if (istate == 3) {
1390  //Y_O2
1391  value = 0.21;
1392  //Y_O2 from Ayoub Gouasmi's Ph.D. thesis
1393  // value = 1.0;
1394  }
1395  } else {
1396  if(istate == 0) {
1397  //density
1398  value = 0.125;
1399  }
1400  else if (istate == 1) {
1401  //velocity
1402  value = 0.0;
1403  }
1404  else if (istate == 2) {
1405  //pressure
1406  value = 0.1;
1407  }
1408  else if (istate == 3) {
1409  //Y_O2
1410  value = 0.21;
1411  //Y_O2 from Ayoub Gouasmi's Ph.D. thesis
1412  // value = 0.;
1413  }
1414  }
1415  }
1416  return value;
1417 }
1418 
1419 // =============================================================
1420 // Multispecies Isentropic Vortex -- Initial Condition
1421 // =============================================================
1422 template <int dim, int nspecies, int nstate, typename real>
1425  Parameters::AllParameters const *const param)
1427 {}
1428 
1429 template <int dim, int nspecies, int nstate, typename real>
1431 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
1432 {
1433  // Note: This is in non-dimensional form (free-stream values as reference)
1434  real value = 0.;
1435  if constexpr(dim == 2) {
1436  const real x = point[0];
1437  const real y = point[1];
1438 
1439  // constant value
1440  const real x_0 = 0.0;
1441  const real y_0 = 0.0;
1442  const real beta = 13.5;
1443  const real radius = 1.5;
1444  const real U_0 = 0.0;
1445  const real V_0 = 1.0;
1446  const real M = 0.40;
1447  const real pi = dealii::numbers::PI;
1448  const real L = 10.0;
1449  const real alpha_N2 = 0.50*sin(pi/L*(x-x_0))+0.50;
1450  const real alpha_O2 = 1.0 - alpha_N2;
1451  const real mixture_gamma = 1.4;
1452 
1453  const real f = (1.0 - (x-x_0)*(x-x_0) - (y-y_0)*(y-y_0)) / (2.0*radius*radius);
1454  const real density_N2 = alpha_N2*pow( (1.0 - ((mixture_gamma-1.0)*beta*beta*M*M/(8.0*pi*pi))*exp(2.0*f)), 1.0/(mixture_gamma-1.0) );
1455  const real density_O2 = alpha_O2*pow( (1.0 - ((mixture_gamma-1.0)*beta*beta*M*M/(8.0*pi*pi))*exp(2.0*f)), 1.0/(mixture_gamma-1.0) );
1456  const real mixture_density = density_N2 + density_O2;
1457  const real u = U_0 + beta*y/(2.0*pi*radius)*exp(f);
1458  const real v = V_0 - beta*x/(2.0*pi*radius)*exp(f);
1459 
1460  const real mixture_pressure = 1.0/(mixture_gamma*M*M)*pow(mixture_density,mixture_gamma);
1461 
1462  // non-dimensionalized values above, non-dimensionalized values below
1463  if(istate==0) {
1464  // mixture density
1465  value = mixture_density;
1466  }
1467  if(istate==1) {
1468  // x-velocity
1469  value = u;
1470  }
1471  if(istate==2) {
1472  // y-velocity
1473  value = v;
1474  }
1475  if(istate==3) {
1476  // pressure
1477  value = mixture_pressure;
1478  }
1479  if(istate==4){
1480  // other species density (N2)
1481  value = density_N2/mixture_density;
1482  }
1483  }
1484  return value;
1485 }
1486 
1487 // ========================================================
1488 // TAYLOR GREEN VORTEX -- Initial Condition (Uniform density)
1489 // ========================================================
1490 template <int dim, int nspecies, int nstate, typename real>
1493  Parameters::AllParameters const *const param, const bool use_smooth_interface)
1494  : InitialConditionFunction_RealGasBase<dim, nspecies, nstate, real>(param)
1495  , gamma_gas(param->euler_param.gamma_gas)
1496  , mach_inf(param->euler_param.mach_inf)
1497  , mach_inf_sqr(mach_inf*mach_inf)
1498  , smooth_interface(use_smooth_interface)
1499 {}
1500 template <int dim, int nspecies, int nstate, typename real>
1502 ::primitive_value(const dealii::Point<dim,real> &point, const unsigned int istate) const
1503 {
1504  // Note: This is in non-dimensional form (free-stream values as reference)
1505  real value = 0.;
1506  if constexpr(dim == 3) {
1507  const real x = point[0], y = point[1], z = point[2];
1508 
1509  if(istate==0) {
1510  // density
1511  value = 1.0;
1512  }
1513  if(istate==1) {
1514  // x-velocity
1515  value = sin(x)*cos(y)*cos(z);
1516  }
1517  if(istate==2) {
1518  // y-velocity
1519  value = -cos(x)*sin(y)*cos(z);
1520  }
1521  if(istate==3) {
1522  // z-velocity
1523  value = 0.0;
1524  }
1525  if(istate==4) {
1526  // pressure
1527  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);
1528  }
1529  if(istate==5) {
1530  //mass fraction, O2
1531  value = this->mass_fraction(point);
1532  }
1533  }
1534  return value;
1535 }
1536 
1537 template <int dim, int nspecies, int nstate, typename real>
1539 ::mass_fraction(const dealii::Point<dim,real> &point) const
1540 {
1541  // Note: This is in non-dimensional form (free-stream values as reference)
1542  real value = 0.;
1543  real pi = dealii::numbers::PI;
1544  const real x = point[0], y = point[1], z = point[2];
1545 
1546  // species density, O2
1547  if(this->smooth_interface)
1548  value = 0.5 + (1.0/16.0)*(cos(x)+1)*(cos(y)+1)*(cos(z)+1);
1549  else
1550  value = 0.5 + (1.0/4.0)*tanh(1000.0*(x-pi))*tanh(1000.0*(y-pi))*tanh(1000.0*(z-pi));
1551 
1552  return value;
1553 }
1554 
1555 // ========================================================
1556 // ZERO INITIAL CONDITION
1557 // ========================================================
1558 template <int dim, int nspecies, int nstate, typename real>
1561  : InitialConditionFunction<dim,nspecies,nstate,real>()
1562 {
1563  // Nothing to do here yet
1564 }
1565 
1566 template <int dim, int nspecies, int nstate, typename real>
1568 ::value(const dealii::Point<dim,real> &/*point*/, const unsigned int /*istate*/) const
1569 {
1570  return 0.0;
1571 }
1572 
1573 // =========================================================
1574 // Initial Condition Factory
1575 // =========================================================
1576 template <int dim, int nspecies, int nstate, typename real>
1577 std::shared_ptr<InitialConditionFunction<dim, nspecies, nstate, real>>
1579  Parameters::AllParameters const *const param)
1580 {
1581  // Get the flow case type
1582  const FlowCaseEnum flow_type = param->flow_solver_param.flow_case_type;
1583  if (flow_type == FlowCaseEnum::taylor_green_vortex) {
1584  if constexpr (dim==3 && nstate==dim+2){
1585  // Get the density initial condition type
1586  const DensityInitialConditionEnum density_initial_condition_type = param->flow_solver_param.density_initial_condition_type;
1587  if(density_initial_condition_type == DensityInitialConditionEnum::uniform) {
1588  return std::make_shared<InitialConditionFunction_TaylorGreenVortex<dim,nspecies,nstate,real> >(
1589  param);
1590  } else if (density_initial_condition_type == DensityInitialConditionEnum::isothermal) {
1591  return std::make_shared<InitialConditionFunction_TaylorGreenVortex_Isothermal<dim,nspecies,nstate,real> >(
1592  param);
1593  }
1594  }
1595  } else if (flow_type == FlowCaseEnum::dipole_wall_collision_normal) {
1596  if constexpr (dim==2 && nstate==dim+2){
1597  return std::make_shared<InitialConditionFunction_DipoleWallCollision_Normal<dim,nspecies,nstate,real> >(
1598  param);
1599  }
1600  } else if (flow_type == FlowCaseEnum::dipole_wall_collision_oblique) {
1601  if constexpr (dim==2 && nstate==dim+2){
1602  return std::make_shared<InitialConditionFunction_DipoleWallCollision_Oblique<dim,nspecies,nstate,real> >(
1603  param);
1604  }
1605  } else if (flow_type == FlowCaseEnum::decaying_homogeneous_isotropic_turbulence) {
1606  if constexpr (dim==3 && nstate==dim+2) return nullptr; // nullptr since DHIT case initializes values from file
1607  } else if (flow_type == FlowCaseEnum::burgers_rewienski_snapshot) {
1608  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersRewienski<dim,nspecies,nstate,real> > ();
1609  } else if (flow_type == FlowCaseEnum::burgers_viscous_snapshot) {
1610  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersViscous<dim,nspecies,nstate,real> > ();
1611  } else if (flow_type == FlowCaseEnum::naca0012 || flow_type == FlowCaseEnum::gaussian_bump || flow_type == FlowCaseEnum::turbulent_airfoil_3D) {
1612  if constexpr ((dim==2 || dim==3) && nstate==dim+2) {
1614  param,
1615  param->euler_param.ref_length,
1616  param->euler_param.gamma_gas,
1617  param->euler_param.mach_inf,
1618  param->euler_param.angle_of_attack,
1619  param->euler_param.side_slip_angle);
1620  return std::make_shared<FreeStreamInitialConditions<dim,nspecies,nstate,real>>(euler_physics_double);
1621  }
1622  } else if (flow_type == FlowCaseEnum::burgers_inviscid && param->use_energy==false) {
1623  if constexpr (nstate==dim && dim<3) return std::make_shared<InitialConditionFunction_BurgersInviscid<dim, nspecies, nstate, real> >();
1624  } else if (flow_type == FlowCaseEnum::burgers_inviscid && param->use_energy==true) {
1625  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_BurgersInviscidEnergy<dim,nspecies,nstate,real> > ();
1626  } else if (flow_type == FlowCaseEnum::advection && param->use_energy==true) {
1627  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_AdvectionEnergy<dim,nspecies,nstate,real> > ();
1628  } else if (flow_type == FlowCaseEnum::advection && param->use_energy==false) {
1629  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_Advection<dim,nspecies,nstate,real> > ();
1630  } else if (flow_type == FlowCaseEnum::convection_diffusion && !param->use_energy) {
1631  if constexpr (nstate==1) return std::make_shared<InitialConditionFunction_ConvDiff<dim,nspecies,nstate,real> > ();
1632  } else if (flow_type == FlowCaseEnum::convection_diffusion && param->use_energy) {
1633  return std::make_shared<InitialConditionFunction_ConvDiffEnergy<dim,nspecies,nstate,real> > ();
1634  } else if (flow_type == FlowCaseEnum::periodic_1D_unsteady) {
1635  if constexpr (dim==1 && nstate==1) return std::make_shared<InitialConditionFunction_1DSine<dim,nspecies,nstate,real> > ();
1636  } else if (flow_type == FlowCaseEnum::isentropic_vortex) {
1637  if constexpr (dim>1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_IsentropicVortex<dim,nspecies,nstate,real> > (param);
1638  } else if (flow_type == FlowCaseEnum::kelvin_helmholtz_instability) {
1639  if constexpr (dim>1 && nstate==dim+2) return std::make_shared<InitialConditionFunction_KHI<dim,nspecies,nstate,real> > (param);
1640  } else if (flow_type == FlowCaseEnum::non_periodic_cube_flow) {
1641  if constexpr (dim==2 && nstate==1) return std::make_shared<InitialConditionFunction_Zero<dim,nspecies,nstate,real> > ();
1642  } else if (flow_type == FlowCaseEnum::channel_flow) {
1643  if constexpr (dim==3 && nstate==dim+2) {
1645  param,
1646  param->euler_param.ref_length,
1647  param->euler_param.gamma_gas,
1648  param->euler_param.mach_inf,
1649  param->euler_param.angle_of_attack,
1650  param->euler_param.side_slip_angle,
1651  param->navier_stokes_param.prandtl_number,
1652  param->navier_stokes_param.reynolds_number_inf,
1653  param->navier_stokes_param.use_constant_viscosity,
1654  param->navier_stokes_param.nondimensionalized_constant_viscosity,
1655  param->navier_stokes_param.temperature_inf,
1656  param->navier_stokes_param.nondimensionalized_isothermal_wall_temperature,
1657  param->navier_stokes_param.thermal_boundary_condition_type,
1658  nullptr,
1659  param->two_point_num_flux_type);
1660  // Get the x-velocity initial condition type
1661  const XVelocityInitialConditionEnum xvelocity_initial_condition_type = param->flow_solver_param.xvelocity_initial_condition_type;
1662  if(xvelocity_initial_condition_type == XVelocityInitialConditionEnum::laminar) {
1663  return std::make_shared<InitialConditionFunction_TurbulentChannelFlow<dim,nspecies,nstate,real>>(
1664  navier_stokes_physics_double,
1665  param->flow_solver_param.turbulent_channel_friction_velocity_reynolds_number,
1666  param->flow_solver_param.turbulent_channel_domain_length_x_direction,
1667  param->flow_solver_param.turbulent_channel_domain_length_y_direction,
1668  param->flow_solver_param.turbulent_channel_domain_length_z_direction);
1669  } else if(xvelocity_initial_condition_type == XVelocityInitialConditionEnum::turbulent) {
1670  return std::make_shared<InitialConditionFunction_TurbulentChannelFlow_Turbulent<dim,nspecies,nstate,real>>(
1671  navier_stokes_physics_double,
1672  param->flow_solver_param.turbulent_channel_friction_velocity_reynolds_number,
1673  param->flow_solver_param.turbulent_channel_domain_length_x_direction,
1674  param->flow_solver_param.turbulent_channel_domain_length_y_direction,
1675  param->flow_solver_param.turbulent_channel_domain_length_z_direction);
1676  } else if(xvelocity_initial_condition_type == XVelocityInitialConditionEnum::manufactured) {
1677  return std::make_shared<InitialConditionFunction_TurbulentChannelFlow_Manufactured<dim,nspecies,nstate,real>>(
1678  navier_stokes_physics_double,
1679  param->flow_solver_param.turbulent_channel_friction_velocity_reynolds_number,
1680  param->flow_solver_param.turbulent_channel_domain_length_x_direction,
1681  param->flow_solver_param.turbulent_channel_domain_length_y_direction,
1682  param->flow_solver_param.turbulent_channel_domain_length_z_direction);
1683  }
1684  }
1685  } else if (flow_type == FlowCaseEnum::sod_shock_tube) {
1686  if constexpr (dim == 1 && nstate == dim+2) return std::make_shared<InitialConditionFunction_SodShockTube<dim,nspecies,nstate,real> > (param);
1687  } else if (flow_type == FlowCaseEnum::low_density) {
1688  if constexpr (dim < 3 && nstate == dim+2) return std::make_shared<InitialConditionFunction_LowDensity<dim,nspecies,nstate,real> > (param);
1689  } else if (flow_type == FlowCaseEnum::leblanc_shock_tube) {
1690  if constexpr (dim == 1 && nstate == dim+2) return std::make_shared<InitialConditionFunction_LeblancShockTube<dim,nspecies,nstate,real> > (param);
1691  } else if (flow_type == FlowCaseEnum::shu_osher_problem) {
1692  if constexpr (dim == 1 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_ShuOsherProblem<dim, nspecies, nstate, real> >(param);
1693  } else if (flow_type == FlowCaseEnum::double_mach_reflection) {
1694  if constexpr (dim == 2 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_DoubleMachReflection<dim, nspecies, nstate, real> >(param);
1695  } else if (flow_type == FlowCaseEnum::shock_diffraction) {
1696  if constexpr (dim == 2 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_ShockDiffraction<dim, nspecies, nstate, real> >(param);
1697  } else if (flow_type == FlowCaseEnum::astrophysical_jet) {
1698  if constexpr (dim == 2 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_AstrophysicalJet<dim, nspecies, nstate, real> >(param);
1699  } else if (flow_type == FlowCaseEnum::strong_vortex_shock_wave) {
1700  if constexpr (dim == 2 && nstate == dim + 2) return std::make_shared<InitialConditionFunction_SVSW<dim, nspecies, nstate, real> >(param);
1701  } else if (flow_type == FlowCaseEnum::advection_limiter) {
1702  if constexpr (dim < 3 && nstate == 1) return std::make_shared<InitialConditionFunction_Advection<dim, nspecies, nstate, real> >();
1703  } else if (flow_type == FlowCaseEnum::burgers_limiter) {
1704  if constexpr (nstate==dim && dim<3) return std::make_shared<InitialConditionFunction_BurgersInviscid<dim, nspecies, nstate, real> >();
1705  } else if (flow_type == FlowCaseEnum::multi_species_vortex_advection) {
1706  if constexpr ((nspecies==2||nspecies==3) && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_VortexAdvection<dim,nspecies,nstate,real> >(param,false);
1707  } else if (flow_type == FlowCaseEnum::multi_species_vortex_advection_high_temp) {
1708  if constexpr ((nspecies==2||nspecies==3) && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_VortexAdvection<dim,nspecies,nstate,real> >(param,true);
1709  } else if (flow_type == FlowCaseEnum::multi_species_sod_shock_tube) {
1710  if constexpr (dim==1 && nspecies==2 && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_SodShockTube<dim,nspecies,nstate,real> >(param);
1711  } else if (flow_type == FlowCaseEnum::multi_species_isentropic_vortex) {
1712  if constexpr (dim==2 && nspecies==2 && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_IsentropicVortex<dim,nspecies,nstate,real> >(param);
1713  } else if (flow_type == FlowCaseEnum::multi_species_taylor_green_vortex_smooth) {
1714  if constexpr (dim==3 && nspecies==2 && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_TaylorGreenVortex<dim,nspecies,nstate,real> >(param, true);
1715  } else if (flow_type == FlowCaseEnum::multi_species_taylor_green_vortex_sharp) {
1716  if constexpr (dim==3 && nspecies==2 && nstate==dim+nspecies+1) return std::make_shared<InitialConditionFunction_Multispecies_TaylorGreenVortex<dim,nspecies,nstate,real> >(param, false);
1717  } else {
1718  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;
1719  std::abort();
1720  return std::make_shared<InitialConditionFunction_Zero<dim, nspecies, nstate, real> >();
1721  }
1722  return nullptr;
1723 }
1724 
1725 #if PHILIP_SPECIES==1
1738 
1739  #if PHILIP_DIM==1
1746  #endif
1747 
1748  #if PHILIP_DIM==3
1754  #endif
1755 
1756  #if PHILIP_DIM>1
1758  #endif
1759 
1760  #if PHILIP_DIM==2
1769  #endif
1770 
1771  #if PHILIP_DIM < 3
1773  #endif
1774 
1775  // functions instantiated for all dim
1788 #else
1794  #if PHILIP_DIM==1
1796  #elif PHILIP_DIM==2
1798  #elif PHILIP_DIM==3
1800  #endif
1801 #endif
1802 } // PHiLiP namespace
Initial Condition Function: Taylor Green Vortex (uniform density)
FlowCaseType
Selects the flow case to be simulated.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
PartialDifferentialEquation pde_type
Store the PDE type to be solved.
const thermal_boundary_condition_enum thermal_boundary_condition_type
Thermal boundary condition type (adiabatic or isothermal)
Definition: navier_stokes.h:60
Initial Condition Function: Advection Energy.
Initial Condition Function: Taylor Green Vortex (isothermal density)
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.
FlowCaseType flow_case_type
Selected FlowCaseType from the input file.
virtual real mass_fraction(const dealii::Point< dim, real > &point) const
Value of initial condition for density.
const double angle_of_attack
Angle of attack.
Definition: euler.h:119
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.
RealGas equations. Derived from PhysicsBase.
Definition: real_gas.h:18
InitialConditionFunction_ConvDiffEnergy()
< dealii::Function we are templating on
InitialConditionFunction_DipoleWallCollision(Parameters::AllParameters const *const param, const real extremum_vorticity_value_, const real dipole_radius, const real dipole_axis_angle_wrt_x_axis_in_degrees)
Constructor.
InitialConditionFunction_TaylorGreenVortex_Isothermal(Parameters::AllParameters const *const param)
Constructor for TaylorGreenVortex_InitialCondition with isothermal density.
FlowSolverParam flow_solver_param
Contains the parameters for simulation cases (flow solver test)
Initial Condition Function: Dipole Wall Collision Normal.
Initial Condition Function: Dipole Wall Collision.
InitialConditionFunction_LeblancShockTube(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
const double mach_inf
Farfield Mach number.
Definition: euler.h:114
real y_velocity(const dealii::Point< dim, real > &point) const override
y-velocity
virtual real density(const dealii::Point< dim, real > &point) const
Value of initial condition for density.
const two_point_num_flux_enum two_point_num_flux_type
Two point numerical flux type (for split form)
Definition: euler.h:129
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.
Initial Condition Function: 1D Burgers Viscous.
virtual real y_velocity(const dealii::Point< dim, real > &point) const
y-velocity
2D Initial Condition Function: Multispecies_IsentropicVortex
InitialConditionFunction_AdvectionEnergy()
< dealii::Function we are templating on
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: 1D Sod Shock Tube.
XVelocityInitialConditionType
For turbulent channel flow, selects the type of x-velocity initialization.
Initial Condition Function: 2D Low Density Euler.
bool use_energy
Flag to use an energy monotonicity test.
virtual real x_velocity(const dealii::Point< dim, real > &point, const real density, const real temperature) const
x-velocity
Initial Condition Function: 2D Strong Vortex Shock Wave Interaction.
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.
InitialConditionFunction_BurgersInviscidEnergy()
< dealii::Function we are templating on
Initial Condition Function: 1D Shu Osher Problem.
Initial Condition Function: 2D Astrophysical Mach Jet.
real x_velocity(const dealii::Point< dim, real > &point, const real density, const real temperature) const override
x-velocity
Initial Condition Function: Convection Diffusion Orders of Accuracy.
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.
InitialConditionFunction_Multispecies_TaylorGreenVortex(Parameters::AllParameters const *const param, const bool use_smooth_interface)
< dealii::Function we are templating on
InitialConditionFunction_NavierStokesBase(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
Initial Condition Function: Isentropic vortex.
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.
1D Initial Condition Function: Multispecies_VortexAdvection
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 value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
InitialConditionFunction_TurbulentChannelFlow(const Physics::NavierStokes< dim, nspecies, nstate, double > navier_stokes_physics_, const double channel_friction_velocity_reynolds_number_, const double domain_length_x_, const double domain_length_y_, const double domain_length_z_)
< dealii::Function we are templating on
InitialConditionFunction_SVSW(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_AstrophysicalJet.
InitialConditionFunction_LowDensity(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
InitialConditionFunction_DipoleWallCollision_Normal(Parameters::AllParameters const *const param)
Constructor.
Main parameter class that contains the various other sub-parameter classes.
InitialConditionFunction_TaylorGreenVortex(Parameters::AllParameters const *const param)
Constructor for TaylorGreenVortex_InitialCondition with uniform density.
1D Initial Condition Function: Multispecies_SodShockTube
InitialConditionFunction_Advection()
< dealii::Function we are templating on
real convert_primitive_to_conversative_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const
Converts value from: primitive to conservative.
InitialConditionFunction_DipoleWallCollision_Oblique(Parameters::AllParameters const *const param)
Constructor.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Returns zero.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
Initial Condition Function: Dipole Wall Collision Oblique.
const double side_slip_angle
Sideslip angle.
Definition: euler.h:123
Initial Condition Function: 1D Burgers Inviscid Energy.
InitialConditionFunction_Zero()
< dealii::Function we are templating on
Initial condition function factory.
real get_distance_from_wall(const dealii::Point< dim, real > &point) const
distance from closest wall
InitialConditionFunction_ConvDiff()
< dealii::Function we are templating on
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
InitialConditionFunction_KHI(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
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.
Euler equations. Derived from PhysicsBase.
Definition: euler.h:78
InitialConditionFunction_RealGasBase(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
Initial Condition Function: 1D Burgers Inviscid.
Initial condition function used to initialize a particular flow setup/case.
Initial Condition Function: 1D Burgers Rewienski.
Kelvin-Helmholtz Instability, parametrized by Atwood number.
double temperature_inf
Non-dimensionalized temperature* at infinity. Should equal 1/density*(inf)
Definition: euler.h:130
Initial Condition Function: 2D Double Mach Reflection Problem.
const double reynolds_number_inf
Farfield (free stream) Reynolds number.
Definition: navier_stokes.h:56
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
real density(const dealii::Point< dim, real > &point) const override
Value of initial condition for density.
Function used to evaluate initial turbulent channel conservative solution.
InitialConditionFunction_1DSine()
< dealii::Function we are templating on
Initial Condition Function: Euler Equations (primitive values)
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
real value(const dealii::Point< dim, real > &point, const unsigned int istate) const override
Value of initial condition.
InitialConditionFunction_DoubleMachReflection(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_DoubleMachReflection.
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.
InitialConditionFunction_SodShockTube(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
const bool use_constant_viscosity
Flag to use constant viscosity instead of Sutherland&#39;s law of viscosity.
Definition: navier_stokes.h:50
const double ref_length
Reference length.
Definition: euler.h:105
const double prandtl_number
Prandtl number.
Definition: navier_stokes.h:54
InitialConditionFunction()
< dealii::Function we are templating on
InitialConditionFunction_TurbulentChannelFlow_Manufactured(const Physics::NavierStokes< dim, nspecies, nstate, double > navier_stokes_physics_, const double channel_friction_velocity_reynolds_number_, const double domain_length_x_, const double domain_length_y_, const double domain_length_z_)
Constructor.
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 convert_primitive_to_conversative_value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const
Converts value from: primitive to conservative.
static std::shared_ptr< PhysicsBase< dim, nspecies, nstate, real > > create_Physics(const Parameters::AllParameters *const parameters_input, std::shared_ptr< ModelBase< dim, nspecies, nstate, real > > model_input=nullptr)
Factory to return the correct physics given input file.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
InitialConditionFunction_AstrophysicalJet(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_AstrophysicalJet.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
InitialConditionFunction_BurgersInviscid()
< dealii::Function we are templating on
static std::shared_ptr< InitialConditionFunction< dim, nspecies, nstate, real > > create_InitialConditionFunction(Parameters::AllParameters const *const param)
Construct InitialConditionFunction object from global parameter file.
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_TurbulentChannelFlow_Turbulent(const Physics::NavierStokes< dim, nspecies, nstate, double > navier_stokes_physics_, const double channel_friction_velocity_reynolds_number_, const double domain_length_x_, const double domain_length_y_, const double domain_length_z_)
Constructor.
real value(const dealii::Point< dim, real > &point, const unsigned int istate=0) const override
Value of initial condition.
Initial Condition Function: 1D Burgers Inviscid.
InitialConditionFunction_BurgersRewienski()
< dealii::Function we are templating on
Initial Condition Function: 1D Leblanc Shock Tube.
DensityInitialConditionType
For taylor green vortex, selects the type of density initialization.
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.
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_BurgersViscous()
< dealii::Function we are templating on
InitialConditionFunction_ShuOsherProblem(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
Initial Condition Function: 2D Shock Diffraction Problem.
Initial Condition Function: Taylor Green Vortex (uniform density)
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.
InitialConditionFunction_IsentropicVortex(Parameters::AllParameters const *const param)
< dealii::Function we are templating on
Initial Condition Function: Convection Diffusion Energy.
Initial Condition Function: NavierStokesBase.
DensityInitialConditionType density_initial_condition_type
Selected DensityInitialConditionType from the input file.
InitialConditionFunction_ShockDiffraction(Parameters::AllParameters const *const param)
Constructor for InitialConditionFunction_SodShockTube.
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.