Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ When the simulation is 2D/axi-symmetric or 1D, it requires that $p=0$ or $p=n=0$
- `stretch_[x,y,z]` activates grid stretching in the $[x,y,z]$ directions.
The grid is gradually stretched such that the domain boundaries are pushed away from the origin along a specified axis.

- `a_[x,y,z]`, `[x,y,z]_a`, and `[x,y,z]_b` are parameters that define the grid stretching function. When grid stretching along the $x$ axis is considered, the stretching function is given as:
- `a_[x,y,z]`, `[x,y,z]_stretch%%beg`, and `[x,y,z]_stretch%%end` (where `beg` is the negative-direction anchor and `end` the positive-direction anchor) are parameters that define the grid stretching function. When grid stretching along the $x$ axis is considered, the stretching function is given as:

\f[ x_{cb,stretch} = x_{cb} + \frac{x_{cb}}{a_x} \Bigg[ \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_a)}{L} \right) \right] + \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_b)}{L} \right) \right] -2 \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_b-x_a)}{2L} \right) \right] \Bigg] \f]
\f[ x_{cb,stretch} = x_{cb} + \frac{x_{cb}}{a_x} \Bigg[ \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_{stretch,beg})}{L} \right) \right] + \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{cb}-x_{stretch,end})}{L} \right) \right] -2 \mathrm{log}\left[\mathrm{cosh} \left( \frac{a_x(x_{stretch,end}-x_{stretch,beg})}{2L} \right) \right] \Bigg] \f]

where `x_cb` and `x_[cb,stretch]` are the coordinates of a cell boundary at the original and stretched domains, respectively.
`L` is the domain length along the `x` axis: `L`=`x_domain%%end`-`x_domain%%beg`.
Crudely speaking, `x_a` and `x_b` define the coordinates at which the grid begins to get stretched in the negative and positive directions along the $x$ axis, respectively.
Crudely speaking, `x_stretch%%beg` and `x_stretch%%end` define the coordinates at which the grid begins to get stretched in the negative and positive directions along the $x$ axis, respectively.
$a_x$ defines the smoothness of the stretching.
Stretching along the $y$ and $z$ axes follows the same logistics.
Optimal choice of the parameters for grid stretching is case-dependent and left to the user.
Expand Down Expand Up @@ -987,15 +987,15 @@ This parameter enables the use of true `pi_\infty` in bubble dynamics models whe

| Parameter | Type | Description |
| ---: | :---: | :--- |
| `bf_x[y,z]` | Logical | Enable body forces in the x[y,z] direction |
| `k_x[y,y]` | Real | Magnitude of oscillating acceleration |
| `w_x[y,z]` | Real | Frequency of oscillating acceleration |
| `p_x[y,z]` | Real | Phase shift of oscillating acceleration |
| `g_x[y,z]` | Real | Magnitude of background acceleration |
| `bf_[x,y,z]%%enabled` | Logical | Enable body forces in the [x,y,z] direction |
| `bf_[x,y,z]%%k` | Real | Magnitude of oscillating acceleration |
| `bf_[x,y,z]%%w` | Real | Frequency of oscillating acceleration |
| `bf_[x,y,z]%%p` | Real | Phase shift of oscillating acceleration |
| `bf_[x,y,z]%%g` | Real | Magnitude of background acceleration |

`k_x[y,z]`, `w_x[y,z]`, `p_x[y,z]`, and `g_x[y,z]` define an oscillating acceleration in the `x[y,z]` direction with the form
`bf_[x,y,z]%%k`, `bf_[x,y,z]%%w`, `bf_[x,y,z]%%p`, and `bf_[x,y,z]%%g` define an oscillating acceleration in the `[x,y,z]` direction with the form

\f[ a_{x[y,z]} = g_{x[y,z]} + k_{x[y,z]}\sin\left(w_{x[y,z]}t + p_{x[y,z]}\right). \f]
\f[ a_{[x,y,z]} = bf_{[x,y,z]}\%g + bf_{[x,y,z]}\%k\sin\left(bf_{[x,y,z]}\%w \cdot t + bf_{[x,y,z]}\%p\right). \f]

By convention, positive accelerations in the `x[y,z]` direction are in the positive `x[y,z]` direction.

Expand Down
8 changes: 4 additions & 4 deletions examples/2D_axisym_shockwatercavity/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@
"y_domain%end": ye,
"stretch_x": "T",
"a_x": 20,
"x_a": -1.2 * D0,
"x_b": 1.2 * D0,
"x_stretch%beg": -1.2 * D0,
"x_stretch%end": 1.2 * D0,
"stretch_y": "T",
"a_y": 20,
"y_a": -0.0 * D0,
"y_b": 1.2 * D0,
"y_stretch%beg": -0.0 * D0,
"y_stretch%end": 1.2 * D0,
"m": Nx,
"n": Ny,
"p": 0,
Expand Down
8 changes: 4 additions & 4 deletions examples/2D_hardcoded_ic/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"x_domain%end": 4.0e00,
"stretch_x": "T",
"a_x": 7,
"x_a": -2,
"x_b": 2,
"x_stretch%beg": -2,
"x_stretch%end": 2,
"y_domain%beg": 0.0e00,
"y_domain%end": 4.0e00,
"stretch_y": "T",
"a_y": 7,
"y_a": -2,
"y_b": 2,
"y_stretch%beg": -2,
"y_stretch%end": 2,
"m": 199,
"n": 199,
"p": 0,
Expand Down
8 changes: 4 additions & 4 deletions examples/2D_isentropicvortex/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"loops_y": 2,
"a_x": 1.03,
"a_y": 1.03,
"x_a": -1.5,
"y_a": -1.5,
"x_b": 1.5,
"y_b": 1.5,
"x_stretch%beg": -1.5,
"y_stretch%beg": -1.5,
"x_stretch%end": 1.5,
"y_stretch%end": 1.5,
"m": Nx,
"n": Nx,
"p": 0,
Expand Down
8 changes: 4 additions & 4 deletions examples/2D_isentropicvortex_analytical/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"loops_y": 2,
"a_x": 1.03,
"a_y": 1.03,
"x_a": -1.5,
"y_a": -1.5,
"x_b": 1.5,
"y_b": 1.5,
"x_stretch%beg": -1.5,
"y_stretch%beg": -1.5,
"x_stretch%end": 1.5,
"y_stretch%end": 1.5,
"m": Nx,
"n": Nx,
"p": 0,
Expand Down
8 changes: 4 additions & 4 deletions examples/2D_phasechange_bubble/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@
"stretch_x": "T",
"loops_x": 3,
"a_x": 4.0e0,
"x_a": -2.0 * R0,
"x_b": 2.0 * R0,
"x_stretch%beg": -2.0 * R0,
"x_stretch%end": 2.0 * R0,
"stretch_y": "T",
"loops_y": 3,
"a_y": 4.0e0,
"y_a": -2.0 * R0,
"y_b": 2.0 * R0,
"y_stretch%beg": -2.0 * R0,
"y_stretch%end": 2.0 * R0,
"cyl_coord": "T",
"m": Nx,
"n": Ny,
Expand Down
10 changes: 5 additions & 5 deletions examples/2D_rayleigh_taylor/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@
"fluid_pp(2)%pi_inf": 0.0e00,
"fluid_pp(2)%Re(1)": 1 / 0.0073,
# Body Forces
"bf_y": "T",
"k_y": 0.0,
"w_y": 0.0,
"p_y": 0.0,
"g_y": -9.81,
"bf_y%enabled": "T",
"bf_y%k": 0.0,
"bf_y%w": 0.0,
"bf_y%p": 0.0,
"bf_y%g": -9.81,
# Water Patch
"patch_icpp(1)%geometry": 3,
"patch_icpp(1)%hcid": 204,
Expand Down
4 changes: 2 additions & 2 deletions examples/2D_shockdroplet/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"y_domain%end": 6 * D,
"stretch_y": "T",
"a_y": 3.67,
"y_a": -5.7 * D,
"y_b": 5.7 * D,
"y_stretch%beg": -5.7 * D,
"y_stretch%end": 5.7 * D,
"loops_y": 2,
"m": int(Nx),
"n": int(Ny),
Expand Down
4 changes: 2 additions & 2 deletions examples/2D_shockdroplet_muscl/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"y_domain%end": 6 * D,
"stretch_y": "T",
"a_y": 3.67,
"y_a": -5.7 * D,
"y_b": 5.7 * D,
"y_stretch%beg": -5.7 * D,
"y_stretch%end": 5.7 * D,
"loops_y": 2,
"m": int(Nx),
"n": int(Ny),
Expand Down
12 changes: 6 additions & 6 deletions examples/3D_performance_test/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"z_domain%end": 4.0e-03 / 1.0e-03,
"stretch_x": "T",
"a_x": 4.0e00,
"x_a": -1.5e-03 / 1.0e-03,
"x_b": 1.5e-03 / 1.0e-03,
"x_stretch%beg": -1.5e-03 / 1.0e-03,
"x_stretch%end": 1.5e-03 / 1.0e-03,
"stretch_y": "T",
"a_y": 4.0e00,
"y_a": -1.5e-03 / 1.0e-03,
"y_b": 1.5e-03 / 1.0e-03,
"y_stretch%beg": -1.5e-03 / 1.0e-03,
"y_stretch%end": 1.5e-03 / 1.0e-03,
"stretch_z": "T",
"a_z": 4.0e00,
"z_a": -1.5e-03 / 1.0e-03,
"z_b": 1.5e-03 / 1.0e-03,
"z_stretch%beg": -1.5e-03 / 1.0e-03,
"z_stretch%end": 1.5e-03 / 1.0e-03,
"cyl_coord": "F",
"m": 200,
"n": 200,
Expand Down
12 changes: 6 additions & 6 deletions examples/3D_phasechange_bubble/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,18 @@
"stretch_x": "T",
"loops_x": 3,
"a_x": 4.0e0,
"x_a": -2.0 * R0,
"x_b": 2.0 * R0,
"x_stretch%beg": -2.0 * R0,
"x_stretch%end": 2.0 * R0,
"stretch_y": "T",
"loops_y": 3,
"a_y": 4.0e0,
"y_a": -2.0 * R0,
"y_b": 2.0 * R0,
"y_stretch%beg": -2.0 * R0,
"y_stretch%end": 2.0 * R0,
"stretch_z": "T",
"loops_z": 3,
"a_z": 4.0e0,
"z_a": -2.0 * R0,
"z_b": 2.0 * R0,
"z_stretch%beg": -2.0 * R0,
"z_stretch%end": 2.0 * R0,
"cyl_coord": "F",
"m": Nx,
"n": Ny,
Expand Down
10 changes: 5 additions & 5 deletions examples/3D_rayleigh_taylor/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
"fluid_pp(2)%pi_inf": 0.0e00,
"fluid_pp(2)%Re(1)": 1 / 0.0073,
# Body Forces
"bf_y": "T",
"k_y": 0.0,
"w_y": 0.0,
"p_y": 0.0,
"g_y": -98.1,
"bf_y%enabled": "T",
"bf_y%k": 0.0,
"bf_y%w": 0.0,
"bf_y%p": 0.0,
"bf_y%g": -98.1,
# Water Patch
"patch_icpp(1)%geometry": 9,
"patch_icpp(1)%hcid": 300,
Expand Down
10 changes: 5 additions & 5 deletions examples/3D_rayleigh_taylor_muscl/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
"fluid_pp(2)%pi_inf": 0.0e00,
"fluid_pp(2)%Re(1)": 1 / 0.0073,
# Body Forces
"bf_y": "T",
"k_y": 0.0,
"w_y": 0.0,
"p_y": 0.0,
"g_y": -98.1,
"bf_y%enabled": "T",
"bf_y%k": 0.0,
"bf_y%w": 0.0,
"bf_y%p": 0.0,
"bf_y%g": -98.1,
# Water Patch
"patch_icpp(1)%geometry": 9,
"patch_icpp(1)%hcid": 300,
Expand Down
12 changes: 6 additions & 6 deletions examples/3D_shockdroplet/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@
"z_domain%end": ze,
"stretch_x": "T",
"a_x": 20,
"x_a": -1.2 * D0,
"x_b": 1.2 * D0,
"x_stretch%beg": -1.2 * D0,
"x_stretch%end": 1.2 * D0,
"stretch_y": "T",
"a_y": 20,
"y_a": -0.0 * D0,
"y_b": 1.2 * D0,
"y_stretch%beg": -0.0 * D0,
"y_stretch%end": 1.2 * D0,
"stretch_z": "T",
"a_z": 20,
"z_a": -0.0 * D0,
"z_b": 1.2 * D0,
"z_stretch%beg": -0.0 * D0,
"z_stretch%end": 1.2 * D0,
"m": Nx,
"n": Ny,
"p": Nz,
Expand Down
12 changes: 6 additions & 6 deletions examples/3D_shockdroplet_muscl/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@
"z_domain%end": ze,
"stretch_x": "T",
"a_x": 20,
"x_a": -1.2 * D0,
"x_b": 1.2 * D0,
"x_stretch%beg": -1.2 * D0,
"x_stretch%end": 1.2 * D0,
"stretch_y": "T",
"a_y": 20,
"y_a": -0.0 * D0,
"y_b": 1.2 * D0,
"y_stretch%beg": -0.0 * D0,
"y_stretch%end": 1.2 * D0,
"stretch_z": "T",
"a_z": 20,
"z_a": -0.0 * D0,
"z_b": 1.2 * D0,
"z_stretch%beg": -0.0 * D0,
"z_stretch%end": 1.2 * D0,
"m": Nx,
"n": Ny,
"p": Nz,
Expand Down
12 changes: 6 additions & 6 deletions examples/3D_sphbubcollapse/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
# away from the bubble / origin
"stretch_x": "T",
"a_x": 4.0e00,
"x_a": -1.5e-03 / 1.0e-03,
"x_b": 1.5e-03 / 1.0e-03,
"x_stretch%beg": -1.5e-03 / 1.0e-03,
"x_stretch%end": 1.5e-03 / 1.0e-03,
"stretch_y": "T",
"a_y": 4.0e00,
"y_a": -1.5e-03 / 1.0e-03,
"y_b": 1.5e-03 / 1.0e-03,
"y_stretch%beg": -1.5e-03 / 1.0e-03,
"y_stretch%end": 1.5e-03 / 1.0e-03,
"stretch_z": "T",
"a_z": 4.0e00,
"z_a": -1.5e-03 / 1.0e-03,
"z_b": 1.5e-03 / 1.0e-03,
"z_stretch%beg": -1.5e-03 / 1.0e-03,
"z_stretch%end": 1.5e-03 / 1.0e-03,
"cyl_coord": "F",
"m": 99,
"n": 99,
Expand Down
4 changes: 2 additions & 2 deletions examples/3D_turb_mixing/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"y_domain%end": Ly / 2.0,
"stretch_y": "T",
"a_y": 2,
"y_a": -0.3 * Ly,
"y_b": 0.3 * Ly,
"y_stretch%beg": -0.3 * Ly,
"y_stretch%end": 0.3 * Ly,
"loops_y": 2,
"z_domain%beg": 0.0,
"z_domain%end": Lz,
Expand Down
20 changes: 10 additions & 10 deletions src/common/include/1dHardcodedIC.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
select case (patch_icpp(patch_id)%hcid)
case (150) ! 1D Smooth Alfven Case for MHD
! velocity
q_prim_vf(eqn_idx%mom%beg + 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x_cc(i))
q_prim_vf(eqn_idx%mom%beg + 2)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x_cc(i))
q_prim_vf(eqn_idx%mom%beg + 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x%cc(i))
q_prim_vf(eqn_idx%mom%beg + 2)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x%cc(i))

! magnetic field
q_prim_vf(eqn_idx%B%end - 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x_cc(i))
q_prim_vf(eqn_idx%B%end)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x_cc(i))
q_prim_vf(eqn_idx%B%end - 1)%sf(i, 0, 0) = 0.1_wp*sin(2._wp*pi*x%cc(i))
q_prim_vf(eqn_idx%B%end)%sf(i, 0, 0) = 0.1_wp*cos(2._wp*pi*x%cc(i))
case (170) ! 1D profile from external data (e.g. Cantera, SDtoolbox)
! This hardcoded case can be used to start a simulation with initial conditions given from a known 1D profile (e.g. Cantera,
! SDtoolbox)
Expand All @@ -21,17 +21,17 @@
! This is patch is hard-coded for test suite optimization used in the 1D_shuoser cases: "patch_icpp(2)%alpha_rho(1)": "1 +
! 0.2*sin(5*x)"
if (patch_id == 2) then
q_prim_vf(eqn_idx%cont%beg + 0)%sf(i, 0, 0) = 1 + 0.2*sin(5*x_cc(i))
q_prim_vf(eqn_idx%cont%beg + 0)%sf(i, 0, 0) = 1 + 0.2*sin(5*x%cc(i))
end if
case (181) ! Titarev-Torro problem
! This is patch is hard-coded for test suite optimization used in the 1D_titarevtorro cases: "patch_icpp(2)%alpha_rho(1)":
! "1 + 0.1*sin(20*x*pi)"
q_prim_vf(eqn_idx%cont%beg + 0)%sf(i, 0, 0) = 1 + 0.1*sin(20*x_cc(i)*pi)
q_prim_vf(eqn_idx%cont%beg + 0)%sf(i, 0, 0) = 1 + 0.1*sin(20*x%cc(i)*pi)
case (182) ! Multi-component diffusion
! This patch is a hard-coded for test suite optimization (multiple component diffusion)
x_mid_diffu = 0.05_wp/2.0_wp
width_sq = (2.5_wp*10.0_wp**(-3.0_wp))**2
profile_shape = 1.0_wp - 0.5_wp*exp(-(x_cc(i) - x_mid_diffu)**2/width_sq)
profile_shape = 1.0_wp - 0.5_wp*exp(-(x%cc(i) - x_mid_diffu)**2/width_sq)
q_prim_vf(eqn_idx%mom%beg)%sf(i, 0, 0) = 0.0_wp
q_prim_vf(eqn_idx%E)%sf(i, 0, 0) = 1.01325_wp*(10.0_wp)**5
q_prim_vf(eqn_idx%adv%beg)%sf(i, 0, 0) = 1.0_wp
Expand All @@ -58,10 +58,10 @@
q_prim_vf(eqn_idx%mom%beg)%sf(i, 0, 0) = 0.0_wp
q_prim_vf(eqn_idx%species%beg)%sf(i, 0, 0) = 1.0_wp

if (x_cc(i) <= 0.025_wp) then
temp = 700.0_wp + ((1000.0_wp - 700.0_wp)/0.025_wp)*x_cc(i)
if (x%cc(i) <= 0.025_wp) then
temp = 700.0_wp + ((1000.0_wp - 700.0_wp)/0.025_wp)*x%cc(i)
else
temp = 1200.0_wp + ((900.0_wp - 1000.0_wp)/0.025_wp)*(x_cc(i) - 0.025_wp)
temp = 1200.0_wp + ((900.0_wp - 1000.0_wp)/0.025_wp)*(x%cc(i) - 0.025_wp)
end if

molar_mass_inv = 1.0_wp/2.01588_wp
Expand Down
Loading
Loading