Theseus
Compressible flow solver
Loading...
Searching...
No Matches
StateInit.hpp
Go to the documentation of this file.
1// Copyright (c) 2025-2026 Board of Trustees of the University of Illinois
2//
3// This file is part of Theseus.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6#pragma once
7
9
10namespace Prandtl
11{
12
13 // Isentropic Vortex initial condition
14 std::function<void(const mfem::Vector&, mfem::Vector&)> LTEVortexIC(mfem::real_t radius,
15 mfem::real_t vel_inf,
16 mfem::real_t beta,
17 mfem::real_t rho_inf,
18 mfem::real_t temp_inf)
19 {
20 return [=](const mfem::Vector &x, mfem::Vector &y)
21 {
22 MFEM_ASSERT(x.Size() == 2, "");
23
24 const mfem::real_t xc = 0.0;
25 const mfem::real_t yc = 0.0;
26
27 // Using CPG constants only to shape the initial field.
28 const mfem::real_t gamma = 1.4;
29 const mfem::real_t R_gas = 287.05;
30 const mfem::real_t gm1 = gamma - 1.0;
31 const mfem::real_t cp = gamma * R_gas / gm1;
32
33 // using the perfect-gas relations
34 const mfem::real_t pres_inf = rho_inf * R_gas * temp_inf;
35
36 mfem::real_t dx = x(0) - xc;
37 mfem::real_t dy = x(1) - yc;
38
39 mfem::real_t r2rad = (dx*dx + dy*dy) / (radius * radius);
40
41 const mfem::real_t exp_half = std::exp(-0.5 * r2rad);
42 const mfem::real_t exp_full = std::exp(-r2rad);
43
44 // Vortex velocity field
45 const mfem::real_t velX = vel_inf * (1.0 - beta * dy / radius * exp_half);
46 const mfem::real_t velY = vel_inf * ( beta * dx / radius * exp_half);
47 const mfem::real_t vel2 = velX * velX + velY * velY;
48
49 // Gaussian temperature perturbation
50 const mfem::real_t temp =
51 temp_inf - 0.5 * (vel_inf * beta) * (vel_inf * beta) / cp * exp_full;
52
53 // Safety clamp so the IC never goes nonphysical
54 const mfem::real_t temp_safe = std::max(temp, 0.2 * temp_inf);
55
56 // CPG isentropic relations used only to generate the spatial field
57 const mfem::real_t den = rho_inf * std::pow(temp_safe / temp_inf, 1.0 / gm1);
58 const mfem::real_t pres = pres_inf * std::pow(temp_safe / temp_inf, gamma / gm1);
59
60 const mfem::real_t rhoe = pres / gm1;
61 const mfem::real_t rhoE = rhoe + 0.5 * den * vel2;
62
63 y(0) = den;
64 y(1) = den * velX;
65 y(2) = den * velY;
66 y(3) = rhoE;
67 };
68 }
69
70 // Registration helper that automatically registers these functions
72 {
74 {
75 // Register initial condition.
77 }
78 };
79 // Global static instance to ensure registration happens at startup.
80 static RegisterLTEVortex regLTEVortex;
81
82 // LTE Blob initial condition
83 std::function<void(const mfem::Vector&, mfem::Vector&)> LTEBlobIC(mfem::real_t radius,
84 mfem::real_t T_inf,
85 mfem::real_t T_blob,
86 mfem::real_t P_inf)
87 {
88 return [=](const mfem::Vector &x, mfem::Vector &y)
89 {
90 MFEM_ASSERT(x.Size() == 2, "");
91
92 const mfem::real_t xc = 0.0;
93 const mfem::real_t yc = 0.0;
94
95 mfem::real_t dx = x(0) - xc;
96 mfem::real_t dy = x(1) - yc;
97
98 mfem::real_t r2rad = (dx*dx + dy*dy) / (radius * radius);
99
100 const mfem::real_t exp_full = std::exp(-r2rad);
101
102 // Quiescent velocity field
103 const mfem::real_t velX = 0.0;
104 const mfem::real_t velY = 0.0;
105 const mfem::real_t vel2 = velX * velX + velY * velY;
106
107 // Gaussian temperature perturbation
108 const mfem::real_t T = T_inf + (T_blob - T_inf) * exp_full;
109
110 mfem::real_t R_gas = 287.05;
111 const mfem::real_t gamma = 1.4;
112
113 const mfem::real_t den = P_inf / (R_gas * T);
114 const mfem::real_t rhoe = P_inf / (gamma-1.0);
115 const mfem::real_t rhoE = rhoe + 0.5 * den * vel2;
116
117 y(0) = den;
118 y(1) = den * velX;
119 y(2) = den * velY;
120 y(3) = rhoE;
121 };
122 }
123
124 // Registration helper that automatically registers these functions
126 {
128 {
129 // Register initial condition.
131 }
132 };
133
134 // Global static instance to ensure registration happens at startup.
135 static RegisterLTEBlob regLTEBlob;
136
137 // Taylor Green Vortex initial condition
138 std::function<void(const mfem::Vector&, mfem::Vector&)> TaylorGreenVortexIC(mfem::real_t gamma, mfem::real_t Ma)
139 {
140 return [gamma, Ma](const mfem::Vector &x, mfem::Vector &y)
141 {
142 MFEM_ASSERT(x.Size() == 3, "");
143
144 mfem::real_t den, velX, velY, velZ, energy, p, p0 = 1.0 / (gamma * Ma * Ma);
145
146 den = 1.0;
147 velX = std::sin(x(0)) * std::cos(x(1)) * std::cos(x(2));
148 velY = -std::cos(x(0)) * std::sin(x(1)) * std::cos(x(2));
149 velZ = 0.0;
150 p = p0 + 1.0 / 16.0 * (std::cos(2.0 * x(0)) + std::cos(2.0 * x(1))) * (std::cos(2.0 * x(2)) + 2);
151
152 energy = p / (gamma - 1.0) + 0.5 * den * (velX * velX + velY * velY + velZ * velZ);
153
154 y(0) = den;
155 y(1) = den * velX;
156 y(2) = den * velY;
157 y(3) = den * velZ;
158 y(4) = energy;
159 };
160 }
161
162 // Registration helper that automatically registers these functions
164 {
166 {
167 // Register initial condition.
169 }
170 };
171 // Global static instance to ensure registration happens at startup.
172 static RegisterTaylorGreenVortex regTaylorGreenVortex;
173
174
175
176
177
178 // Taylor Green Vortex initial condition
179 std::function<void(const mfem::Vector&, mfem::Vector&)> TaylorGreenVortex2DIC(mfem::real_t gamma, mfem::real_t Ma)
180 {
181 return [gamma, Ma](const mfem::Vector &x, mfem::Vector &y)
182 {
183 MFEM_ASSERT(x.Size() == 2, "");
184 MFEM_ASSERT(y.Size() == 4, "");
185
186 mfem::real_t den, velX, velY, energy, p, p0 = 1.0 / (gamma * Ma * Ma);
187
188 den = 1.0;
189 velX = std::sin(x(0)) * std::cos(x(1));
190 velY = -std::cos(x(0)) * std::sin(x(1));
191 p = p0 + 0.25 * (std::cos(2.0 * x(0)) + std::cos(2.0 * x(1)));
192
193 energy = p / (gamma - 1.0) + 0.5 * den * (velX * velX + velY * velY);
194
195 y(0) = den;
196 y(1) = den * velX;
197 y(2) = den * velY;
198 y(3) = energy;
199 };
200 }
201
202 // Registration helper that automatically registers these functions
204 {
206 {
207 // Register initial condition.
209 }
210 };
211 // Global static instance to ensure registration happens at startup.
212 static RegisterTaylorGreenVortex2D regTaylorGreenVortex2D;
213
214
215
216
217
218 // Lid-driven Cavity initial condition function
219 std::function<void(const mfem::Vector&, mfem::Vector&)> LidDrivenCavityIC(mfem::real_t Ma, mfem::real_t gamma)
220 {
221 return [Ma, gamma] (const mfem::Vector &x, mfem::Vector &y)
222 {
223 mfem::real_t p = 1.0 / (Ma * Ma * gamma);
224 y(0) = 1.0;
225 y(1) = 0.0;
226 y(2) = 0.0;
227 y(3) = p / (gamma - 1.0);
228 };
229 }
230
231 // Lid-driven Cavity heat flow boundary condition scalar function for adiabatic walls and lid
232 std::function<mfem::real_t(const mfem::Vector&)> LidDrivenCavityAdiaBCFunction()
233 {
234 return [] (const mfem::Vector &x)
235 {
236 return 0.0;
237 };
238 }
239
240 // Lid-driven Cavity heat flow boundary condition scalar for adiabatic walls and lid
242 // Lid-driven Cavity heat flow boundary condition scalar for isothermal lid
243 // ~(2.0 / Rgas)
245
246 // Lid-driven Cavity velocity boundary condition function for walls
247 std::function<void(const mfem::Vector&, mfem::Vector&)> LidDrivenCavityWallVelBCFunction()
248 {
249 return [] (const mfem::Vector &x, mfem::Vector &vel)
250 {
251 vel(0) = 0.0;
252 vel(1) = 0.0;
253 };
254 }
255
256 // Lid-driven Cavity velocity boundary condition vector for walls
258
259 // Lid-driven Cavity velocity boundary condition function for lid
260 std::function<void(const mfem::Vector&, mfem::Vector&)> LidDrivenCavityLidVelBCFunction(mfem::real_t Re, mfem::real_t mu)
261 {
262 return [Re, mu] (const mfem::Vector &x, mfem::Vector &vel)
263 {
264 vel(0) = Re * mu / 2.0;
265 vel(1) = 0.0;
266 };
267 }
268
269 // Lid-driven Cavity velocity boundary condition vector for lid
271
272 // Registration helper that automatically registers these functions
273 // along with associated boundary marker arrays.
275 {
277 {
278 // Register initial condition.
280
281 // Register boundary conditions with functions.
288
289 // Register boundary conditions with constant scalars/vectors.
294
299
300 }
301 };
302 // Global static instance to ensure registration happens at startup.
303 static RegisterLidDrivenCavity regLidDrivenCavity;
304
305
306 // Triple Point Shock Interaction initial condition
307 std::function<void(const mfem::Vector&, mfem::Vector&)> TriplePointShockInteractionIC(mfem::real_t gammaM1Inverse)
308 {
309 return [gammaM1Inverse] (const mfem::Vector &x, mfem::Vector &y)
310 {
311 MFEM_ASSERT(x.Size() == 2, "Triple Point Shock Interaction is a 2D problem");
312 mfem::real_t density, velocity_x, velocity_y, pressure, energy;
313 if (x(0) <= 1.0)
314 {
315 density = 1.0;
316 pressure = 1.0;
317 }
318 else if (x(0) <= 7.0 && x(1) <= 1.5)
319 {
320 density = 1.0;
321 pressure = 0.1;
322 }
323 else
324 {
325 density = 0.125;
326 pressure = 0.1;
327 }
328
329 velocity_x = 0.0;
330 velocity_y = 0.0;
331 energy = pressure * gammaM1Inverse;
332
333 y(0) = density;
334 y(1) = density * velocity_x;
335 y(2) = density * velocity_y;
336 y(3) = energy;
337 };
338 }
339
340 // Registration helper that automatically registers these functions
342 {
344 {
345 // Register initial condition.
347 }
348 };
349 // Global static instance to ensure registration happens at startup.
350 static RegisterTriplePointShockInteraction regTriplePointShockInteraction;
351
352 // Isentropic Vortex initial condition
353 std::function<void(const mfem::Vector&, mfem::Vector&)> IsentropicVortexIC(mfem::real_t radius, mfem::real_t Minf,
354 mfem::real_t beta, mfem::real_t R_gas,
355 mfem::real_t gamma)
356 {
357 return [radius, Minf, beta, R_gas, gamma](const mfem::Vector &x, mfem::Vector &y)
358 {
359 MFEM_ASSERT(x.Size() == 2, "");
360
361 const mfem::real_t xc = 0.0, yc = 0.0;
362
363 // Nice units
364 const mfem::real_t vel_inf = 1.;
365 const mfem::real_t den_inf = 1.;
366
367 // Derive remainder of background state from this and Minf
368 const mfem::real_t pres_inf = (den_inf / gamma) * (vel_inf / Minf) * (vel_inf / Minf);
369 const mfem::real_t temp_inf = pres_inf / (den_inf * R_gas);
370
371 mfem::real_t r2rad = 0.0;
372 r2rad += (x(0) - xc) * (x(0) - xc);
373 r2rad += (x(1) - yc) * (x(1) - yc);
374 r2rad /= (radius * radius);
375
376 const mfem::real_t shrinv1 = 1.0 / (gamma - 1.0);
377
378 const mfem::real_t velX = vel_inf * (1 - beta * (x(1) - yc) / radius * std::exp(-0.5 * r2rad));
379 const mfem::real_t velY = vel_inf * beta * (x(0) - xc) / radius * std::exp(-0.5 * r2rad);
380 const mfem::real_t vel2 = velX * velX + velY * velY;
381
382 const mfem::real_t specific_heat = R_gas * gamma * shrinv1;
383 const mfem::real_t temp = temp_inf - 0.5 * (vel_inf * beta) * (vel_inf * beta) / specific_heat * std::exp(-r2rad);
384
385 const mfem::real_t den = den_inf * std::pow(temp / temp_inf, shrinv1);
386 const mfem::real_t pres = den * R_gas * temp;
387 const mfem::real_t energy = shrinv1 * pres / den + 0.5 * vel2;
388
389 y(0) = den;
390 y(1) = den * velX;
391 y(2) = den * velY;
392 y(3) = den * energy;
393 };
394 }
395
396 // Registration helper that automatically registers these functions
398 {
400 {
401 // Register initial condition.
403 }
404 };
405 // Global static instance to ensure registration happens at startup.
406 static RegisterIsentropicVortex regIsentropicVortex;
407
408 // Backward Facing Step initial condition
409 std::function<void(const mfem::Vector&, mfem::Vector&)> BackwardFacingStepIC(mfem::real_t gammaM1Inverse)
410 {
411 return [gammaM1Inverse] (const mfem::Vector &x, mfem::Vector &y)
412 {
413 MFEM_ASSERT(x.Size() == 2, "Backward Facing Step is a 2D problem");
414 mfem::real_t density, velocity_x, velocity_y, pressure, energy;
415 if (x(0) < 0.5)
416 {
417 density = 5.9970;
418 velocity_x = 98.5914;
419 pressure = 11666.5;
420 }
421 else
422 {
423 density = 1.0;
424 velocity_x = 0.0;
425 pressure = 1.0;
426 }
427 velocity_y = 0.0;
428 energy = pressure * gammaM1Inverse + density * 0.5 * (velocity_x * velocity_x + velocity_y * velocity_y);
429
430 y(0) = density;
431 y(1) = density * velocity_x;
432 y(2) = density * velocity_y;
433 y(3) = energy;
434 };
435 }
436
437 // Backward Facing Step boundary condition
438 const Prandtl::BC_Vector BackwardFacingStepLeftBCVector({5.9970, 5.9970 * 98.5914, 0.0,
439 11666.5 / (1.4 - 1.0) + 0.5 * 5.9970 * 98.5914 * 98.5914});
440
441 // Registration helper that automatically registers these functions
443 {
445 {
446 // Register initial condition.
448 // Register boundary condition.
451 }
452 };
453 // Global static instance to ensure registration happens at startup.
454 static RegisterBackwardFacingStep regBackwardFacingStep;
455
456 // Double Mach Reflection initial condition
457 std::function<void(const mfem::Vector&, mfem::Vector&)> DoubleMachReflectionIC(mfem::real_t gammaM1Inverse)
458 {
459 return [gammaM1Inverse] (const mfem::Vector &x, mfem::Vector &y)
460 {
461 MFEM_ASSERT(x.Size() == 2, "DMR is a 2D problem");
462
463 if (x(0) < 1.0 / 6.0 + x(1) / std::sqrt(3))
464 {
465 y(0) = 8.0;
466 y(1) = 8.0 * 7.144709581221619;
467 y(2) = -8.0 * 4.125;
468 y(3) = 116.5 * gammaM1Inverse + 0.5 * y(0) * (7.144709581221619 * 7.144709581221619 + 4.125 * 4.125);
469 }
470 else
471 {
472 y(0) = 1.4;
473 y(1) = 0.0;
474 y(2) = 0.0;
475 y(3) = 1.0 * gammaM1Inverse;
476 }
477 };
478 }
479
480 // Double Mach reflection boundary condition for top boundary
481 std::function<void(const mfem::Vector&, mfem::real_t, mfem::Vector&)> DoubleMachReflectionTopBCFunction(const mfem::real_t gammaM1Inverse)
482 {
483 return [gammaM1Inverse] (const mfem::Vector &x, mfem::real_t t, mfem::Vector &y)
484 {
485 MFEM_ASSERT(x.Size() == 2, "DMR is a 2D problem");
486
487 if (x(0) < 1.0 / 6.0 + (x(1) + 20.0 * t) / std::sqrt(3))
488 {
489 y(0) = 8.0;
490 y(1) = 8.0 * 7.144709581221619;
491 y(2) = -8.0 * 4.125;
492 y(3) = 116.5 * gammaM1Inverse + 0.5 * y(0) * (7.144709581221619 * 7.144709581221619 + 4.125 * 4.125);
493 }
494 else
495 {
496 y(0) = 1.4;
497 y(1) = 0.0;
498 y(2) = 0.0;
499 y(3) = 1.0 * gammaM1Inverse;
500 }
501 };
502 }
503
504 // Double Mach Reflection conservative state boundary condition vector for left and bottom boundaries
505 const Prandtl::BC_Vector DoubleMachReflectionLeftBottom1BCVector({8.0, 8.0 * 7.144709581221619, -8.0 * 4.125,
506 116.5 * 1.0 / (1.4 - 1.0) + 0.5 * 8.0 * (7.144709581221619 * 7.144709581221619 + 4.125 * 4.125)});
507
508 // Registration helper that automatically registers these functions
510 {
512 {
513 // Register initial condition.
515
516 // Register boundary conditions
517 Prandtl::ConditionFactory::Instance().RegisterVectorBoundaryCondition("DoubleMachReflectionLeftBottom1BCVector",
521 }
522 };
523
524 // Global static instance to ensure registration happens at startup.
525 static RegisterDoubleMachReflection regDoubleMachReflection;
526
527 // Supersonic Freestream initial condition
528 std::function<void(const mfem::Vector&, mfem::Vector&)> NagashimaIC()
529 {
530 static mfem::real_t gamma = 1.4;
531 static mfem::real_t R_gas = 287.05;
532 static mfem::real_t Ma = 2.0; // Mach number
533 static mfem::real_t p0 = 303975; // stagnation pressure (Pa)
534 static mfem::real_t a0 = 360.63; // stagnation speed (m/s)
535 static mfem::real_t C = 1 + 0.5 * (gamma-1) * Ma * Ma; // 1 + (gamma-1)/2 * M^2
536 static mfem::real_t a = a0/std::sqrt(C); // speed of sound
537 static mfem::real_t ua = Ma * a; // freestream velocity
538 static mfem::real_t pa = p0 / std::pow(C, gamma/(gamma-1)); // freestream pressure
539 static mfem::real_t pi = pa; // pressure for the inlet and initilization
540 static mfem::real_t Ta = (a * a)/(gamma * R_gas); // freestream temperature
541 static mfem::real_t rhoa = pa / (R_gas * Ta); // freestream density
542 static mfem::real_t E = pi/(gamma - 1.0) + 0.5 * rhoa * ua * ua; // Specific total energy
543 return [] (const mfem::Vector &x, mfem::Vector &y)
544 {
545 MFEM_ASSERT(x.Size() == 2, "Nagashima Ramjet is a 2D problem");
546
547 y(0) = rhoa;
548 y(1) = rhoa * ua;
549 y(2) = 0.0;
550 y(3) = E;
551
552 };
553 }
554
555 // Inlet velocity ramping boundary condition
556 std::function<void(const mfem::Vector&, mfem::real_t, mfem::Vector&)>NagashimaRampingInletBC(mfem::real_t t_ramp)
557 {
558 static mfem::real_t gamma = 1.4;
559 static mfem::real_t R_gas = 287.05;
560 static mfem::real_t Ma = 2.0; // Mach number
561 static mfem::real_t p0 = 303975; // stagnation pressure (Pa)
562 static mfem::real_t a0 = 360.63; // stagnation speed (m/s)
563 static mfem::real_t C = 1 + 0.5 * (gamma-1) * Ma * Ma; // 1 + (gamma-1)/2 * M^2
564 static mfem::real_t a = a0/std::sqrt(C); // speed of sound
565 static mfem::real_t ua = Ma * a; // freestream velocity
566 static mfem::real_t pa = p0 / std::pow(C, gamma/(gamma-1)); // freestream pressure
567 static mfem::real_t pi = pa; // pressure for the inlet and initilization
568 static mfem::real_t Ta = (a * a)/(gamma * R_gas); // freestream temperature
569 static mfem::real_t rhoa = pa / (R_gas * Ta); // freestream density
570 static mfem::real_t E = pi/(gamma - 1.0) + 0.5 * rhoa * ua * ua; // Specific total energy
571 return [t_ramp] (const mfem::Vector &x, mfem::real_t t, mfem::Vector &y)
572 {
573 mfem::real_t s = std::tanh((t - 0.5*t_ramp)/(0.1*t_ramp));
574 mfem::real_t ramp = std::clamp(0.5*(1.0 + s), 0.0, 1.0);
575 mfem::real_t u = Ma * a * ramp;
576 y(0) = rhoa;
577 y(1) = rhoa*u;
578 y(2) = 0.0;
579 y(3) = pi/(gamma-1.0) + 0.5*rhoa*u*u;
580 };
581 }
582
583 // Registration helper that automatically registers these functions
585 {
587 {
588 static mfem::real_t gamma = 1.4;
589 static mfem::real_t R_gas = 287.05;
590 static mfem::real_t Ma = 2.0; // Mach number
591 static mfem::real_t p0 = 303975; // stagnation pressure (Pa)
592 static mfem::real_t a0 = 360.63; // stagnation speed (m/s)
593 static mfem::real_t C = 1 + 0.5 * (gamma-1) * Ma * Ma; // 1 + (gamma-1)/2 * M^2
594 static mfem::real_t a = a0/std::sqrt(C); // speed of sound
595 static mfem::real_t ua = Ma * a; // freestream velocity
596 static mfem::real_t pa = p0 / std::pow(C, gamma/(gamma-1)); // freestream pressure
597 static mfem::real_t pi = pa; // pressure for the inlet and initilization
598 static mfem::real_t Ta = (a * a)/(gamma * R_gas); // freestream temperature
599 static mfem::real_t rhoa = pa / (R_gas * Ta); // freestream density
600 static mfem::real_t E = pi/(gamma - 1.0) + 0.5 * rhoa * ua * ua; // Specific total energy
601 // Subsonic outflow
602 const mfem::real_t NagashimaOutletPressure = pa;
603 // Supersonic Freestream boundary condition
604 const Prandtl::BC_Vector NagashimaInletBCVector({rhoa, rhoa * ua, 0.0, E});
605
606 // Register initial condition.
608 // Register boundary condition.
610 NagashimaInletBCVector);
614 NagashimaOutletPressure);
615
616 }
617 };
618 // Global static instance to ensure registration happens at startup.
619 static RegisterNagashima registerNagashima;
620
621
622 // Kelvin Helmholtz initial condition
623 std::function<void(const mfem::Vector&, mfem::Vector&)> KelvinHelmholtzInstabilyIC(mfem::real_t gammaM1Inverse)
624 {
625 return [gammaM1Inverse] (const mfem::Vector &x, mfem::Vector &y)
626 {
627 MFEM_ASSERT(x.Size() == 2, "KHI is a 2D problem");
628
629 mfem::real_t density, velocity_x, velocity_y, pressure, energy, B;
630
631 B = std::tanh(15.0 * x(1) + 7.5) - std::tanh(15.0 * x(1) - 7.5);
632 density = 0.5 + 0.75 * B;
633 velocity_x = 0.5 * (B - 1.0);
634 velocity_y = 0.1 * std::sin(2.0 * M_PI * x(0));
635 pressure = 1.0;
636 energy = pressure * gammaM1Inverse + density * 0.5 * (velocity_x * velocity_x + velocity_y * velocity_y);
637
638 y(0) = density;
639 y(1) = density * velocity_x;
640 y(2) = density * velocity_y;
641 y(3) = energy;
642
643 // if (x(1) < 0.5 && x(1) > -0.5)
644 // {
645 // y(0) = 2.0;
646 // y(1) = -1.0;
647 // y(2) = 2.0 * 0.01 * std::sin(M_PI * x(0));
648 // y(3) = 2.5 * gammaM1Inverse + 0.5 * (y(1) * y(1) + y(2) * y(2)) / y(0);
649 // }
650 // else
651 // {
652 // y(0) = 1.0;
653 // y(1) = 0.5;
654 // y(2) = 0.01 * std::sin(M_PI * x(0));;
655 // y(3) = 2.5 * gammaM1Inverse + 0.5 * (y(1) * y(1) + y(2) * y(2)) / y(0);
656 // }
657 };
658 }
659
660 // Registration helper that automatically registers these functions
662 {
664 {
665 // Register initial condition.
666 Prandtl::ConditionFactory::Instance().RegisterInitialCondition1("KelvinHelmholtzInstabilityIC",
668 }
669 };
670 // Global static instance to ensure registration happens at startup.
671 static RegisterKelvinHelmholtzInstability regKelvinHelmholtzInstability;
672
673
674 // Supersonic Freestream initial condition
675 std::function<void(const mfem::Vector&, mfem::Vector&)> RampIC()
676 {
677 return [] (const mfem::Vector &x, mfem::Vector &y)
678 {
679 MFEM_ASSERT(x.Size() == 2, "Ramp is a 2D problem");
680 const mfem::real_t gamma = 1.4;
681 const mfem::real_t Ma = 2.0;
682 const mfem::real_t a = 1; //340.294;
683 const mfem::real_t rho = 1; //0.225;
684 const mfem::real_t u = Ma * a;
685 const mfem::real_t p = rho*a*a/1.4;
686 y(0) = rho;
687 y(1) = rho * u;
688 y(2) = 0.0;
689 y(3) = (p / (gamma-1)) + 0.5 * rho * u * u;
690 };
691 }
692
693
694 const Prandtl::BC_Vector RampInletBCVector({1.0, 2.0, 0.0, ((1.0/1.4)/0.4) + 0.5 * 1.0 * 2.0 * 2.0});
695 // std::function<void(const mfem::Vector&, mfem::real_t, mfem::Vector&)>RampingInletBC(mfem::real_t t_ramp)
696 // {
697 // return [t_ramp] (const mfem::Vector &x, mfem::real_t t, mfem::Vector &y)
698 // {
699 // const mfem::real_t gamma = 1.4;
700 // const mfem::real_t Ma = 2.0;
701 // const mfem::real_t a = 1;
702 // const mfem::real_t rho = 1.0;
703 // mfem::real_t s = std::tanh((t - 0.5*t_ramp)/(0.1*t_ramp));
704 // mfem::real_t ramp = std::clamp(0.5*(1.0 + s), 0.0, 1.0);
705 // mfem::real_t u = Ma * a * ramp;
706 // mfem::real_t p = 1.0;
707 // y(0) = rho;
708 // y(1) = rho*u;
709 // y(2) = 0.;
710 // y(3) = p/(1.4-1.0) + 0.5*rho*u*u;
711 // };
712 // }
713
714
715 // Registration helper that automatically registers these functions
717 {
719 {
720 // Register initial condition.
722 // Register boundary condition.
724 // Prandtl::ConditionFactory::Instance().RegisterVectorTDFunctionBoundaryCondition1("RampingInletBC", RampingInletBC);
725 }
726 };
727 // Global static instance to ensure registration happens at startup.
728 static RegisterRamp registerRamp;
729
730 // Nondimensional Mach 0.3 freestream for the viscous sphere validation case.
731 std::function<void(const mfem::Vector&, mfem::Vector&)>
733 {
734 return [] (const mfem::Vector &x, mfem::Vector &y)
735 {
736 MFEM_ASSERT(x.Size() == 2, "Viscous sphere is a 2D axisymmetric problem");
737 constexpr mfem::real_t gamma = 1.4;
738 constexpr mfem::real_t density = 1.0;
739 constexpr mfem::real_t axial_velocity = 0.3;
740 constexpr mfem::real_t pressure = 1.0 / gamma;
741 y(0) = density;
742 y(1) = density * axial_velocity;
743 y(2) = 0.0;
744 y(3) = pressure / (gamma - 1.0) +
745 0.5 * density * axial_velocity * axial_velocity;
746 };
747 }
748
750 {1.0, 0.3, 0.0, ((1.0/1.4)/0.4) + 0.5 * 0.3 * 0.3});
751
763 static RegisterViscousSphere registerViscousSphere;
764
765 // Forward Facing Step initial condition
766 std::function<void(const mfem::Vector&, mfem::Vector&)> ForwardFacingStepIC(mfem::real_t gammaM1Inverse)
767 {
768 return [gammaM1Inverse] (const mfem::Vector &x, mfem::Vector &y)
769 {
770 MFEM_ASSERT(x.Size() == 2, "Forward Facing Step is a 2D problem");
771
772 y(0) = 1.4;
773 y(1) = 1.4 * 3.0;
774 y(2) = 0.0;
775 y(3) = 1.0 * gammaM1Inverse + 0.5 * 1.4 * 3.0 * 3.0;
776 };
777 }
778
779 // Forward Facing Step boundary condition
780 const Prandtl::BC_Vector ForwardFacingStepLeftBCVector({1.4, 1.4 * 3.0, 0.0, 1.0 / (1.4 - 1.0) + 0.5 * 1.4 * 3.0 * 3.0});
781
782 // Registration helper that automatically registers these functions
784 {
786 {
787 // Register initial condition.
789 // Register boundary condition.
792 }
793 };
794 // Global static instance to ensure registration happens at startup.
795 static RegisterForwardFacingStep regForwardFacingStep;
796
797 // Woodward-Colella Blast Wave initial condition
798 std::function<void(const mfem::Vector&, mfem::Vector&)> WoodwardColellaBlastWaveIC(mfem::real_t gamma)
799 {
800 return [gamma](const mfem::Vector &x, mfem::Vector &y)
801 {
802 mfem::real_t density, velocity_x, pressure, energy;
803 MFEM_ASSERT(x.Size() == 1, "");
804
805 density = 1.0;
806 velocity_x = 0.0;
807
808 if (x(0) <= 0.1)
809 {
810 pressure = 1000.0;
811 }
812 else if (x(0) <= 0.9)
813 {
814 pressure = 0.01;
815 }
816 else
817 {
818 pressure = 100.0;
819 }
820
821 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
822
823 y(0) = density;
824 y(1) = density * velocity_x;
825 y(2) = energy;
826 };
827 }
828
829 // Registration helper that automatically registers these functions
831 {
833 {
834 // Register initial condition.
837 }
838 };
839 // Global static instance to ensure registration happens at startup.
840 static RegisterWoodwardColellaBlastWave regWoodwardColellaBlastWave;
841
842 // 123 Problem initial condition
843 std::function<void(const mfem::Vector&, mfem::Vector&)> Problem123IC(mfem::real_t gamma)
844 {
845 return [gamma](const mfem::Vector &x, mfem::Vector &y)
846 {
847 mfem::real_t density, velocity_x, pressure, energy;
848 MFEM_ASSERT(x.Size() == 1, "");
849
850 if (x(0) < 0.5)
851 {
852 density = 1.0;
853 velocity_x = -2.0;
854 pressure = 0.4;
855 }
856 else
857 {
858 density = 1.0;
859 velocity_x = 2.0;
860 pressure = 0.4;
861 }
862
863 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
864
865 y(0) = density;
866 y(1) = density * velocity_x;
867 y(2) = energy;
868 };
869 }
870
871 // Registration helper that automatically registers these functions
873 {
875 {
876 // Register initial condition.
878
879 // Register boundary condition for left and right boundaries.
882 }
883 };
884 // Global static instance to ensure registration happens at startup.
885 static RegisterProblem123 regProblem123;
886
887 // Lax Shock Tube initial condition
888 std::function<void(const mfem::Vector&, mfem::Vector&)> LaxShockTubeIC(mfem::real_t gamma)
889 {
890 return [gamma](const mfem::Vector &x, mfem::Vector &y)
891 {
892 mfem::real_t density, velocity_x, pressure, energy;
893 MFEM_ASSERT(x.Size() == 1, "");
894
895 if (x(0) < 0.5)
896 {
897 density = 0.445;
898 velocity_x = 0.698;
899 pressure = 3.528;
900 }
901 else
902 {
903 density = 0.5;
904 velocity_x = 0.0;
905 pressure = 0.571;
906 }
907
908 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
909
910 y(0) = density;
911 y(1) = density * velocity_x;
912 y(2) = energy;
913 };
914 }
915
916 // Registration helper that automatically registers these functions
918 {
920 {
921 // Register initial condition.
923
924 // Register boundary condition for left and right boundaries.
927 }
928 };
929 // Global static instance to ensure registration happens at startup.
930 static RegisterLaxShockTube regLaxShockTube;
931
932 // Sod Shock Tube initial condition
933 std::function<void(const mfem::Vector&, mfem::Vector&)> ModifiedSodShockTubeIC(mfem::real_t gamma)
934 {
935 return [gamma](const mfem::Vector &x, mfem::Vector &y)
936 {
937 mfem::real_t density, velocity_x, pressure, energy;
938 MFEM_ASSERT(x.Size() == 1, "");
939
940 if (x(0) < 0.5)
941 {
942 density = 1.0;
943 velocity_x = 0.75;
944 pressure = 1.0;
945 }
946 else
947 {
948 density = 0.125;
949 velocity_x = 0.0;
950 pressure = 0.1;
951 }
952
953 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
954
955 y(0) = density;
956 y(1) = density * velocity_x;
957 y(2) = energy;
958 };
959 }
960
961 // Registration helper that automatically registers these functions
963 {
965 {
966 // Register initial condition.
968
969 // Register boundary condition for left and right boundaries.
974 }
975 };
976 // Global static instance to ensure registration happens at startup.
977 static RegisterModifiedSodShockTube regModifiedSodShockTube;
978
979 // Woodward-Colella Blast Wave Collision initial condition
980 std::function<void(const mfem::Vector&, mfem::Vector&)> WoodwardColellaBlastWaveCollisionIC(mfem::real_t gamma)
981 {
982 return [gamma](const mfem::Vector &x, mfem::Vector &y)
983 {
984 mfem::real_t density, velocity_x, pressure, energy;
985 MFEM_ASSERT(x.Size() == 1, "");
986
987 if (x(0) < 0.5)
988 {
989 density = 5.99924;
990 velocity_x = 19.5975;
991 pressure = 460.894;
992 }
993 else
994 {
995 density = 5.99242;
996 velocity_x = -6.19633 ;
997 pressure = 46.0950;
998 }
999
1000 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1001
1002 y(0) = density;
1003 y(1) = density * velocity_x;
1004 y(2) = energy;
1005 };
1006 }
1007
1008 // Registration helper that automatically registers these functions
1010 {
1012 {
1013 // Register initial condition.
1014 Prandtl::ConditionFactory::Instance().RegisterInitialCondition1("WoodwardColellaBlastWaveCollisionIC",
1016
1017 // Register boundary condition for left and right boundaries.
1018 Prandtl::ConditionFactory::Instance().RegisterVectorFunctionBoundaryCondition1("WoodwardColellaBlastWaveCollisionLeftBC",
1020 Prandtl::ConditionFactory::Instance().RegisterVectorFunctionBoundaryCondition1("WoodwardColellaBlastWaveCollisionRightBC",
1022 }
1023 };
1024 // Global static instance to ensure registration happens at startup.
1025 static RegisterWoodwardColellaBlastWaveCollision regWoodwardColellaBlastWaveCollision;
1026
1027
1028 // Acoustic Wave initial condition
1029 std::function<void(const mfem::Vector&, mfem::Vector&)> AcousticWaveIC(mfem::real_t gamma)
1030 {
1031 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1032 {
1033 // mfem::real_t density, velocity_x, pressure, energy, V;
1034 mfem::real_t density, velocity_x, pressure, energy;
1035 mfem::real_t a_inf, M_inf = 0.5, rho_inf = 1.225, p_inf = 1.0;
1036 a_inf = std::sqrt(gamma * p_inf / rho_inf);
1037 // MFEM_ASSERT(x.Size() == 1, "");
1038
1039
1040 // V = 1.0 / (2.0 * M_PI) * std::sin(2.0 * M_PI * x(0));
1041
1042 // velocity_x = a_inf * (M_inf + 2.0 / ((gamma + 1.0) * a_inf) * V);
1043 // density = rho_inf * std::pow(1.0 + (gamma - 1.0) / 2.0 * (velocity_x / a_inf - M_inf), 2.0 / (gamma - 1.0));
1044 // pressure = p_inf * std::pow(1.0 + (gamma - 1.0) / 2.0 * (velocity_x / a_inf - M_inf), 2.0 * gamma / (gamma - 1.0));
1045
1046 density = rho_inf + 0.2 * std::sin(2.0 * M_PI * x(0));
1047 velocity_x = a_inf * M_inf;
1048 pressure = p_inf;
1049
1050 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1051
1052 y(0) = density;
1053 y(1) = density * velocity_x;
1054 y(2) = energy;
1055 };
1056 }
1057
1058 std::function<void(const mfem::Vector&, mfem::real_t, mfem::Vector&)> AcousticWaveExactSolution(mfem::real_t gamma)
1059 {
1060 return [gamma](const mfem::Vector &x, mfem::real_t t, mfem::Vector &y)
1061 {
1062 // mfem::real_t density, velocity_x, pressure, energy, V, v_;
1063 mfem::real_t density, velocity_x, pressure, energy;
1064 mfem::real_t a_inf, M_inf = 0.5, rho_inf = 1.225, p_inf = 1.0;
1065 a_inf = std::sqrt(gamma * p_inf / rho_inf);
1066 // MFEM_ASSERT(x.Size() == 1, "");
1067
1068 // v_ = 0.0;
1069 // for (int i = 0; i < 200; i++)
1070 // {
1071 // V = 1.0 / (2.0 * M_PI) * std::sin(2.0 * M_PI * (x(0) - v_ * t));
1072 // if (std::abs(V - v_) < 1e-14)
1073 // {
1074 // break;
1075 // }
1076 // v_ = V;
1077 // }
1078
1079 // velocity_x = a_inf * (M_inf + 2.0 / ((gamma + 1.0) * a_inf) * V);
1080 // density = rho_inf * std::pow(1.0 + (gamma - 1.0) / 2.0 * (velocity_x / a_inf - M_inf), 2.0 / (gamma - 1.0));
1081 // pressure = p_inf * std::pow(1.0 + (gamma - 1.0) / 2.0 * (velocity_x / a_inf - M_inf), 2.0 * gamma / (gamma - 1.0));
1082
1083 density = rho_inf + 0.2 * std::sin(2.0 * M_PI * (x(0) - a_inf * M_inf * t));
1084 velocity_x = a_inf * M_inf;
1085 pressure = p_inf;
1086
1087 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1088
1089 y(0) = density;
1090 y(1) = density * velocity_x;
1091 y(2) = energy;
1092 };
1093 }
1094
1095 // Registration helper that automatically registers these functions
1097 {
1099 {
1100 // Register initial condition.
1102
1103 // Register exact solution.
1106 }
1107 };
1108 // Global static instance to ensure registration happens at startup.
1109 static RegisterAcousticWave regAcousticWave;
1110
1111 inline void AxisymmetricEntropyWaveState(const mfem::Vector &x,
1112 mfem::real_t time,
1113 mfem::real_t gamma,
1114 mfem::Vector &state)
1115 {
1116 const mfem::real_t axial_velocity = 2.0;
1117 const mfem::real_t pressure = 1.0/gamma;
1118 const mfem::real_t center = 0.8 + axial_velocity*time;
1119 const mfem::real_t scaled = (x(0) - center)/0.6;
1120 mfem::real_t bump = 0.0;
1121 if (std::abs(scaled) < 1.0)
1122 {
1123 bump = std::exp(1.0 - 1.0/(1.0 - scaled*scaled));
1124 }
1125 const mfem::real_t radial_shape = 0.5*(1.0 + std::cos(M_PI*x(1)/2.0));
1126 const mfem::real_t density = 1.0 + 0.1*bump*radial_shape;
1127 state(0) = density;
1128 state(1) = density*axial_velocity;
1129 state(2) = 0.0;
1130 state(3) = pressure/(gamma - 1.0) +
1131 0.5*density*axial_velocity*axial_velocity;
1132 }
1133
1134 std::function<void(const mfem::Vector&, mfem::Vector&)>
1135 AxisymmetricEntropyWaveIC(mfem::real_t gamma)
1136 {
1137 return [gamma](const mfem::Vector &x, mfem::Vector &state) {
1138 AxisymmetricEntropyWaveState(x, 0.0, gamma, state);
1139 };
1140 }
1141
1142 std::function<void(const mfem::Vector&, mfem::real_t, mfem::Vector&)>
1144 {
1145 return [gamma](const mfem::Vector &x, mfem::real_t time,
1146 mfem::Vector &state) {
1147 AxisymmetricEntropyWaveState(x, time, gamma, state);
1148 };
1149 }
1150
1152 {
1154 {
1156 "AxisymmetricEntropyWaveIC", AxisymmetricEntropyWaveIC);
1158 RegisterVectorTDFunctionBoundaryCondition1(
1159 "AxisymmetricEntropyWaveExact", AxisymmetricEntropyWaveExact);
1160 }
1161 };
1162 static RegisterAxisymmetricEntropyWave regAxisymmetricEntropyWave;
1163
1164 // Shu-Osher Shock initial condition
1165 std::function<void(const mfem::Vector&, mfem::Vector&)> ShuOsherShockIC(mfem::real_t gamma)
1166 {
1167 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1168 {
1169 mfem::real_t density, velocity_x, pressure, energy;
1170 MFEM_ASSERT(x.Size() == 1, "");
1171
1172 if (x(0) < 1.0)
1173 {
1174 density = 3.857;
1175 velocity_x = 2.629;
1176 pressure = 10.333;
1177 }
1178 else
1179 {
1180 density = 1.0 + 0.2 * std::sin(5.0 * (x(0) - 5.0));
1181 velocity_x = 0.0;
1182 pressure = 1.0;
1183 }
1184
1185 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1186
1187 y(0) = density;
1188 y(1) = density * velocity_x;
1189 y(2) = energy;
1190 };
1191 }
1192
1193 // Registration helper that automatically registers these functions
1195 {
1197 {
1198 // Register initial condition.
1200
1201 // Register boundary condition functions.
1203 }
1204 };
1205 // Global static instance to ensure registration happens at startup.
1206 static RegisterShuOsherShock regShuOsherShock;
1207
1208 // Woodward-Colella Blast Wave Left Half initial condition
1209 std::function<void(const mfem::Vector&, mfem::Vector&)> WoodwardColellaBlastWaveLeftIC(mfem::real_t gamma)
1210 {
1211 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1212 {
1213 mfem::real_t density, velocity_x, pressure, energy;
1214 MFEM_ASSERT(x.Size() == 1, "");
1215
1216 if (x(0) < 0.5)
1217 {
1218 density = 1.0;
1219 velocity_x = 0.0;
1220 pressure = 1000.0;
1221 }
1222 else
1223 {
1224 density = 1.0;
1225 velocity_x = 0.0;
1226 pressure = 0.01;
1227 }
1228
1229 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1230
1231 y(0) = density;
1232 y(1) = density * velocity_x;
1233 y(2) = energy;
1234 };
1235 }
1236
1237 // Registration helper that automatically registers these functions
1239 {
1241 {
1242 // Register initial condition.
1243 Prandtl::ConditionFactory::Instance().RegisterInitialCondition1("WoodwardColellaBlastWaveLeftIC",
1245
1246 // Register boundary condition for left and right boundaries.
1251 }
1252 };
1253 // Global static instance to ensure registration happens at startup.
1254 static RegisterWoodwardColellaBlastWaveLeft regWoodwardColellaBlastWaveLeft;
1255
1256
1257 // Woodward-Colella Blast Wave Right Half initial condition
1258 std::function<void(const mfem::Vector&, mfem::Vector&)> WoodwardColellaBlastWaveRightIC(mfem::real_t gamma)
1259 {
1260 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1261 {
1262 mfem::real_t density, velocity_x, pressure, energy;
1263 MFEM_ASSERT(x.Size() == 1, "");
1264
1265 if (x(0) < 0.5)
1266 {
1267 density = 1.0;
1268 velocity_x = 0.0;
1269 pressure = 0.01;
1270 }
1271 else
1272 {
1273 density = 1.0;
1274 velocity_x = 0.0;
1275 pressure = 100.0;
1276 }
1277
1278 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1279
1280 y(0) = density;
1281 y(1) = density * velocity_x;
1282 y(2) = energy;
1283 };
1284 }
1285
1286 // Registration helper that automatically registers these functions
1288 {
1290 {
1291 // Register initial condition.
1292 Prandtl::ConditionFactory::Instance().RegisterInitialCondition1("WoodwardColellaBlastWaveRightIC",
1294
1295 // Register boundary condition for left and right boundaries.
1300 }
1301 };
1302 // Global static instance to ensure registration happens at startup.
1303 static RegisterWoodwardColellaBlastWaveRight regWoodwardColellaBlastWaveRight;
1304
1305
1306 // Sod Shock Tube initial condition
1307 std::function<void(const mfem::Vector&, mfem::Vector&)> SodShockTubeIC(mfem::real_t gamma)
1308 {
1309 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1310 {
1311 mfem::real_t density, velocity_x, pressure, energy;
1312 MFEM_ASSERT(x.Size() == 1, "");
1313
1314 if (x(0) < 0.5)
1315 {
1316 density = 1.0;
1317 velocity_x = 0.0;
1318 pressure = 1.0;
1319 }
1320 else
1321 {
1322 density = 0.125;
1323 velocity_x = 0.0;
1324 pressure = 0.1;
1325 }
1326
1327 energy = pressure / (gamma - 1.0) + density * 0.5 * (velocity_x * velocity_x);
1328
1329 y(0) = density;
1330 y(1) = density * velocity_x;
1331 y(2) = energy;
1332 };
1333 }
1334
1335 // Registration helper that automatically registers these functions
1337 {
1339 {
1340 // Register initial condition.
1342
1343 // Register boundary condition for left and right boundaries.
1346 }
1347 };
1348 // Global static instance to ensure registration happens at startup.
1349 static RegisterSodShockTube regSodShockTube;
1350
1351 // LeBlanc Shock Tube initial condition
1352 std::function<void(const mfem::Vector&, mfem::Vector&)> LeBlancShockTubeIC(mfem::real_t gamma)
1353 {
1354 return [gamma](const mfem::Vector &x, mfem::Vector &y)
1355 {
1356 // mfem::real_t density, velocity_x, pressure, energy;
1357 MFEM_ASSERT(x.Size() == 1, "");
1358
1359 if (x(0) < 3.0)
1360 {
1361 y(0) = 1.0;
1362 y(1) = 0.0;
1363 y(2) = 0.1;
1364 }
1365 else
1366 {
1367 y(0) = 1e-3;
1368 y(1) = 0.0;
1369 y(2) = 1e-9;
1370 }
1371 };
1372 }
1373
1374 // Registration helper that automatically registers these functions
1376 {
1378 {
1379 // Register initial condition.
1381 }
1382 };
1383 // Global static instance to ensure registration happens at startup.
1384 static RegisterLeBlancShockTube regLeBlancShockTube;
1385
1386}
void RegisterVectorFunctionBoundaryCondition2(const std::string &key, BC_VectorFunction2 func)
Definition ConditionFactory.hpp:161
void RegisterVectorFunctionBoundaryCondition0(const std::string &key, BC_VectorFunction0 func)
Definition ConditionFactory.hpp:137
void RegisterVectorBoundaryCondition(const std::string &key, BC_Vector vector)
Definition ConditionFactory.hpp:209
void RegisterInitialCondition0(const std::string &key, IC_Function0 func)
Definition ConditionFactory.hpp:65
void RegisterInitialCondition5(const std::string &key, IC_Function5 func)
Definition ConditionFactory.hpp:95
void RegisterScalarBoundaryCondition(const std::string &key, BC_Scalar scalar)
Definition ConditionFactory.hpp:215
static ConditionFactory & Instance()
Definition ConditionFactory.hpp:58
void RegisterVectorTDFunctionBoundaryCondition1(const std::string &key, BC_VectorTDFunction1 func)
Definition ConditionFactory.hpp:185
void RegisterInitialCondition2(const std::string &key, IC_Function2 func)
Definition ConditionFactory.hpp:77
void RegisterInitialCondition4(const std::string &key, IC_Function4 func)
Definition ConditionFactory.hpp:89
void RegisterScalarFunctionBoundaryCondition0(const std::string &key, BC_ScalarFunction0 func)
Definition ConditionFactory.hpp:143
void RegisterVectorFunctionBoundaryCondition1(const std::string &key, BC_VectorFunction1 func)
Definition ConditionFactory.hpp:149
void RegisterInitialCondition1(const std::string &key, IC_Function1 func)
Definition ConditionFactory.hpp:71
Definition ConditionFactory.hpp:16
std::function< void(const mfem::Vector &, mfem::Vector &)> IsentropicVortexIC(mfem::real_t radius, mfem::real_t Minf, mfem::real_t beta, mfem::real_t R_gas, mfem::real_t gamma)
Definition StateInit.hpp:353
std::function< void(const mfem::Vector &, mfem::Vector &)> ModifiedSodShockTubeIC(mfem::real_t gamma)
Definition StateInit.hpp:933
std::function< void(const mfem::Vector &, mfem::Vector &)> LeBlancShockTubeIC(mfem::real_t gamma)
Definition StateInit.hpp:1352
const Prandtl::BC_Vector ForwardFacingStepLeftBCVector({1.4, 1.4 *3.0, 0.0, 1.0/(1.4 - 1.0)+0.5 *1.4 *3.0 *3.0})
std::function< void(const mfem::Vector &, mfem::Vector &)> LidDrivenCavityIC(mfem::real_t Ma, mfem::real_t gamma)
Definition StateInit.hpp:219
std::function< void(const mfem::Vector &, mfem::Vector &)> SodShockTubeIC(mfem::real_t gamma)
Definition StateInit.hpp:1307
std::function< void(const mfem::Vector &, mfem::Vector &)> WoodwardColellaBlastWaveIC(mfem::real_t gamma)
Definition StateInit.hpp:798
std::function< void(const mfem::Vector &, mfem::Vector &)> WoodwardColellaBlastWaveLeftIC(mfem::real_t gamma)
Definition StateInit.hpp:1209
std::function< void(const mfem::Vector &, mfem::Vector &)> TaylorGreenVortex2DIC(mfem::real_t gamma, mfem::real_t Ma)
Definition StateInit.hpp:179
std::function< void(const mfem::Vector &, mfem::real_t, mfem::Vector &)> NagashimaRampingInletBC(mfem::real_t t_ramp)
Definition StateInit.hpp:556
const Prandtl::BC_Vector LidDrivenCavityWallVelBCVector({0.0, 0.0})
std::function< void(const mfem::Vector &, mfem::Vector &)> TriplePointShockInteractionIC(mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:307
std::function< void(const mfem::Vector &, mfem::real_t, mfem::Vector &)> DoubleMachReflectionTopBCFunction(const mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:481
mfem::real_t BC_Scalar
Definition ConditionFactory.hpp:51
std::function< void(const mfem::Vector &, mfem::Vector &)> LidDrivenCavityLidVelBCFunction(mfem::real_t Re, mfem::real_t mu)
Definition StateInit.hpp:260
std::function< void(const mfem::Vector &, mfem::Vector &)> LidDrivenCavityWallVelBCFunction()
Definition StateInit.hpp:247
const Prandtl::BC_Scalar LidDrivenCavityAdiaBCScalar
Definition StateInit.hpp:241
std::function< void(const mfem::Vector &, mfem::Vector &)> ForwardFacingStepIC(mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:766
std::function< void(const mfem::Vector &, mfem::Vector &)> Problem123IC(mfem::real_t gamma)
Definition StateInit.hpp:843
std::function< void(const mfem::Vector &, mfem::Vector &)> ShuOsherShockIC(mfem::real_t gamma)
Definition StateInit.hpp:1165
std::function< void(const mfem::Vector &, mfem::Vector &)> BackwardFacingStepIC(mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:409
std::function< void(const mfem::Vector &, mfem::Vector &)> LTEVortexIC(mfem::real_t radius, mfem::real_t vel_inf, mfem::real_t beta, mfem::real_t rho_inf, mfem::real_t temp_inf)
Definition StateInit.hpp:14
std::function< void(const mfem::Vector &, mfem::real_t, mfem::Vector &)> AxisymmetricEntropyWaveExact(mfem::real_t gamma)
Definition StateInit.hpp:1143
const Prandtl::BC_Vector ViscousSphereFreestreamBCVector({1.0, 0.3, 0.0,((1.0/1.4)/0.4)+0.5 *0.3 *0.3})
const Prandtl::BC_Vector LidDrivenCavityLidVelBCVector({1.0, 0.0})
std::function< void(const mfem::Vector &, mfem::Vector &)> DoubleMachReflectionIC(mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:457
std::function< void(const mfem::Vector &, mfem::Vector &)> WoodwardColellaBlastWaveCollisionIC(mfem::real_t gamma)
Definition StateInit.hpp:980
const Prandtl::BC_Vector BackwardFacingStepLeftBCVector({5.9970, 5.9970 *98.5914, 0.0, 11666.5/(1.4 - 1.0)+0.5 *5.9970 *98.5914 *98.5914})
std::function< mfem::real_t(const mfem::Vector &)> LidDrivenCavityAdiaBCFunction()
Definition StateInit.hpp:232
std::function< void(const mfem::Vector &, mfem::Vector &)> LTEBlobIC(mfem::real_t radius, mfem::real_t T_inf, mfem::real_t T_blob, mfem::real_t P_inf)
Definition StateInit.hpp:83
std::function< void(const mfem::Vector &, mfem::Vector &)> KelvinHelmholtzInstabilyIC(mfem::real_t gammaM1Inverse)
Definition StateInit.hpp:623
void AxisymmetricEntropyWaveState(const mfem::Vector &x, mfem::real_t time, mfem::real_t gamma, mfem::Vector &state)
Definition StateInit.hpp:1111
std::function< void(const mfem::Vector &, mfem::Vector &)> AcousticWaveIC(mfem::real_t gamma)
Definition StateInit.hpp:1029
std::function< void(const mfem::Vector &, mfem::Vector &)> RampIC()
Definition StateInit.hpp:675
const Prandtl::BC_Scalar LidDrivenCavityIsoBCScalar
Definition StateInit.hpp:244
std::function< void(const mfem::Vector &, mfem::real_t, mfem::Vector &)> AcousticWaveExactSolution(mfem::real_t gamma)
Definition StateInit.hpp:1058
std::function< void(const mfem::Vector &, mfem::Vector &)> WoodwardColellaBlastWaveRightIC(mfem::real_t gamma)
Definition StateInit.hpp:1258
std::function< void(const mfem::Vector &, mfem::Vector &)> TaylorGreenVortexIC(mfem::real_t gamma, mfem::real_t Ma)
Definition StateInit.hpp:138
std::function< void(const mfem::Vector &, mfem::Vector &)> NagashimaIC()
Definition StateInit.hpp:528
const Prandtl::BC_Vector DoubleMachReflectionLeftBottom1BCVector({8.0, 8.0 *7.144709581221619, -8.0 *4.125, 116.5 *1.0/(1.4 - 1.0)+0.5 *8.0 *(7.144709581221619 *7.144709581221619+4.125 *4.125)})
std::function< void(const mfem::Vector &, mfem::Vector &)> ViscousSphereIC()
Definition StateInit.hpp:732
std::function< void(const mfem::Vector &, mfem::Vector &)> LaxShockTubeIC(mfem::real_t gamma)
Definition StateInit.hpp:888
std::function< void(const mfem::Vector &, mfem::Vector &)> AxisymmetricEntropyWaveIC(mfem::real_t gamma)
Definition StateInit.hpp:1135
mfem::Vector BC_Vector
Definition ConditionFactory.hpp:52
const Prandtl::BC_Vector RampInletBCVector({1.0, 2.0, 0.0,((1.0/1.4)/0.4)+0.5 *1.0 *2.0 *2.0})
Definition StateInit.hpp:1097
RegisterAcousticWave()
Definition StateInit.hpp:1098
Definition StateInit.hpp:1152
RegisterAxisymmetricEntropyWave()
Definition StateInit.hpp:1153
Definition StateInit.hpp:443
RegisterBackwardFacingStep()
Definition StateInit.hpp:444
Definition StateInit.hpp:510
RegisterDoubleMachReflection()
Definition StateInit.hpp:511
Definition StateInit.hpp:784
RegisterForwardFacingStep()
Definition StateInit.hpp:785
Definition StateInit.hpp:398
RegisterIsentropicVortex()
Definition StateInit.hpp:399
RegisterKelvinHelmholtzInstability()
Definition StateInit.hpp:663
Definition StateInit.hpp:126
RegisterLTEBlob()
Definition StateInit.hpp:127
Definition StateInit.hpp:72
RegisterLTEVortex()
Definition StateInit.hpp:73
Definition StateInit.hpp:918
RegisterLaxShockTube()
Definition StateInit.hpp:919
Definition StateInit.hpp:1376
RegisterLeBlancShockTube()
Definition StateInit.hpp:1377
Definition StateInit.hpp:275
RegisterLidDrivenCavity()
Definition StateInit.hpp:276
Definition StateInit.hpp:963
RegisterModifiedSodShockTube()
Definition StateInit.hpp:964
Definition StateInit.hpp:585
RegisterNagashima()
Definition StateInit.hpp:586
Definition StateInit.hpp:873
RegisterProblem123()
Definition StateInit.hpp:874
Definition StateInit.hpp:717
RegisterRamp()
Definition StateInit.hpp:718
Definition StateInit.hpp:1195
RegisterShuOsherShock()
Definition StateInit.hpp:1196
Definition StateInit.hpp:1337
RegisterSodShockTube()
Definition StateInit.hpp:1338
Definition StateInit.hpp:204
RegisterTaylorGreenVortex2D()
Definition StateInit.hpp:205
Definition StateInit.hpp:164
RegisterTaylorGreenVortex()
Definition StateInit.hpp:165
RegisterTriplePointShockInteraction()
Definition StateInit.hpp:343
Definition StateInit.hpp:753
RegisterViscousSphere()
Definition StateInit.hpp:754
RegisterWoodwardColellaBlastWaveCollision()
Definition StateInit.hpp:1011
RegisterWoodwardColellaBlastWaveLeft()
Definition StateInit.hpp:1240
RegisterWoodwardColellaBlastWaveRight()
Definition StateInit.hpp:1289
Definition StateInit.hpp:831
RegisterWoodwardColellaBlastWave()
Definition StateInit.hpp:832