Skip to content

Commit febf131

Browse files
Add hard coded patched for tests (#942)
1 parent e503fd0 commit febf131

File tree

34 files changed

+826
-350
lines changed

34 files changed

+826
-350
lines changed

docs/documentation/case.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,15 @@ end if
225225
Some patch configurations are not adequately handled with the above analytic variable definitions.
226226
In this case, a hard coded patch can be used.
227227
Hard coded patches can be added by adding additional hard coded patch identifiers to `src/pre_process/include/1[2,3]dHardcodedIC.fpp`.
228+
When using a hard coded patch, the `patch_icpp(patch_id)%%hcid` must be set to the hard-coded patch id.
228229
For example, to add a 2D Hardcoded patch with an id of 200, one would add the following to `src/pre_process/include/2dHardcodedIC.fpp`
229230

230231
```f90
231232
case(200)
232233
! Primitive variables assignment
233234
```
234235

235-
and use `patch_icpp(i)%%geometry = 7` and `patch_icpp(i)%%hcid = 200` in the input file.
236+
and use `patch_icpp(i)%%hcid = 200` in the input file.
236237
Additional variables can be declared in `Hardcoded1[2,3]DVariables` and used in `hardcoded1[2,3]D`.
237238
As a convention, any hard coded patches that are part of the MFC master branch should be identified as 1[2,3]xx where the first digit indicates the number of dimensions.
238239

@@ -312,8 +313,8 @@ These parameters should be prepended with `patch_ib(j)%` where $j$ is the patch
312313

313314
#### Parameter Descriptions
314315

315-
- `geometry` defines the type of geometry of a patch with an integer number.
316-
Definitions for currently implemented patch types are list in table [Immersed Boundary Patch Type](#immersed-boundary-patch-types)
316+
- `geometry` defines the type of geometry of an immersed boundary patch with an integer number.
317+
Definitions for currently implemented immersed boundary patch types are listed in table [Immersed Boundary Patch Type](#immersed-boundary-patch-types).
317318

318319
- `x[y,z]_centroid` is the centroid location of the patch in the x[y,z]-direction
319320

@@ -996,16 +997,16 @@ This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]`
996997
| 3 | Rectangle | 2 | N | Coordinate-aligned. Requires `[x,y]_centroid` and `length_[x,y]`. |
997998
| 4 | Sweep line | 2 | Y | Not coordinate aligned. Requires `[x,y]_centroid` and `normal(i)`. |
998999
| 5 | Ellipse | 2 | Y | Requires `[x,y]_centroid` and `radii(i)`. |
999-
| 6 | N/A | 2 | N | No longer exists. Empty. |
1000-
| 7 | 2D Hardcoded | 2 | N | Assigns the primitive variables as analytical functions. |
1000+
| 6 | N/A | N/A | N/A | No longer exists. Empty. |
1001+
| 7 | N/A | N/A | N/A | No longer exists. Empty. |
10011002
| 8 | Sphere | 3 | Y | Requires `[x,y,z]_centroid` and `radius` |
10021003
| 9 | Cuboid | 3 | N | Coordinate-aligned. Requires `[x,y,z]_centroid` and `length_[x,y,z]`. |
10031004
| 10 | Cylinder | 3 | Y | Requires `[x,y,z]_centroid`, `radius`, and `length_[x,y,z]`. |
10041005
| 11 | Sweep plane | 3 | Y | Not coordinate-aligned. Requires `x[y,z]_centroid` and `normal(i)`. |
10051006
| 12 | Ellipsoid | 3 | Y | Requires `[x,y,z]_centroid` and `radii(i)`. |
1006-
| 13 | 3D Hardcoded | 3 | N | Assigns the primitive variables as analytical functions |
1007+
| 13 | N/A | N/A | N/A | No longer exists. Empty. |
10071008
| 14 | Spherical Harmonic | 3 | N | Requires `[x,y,z]_centroid`, `radius`, `epsilon`, `beta` |
1008-
| 15 | 1D Hardcoded | 1 | N | Assigns the primitive variables as analytical functions |
1009+
| 15 | N/A | N/A | N/A | No longer exists. Empty. |
10091010
| 16 | 1D bubble pulse | 1 | N | Requires `x_centroid`, `length_x` |
10101011
| 17 | Spiral | 2 | N | Requires `[x,y]_centroid` |
10111012
| 18 | 2D Varcircle | 2 | Y | Requires `[x,y]_centroid`, `radius`, and `thickness` |
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
# Numerical setup
6+
Nx = 1000
7+
dx = 1.0 / (1.0 * (Nx + 1))
8+
9+
Tend, Nt = 1.8, 20000
10+
mydt = Tend / (1.0 * Nt)
11+
12+
# Configuring case dictionary
13+
print(
14+
json.dumps(
15+
{
16+
# Logistics
17+
"run_time_info": "T",
18+
# Computational Domain Parameters
19+
"x_domain%beg": -5.0,
20+
"x_domain%end": 5.0,
21+
"m": Nx,
22+
"n": 0,
23+
"p": 0,
24+
"dt": mydt,
25+
"t_step_start": 0,
26+
"t_step_stop": int(Nt),
27+
"t_step_save": int(math.ceil(Nt / 10.0)),
28+
# Simulation Algorithm Parameters
29+
"num_patches": 2,
30+
"model_eqns": 2,
31+
"alt_soundspeed": "F",
32+
"num_fluids": 1,
33+
"mpp_lim": "F",
34+
"mixture_err": "F",
35+
"time_stepper": 3,
36+
"weno_order": 5,
37+
"weno_eps": 1.0e-16,
38+
"mapped_weno": "T",
39+
"null_weights": "F",
40+
"mp_weno": "F",
41+
"riemann_solver": 2,
42+
"wave_speeds": 1,
43+
"avg_state": 2,
44+
"bc_x%beg": -3,
45+
"bc_x%end": -3,
46+
# Formatted Database Files Structure Parameters
47+
"format": 1,
48+
"precision": 2,
49+
"prim_vars_wrt": "T",
50+
"parallel_io": "F",
51+
# Background to cover whole domain with basic line patch
52+
# Patch 1 Left (-5 < x < -4)
53+
"patch_icpp(1)%geometry": 1,
54+
"patch_icpp(1)%x_centroid": -4.5,
55+
"patch_icpp(1)%length_x": 1.0,
56+
"patch_icpp(1)%vel(1)": 2.629369,
57+
"patch_icpp(1)%pres": 10.3333,
58+
"patch_icpp(1)%alpha_rho(1)": 3.957143,
59+
"patch_icpp(1)%alpha(1)": 1.0,
60+
# One anlytic patch to take care of -4 < x < 5
61+
# Patch 2 Analytic
62+
"patch_icpp(2)%geometry": 1,
63+
"patch_icpp(2)%x_centroid": 0.5,
64+
"patch_icpp(2)%length_x": 9.0,
65+
"patch_icpp(2)%vel(1)": 0.0,
66+
"patch_icpp(2)%pres": 1.0,
67+
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
68+
"patch_icpp(2)%alpha(1)": 1.0,
69+
# Fluids Physical Parameters
70+
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),
71+
"fluid_pp(1)%pi_inf": 0.0,
72+
}
73+
)
74+
)

examples/1D_shuosher_old/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
"patch_icpp(2)%length_x": 9.0,
6565
"patch_icpp(2)%vel(1)": 0.0,
6666
"patch_icpp(2)%pres": 1.0,
67-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
67+
"patch_icpp(2)%alpha_rho(1)": 0.0,
68+
"patch_icpp(2)%hcid": 180,
6869
"patch_icpp(2)%alpha(1)": 1.0,
6970
# Fluids Physical Parameters
7071
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_shuosher_teno5/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"patch_icpp(2)%length_x": 9.0,
6767
"patch_icpp(2)%vel(1)": 0.0,
6868
"patch_icpp(2)%pres": 1.0,
69-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
69+
"patch_icpp(2)%alpha_rho(1)": 0,
70+
"patch_icpp(2)%hcid": 180,
7071
"patch_icpp(2)%alpha(1)": 1.0,
7172
# Fluids Physical Parameters
7273
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_shuosher_teno7/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
"patch_icpp(2)%length_x": 9.0,
6767
"patch_icpp(2)%vel(1)": 0.0,
6868
"patch_icpp(2)%pres": 1.0,
69-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
69+
"patch_icpp(2)%alpha_rho(1)": 0.0,
70+
"patch_icpp(2)%hcid": 180,
7071
"patch_icpp(2)%alpha(1)": 1.0,
7172
# Fluids Physical Parameters
7273
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_shuosher_wenojs5/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"patch_icpp(2)%length_x": 9.0,
6666
"patch_icpp(2)%vel(1)": 0.0,
6767
"patch_icpp(2)%pres": 1.0,
68-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
68+
"patch_icpp(2)%alpha_rho(1)": 0,
69+
"patch_icpp(2)%hcid": 180,
6970
"patch_icpp(2)%alpha(1)": 1.0,
7071
# Fluids Physical Parameters
7172
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_shuosher_wenom5/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"patch_icpp(2)%length_x": 9.0,
6666
"patch_icpp(2)%vel(1)": 0.0,
6767
"patch_icpp(2)%pres": 1.0,
68-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
68+
"patch_icpp(2)%alpha_rho(1)": 0,
69+
"patch_icpp(2)%hcid": 180,
6970
"patch_icpp(2)%alpha(1)": 1.0,
7071
# Fluids Physical Parameters
7172
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_shuosher_wenoz5/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"patch_icpp(2)%length_x": 9.0,
6666
"patch_icpp(2)%vel(1)": 0.0,
6767
"patch_icpp(2)%pres": 1.0,
68-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.2*sin(5*x)",
68+
"patch_icpp(2)%alpha_rho(1)": 0,
69+
"patch_icpp(2)%hcid": 180,
6970
"patch_icpp(2)%alpha(1)": 1.0,
7071
# Fluids Physical Parameters
7172
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),

examples/1D_titarevtorro/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
"patch_icpp(2)%length_x": 9.5,
6363
"patch_icpp(2)%vel(1)": 0.0,
6464
"patch_icpp(2)%pres": 1.0,
65-
"patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)",
65+
"patch_icpp(2)%alpha_rho(1)": 0.0,
66+
"patch_icpp(2)%hcid": 181,
6667
"patch_icpp(2)%alpha(1)": 1.0,
6768
# Fluids Physical Parameters
6869
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
# Numerical setup
6+
Nx = 999
7+
dx = 1.0 / (1.0 * (Nx + 1))
8+
9+
Tend, Nt = 5, 20000
10+
mydt = Tend / (1.0 * Nt)
11+
12+
# Configuring case dictionary
13+
print(
14+
json.dumps(
15+
{
16+
# Logistics
17+
"run_time_info": "T",
18+
# Computational Domain Parameters
19+
"x_domain%beg": -5.0,
20+
"x_domain%end": 5.0,
21+
"m": Nx,
22+
"n": 0,
23+
"p": 0,
24+
"dt": mydt,
25+
"t_step_start": 0,
26+
"t_step_stop": int(Nt),
27+
"t_step_save": int(math.ceil(Nt / 10.0)),
28+
# Simulation Algorithm Parameters
29+
"num_patches": 2,
30+
"model_eqns": 2,
31+
"alt_soundspeed": "F",
32+
"num_fluids": 1,
33+
"mpp_lim": "F",
34+
"mixture_err": "F",
35+
"time_stepper": 3,
36+
"weno_order": 5,
37+
"weno_eps": 1.0e-16,
38+
"mapped_weno": "T",
39+
"null_weights": "F",
40+
"mp_weno": "F",
41+
"riemann_solver": 2,
42+
"wave_speeds": 1,
43+
"avg_state": 2,
44+
"bc_x%beg": -3,
45+
"bc_x%end": -3,
46+
# Formatted Database Files Structure Parameters
47+
"format": 1,
48+
"precision": 2,
49+
"prim_vars_wrt": "T",
50+
"parallel_io": "F",
51+
# Patch 1 L (-5 < x < -4.5)
52+
"patch_icpp(1)%geometry": 1,
53+
"patch_icpp(1)%x_centroid": -4.75,
54+
"patch_icpp(1)%length_x": 0.5,
55+
"patch_icpp(1)%vel(1)": 0.523326,
56+
"patch_icpp(1)%pres": 1.805,
57+
"patch_icpp(1)%alpha_rho(1)": 1.515695,
58+
"patch_icpp(1)%alpha(1)": 1.0,
59+
# Patch 2 R (-4.5 < x < 5)
60+
"patch_icpp(2)%geometry": 1,
61+
"patch_icpp(2)%x_centroid": 0.25,
62+
"patch_icpp(2)%length_x": 9.5,
63+
"patch_icpp(2)%vel(1)": 0.0,
64+
"patch_icpp(2)%pres": 1.0,
65+
"patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)",
66+
"patch_icpp(2)%alpha(1)": 1.0,
67+
# Fluids Physical Parameters
68+
"fluid_pp(1)%gamma": 1.0e00 / (1.4 - 1.0e00),
69+
"fluid_pp(1)%pi_inf": 0.0,
70+
}
71+
)
72+
)

0 commit comments

Comments
 (0)