Skip to content

Commit 98e8b1c

Browse files
author
Daniel Vickers
committed
WR BTW
2 parents a68ffe8 + 2c3099e commit 98e8b1c

29 files changed

Lines changed: 427 additions & 183 deletions

docs/documentation/case.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ This is enabled by adding ``'elliptic_smoothing': "T",`` and ``'elliptic_smoothi
312312
| Parameter | Type | Description |
313313
| ---: | :----: | :--- |
314314
| `num_ibs` | Integer | Number of immersed boundary patches |
315+
| `num_particle_beds` | Integer | Number of particle bed specifications to generate immersed boundary patches from |
315316
| `ib_neighborhood_radius` | Integer | Parameter that controls the neighborhood size for IB detection. |
316317
| `geometry` | Integer | Geometry configuration of the patch.|
317318
| `x[y,z]_centroid` | Real | Centroid of the applied geometry in the [x,y,z]-direction. |

docs/module_categories.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"m_compute_cbc",
3939
"m_boundary_common",
4040
"m_ibm",
41+
"m_particle_bed",
4142
"m_igr",
4243
"m_ib_patches",
4344
"m_compute_levelset"

src/common/include/case.fpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
! For pre-process.
66
#:def analytical()
7-
87
#:enddef
98

109
! For moving immersed boundaries in simulation
1110
#:def mib_analytical()
12-
1311
#:enddef

src/common/m_constants.fpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ module m_constants
1616
real(wp), parameter :: verysmall = 1.e-12_wp !< Very small number
1717
!> Radius cutoff to avoid division by zero for 3D spherical harmonic patch (geometry 14)
1818
real(wp), parameter :: small_radius = 1.e-32_wp
19-
integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
20-
integer, parameter :: path_len = 400 !< Maximum path length
21-
integer, parameter :: name_len = 50 !< Maximum name length
22-
integer, parameter :: dflt_int = -100 !< Default integer value
23-
integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
24-
integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
25-
integer, parameter :: num_probes_max = 10 !< Maximum number of flow probes in the simulation
26-
integer, parameter :: num_patches_max = 10 !< Maximum number of IC patches
27-
integer, parameter :: num_ib_patches_max = 2050000 !< Maximum number of immersed boundary patches (patch_ib)
19+
integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
20+
integer, parameter :: path_len = 400 !< Maximum path length
21+
integer, parameter :: name_len = 50 !< Maximum name length
22+
integer, parameter :: dflt_int = -100 !< Default integer value
23+
integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
24+
integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
25+
integer, parameter :: num_probes_max = 10 !< Maximum number of flow probes in the simulation
26+
integer, parameter :: num_patches_max = 10 !< Maximum number of IC patches
27+
integer, parameter :: num_ib_patches_max = 2050000 !< Maximum number of immersed boundary patches (patch_ib)
28+
!> Max patches readable from the namelist; patch_ib grows to num_ib_patches_max only when particle beds are used
29+
integer, parameter :: num_ib_patches_max_namelist = 50000
2830
integer, parameter :: num_local_ibs_max = 2000 !< Maximum number of immersed boundary patches (patch_ib)
2931
integer, parameter :: num_particle_beds_max = 10 !< Maximum number of particle bed patch specifications
3032
integer, parameter :: num_bc_patches_max = 10 !< Maximum number of boundary condition patches

src/pre_process/m_assign_variables.fpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ contains
9797
9898
do i = 1, eqn_idx%E - eqn_idx%mom%beg
9999
q_prim_vf(i + 1)%sf(j, k, l) = 1._wp/q_prim_vf(1)%sf(j, k, &
100-
& l)*(eta*patch_icpp(patch_id)%rho*patch_icpp(patch_id)%vel(i) + (1._wp - eta)*patch_icpp(smooth_patch_id) &
101-
& %rho*patch_icpp(smooth_patch_id)%vel(i))
100+
& l)*(eta*patch_icpp(patch_id)%rho*patch_icpp(patch_id)%vel(i) + (1._wp - eta) &
101+
& *patch_icpp(smooth_patch_id)%rho*patch_icpp(smooth_patch_id)%vel(i))
102102
end do
103103
104104
q_prim_vf(eqn_idx%gamma)%sf(j, k, l) = eta*patch_icpp(patch_id)%gamma + (1._wp - eta)*patch_icpp(smooth_patch_id)%gamma
105105
106106
q_prim_vf(eqn_idx%E)%sf(j, k, l) = 1._wp/q_prim_vf(eqn_idx%gamma)%sf(j, k, &
107-
& l)*(eta*patch_icpp(patch_id)%gamma*patch_icpp(patch_id)%pres + (1._wp - eta)*patch_icpp(smooth_patch_id) &
108-
& %gamma*patch_icpp(smooth_patch_id)%pres)
107+
& l)*(eta*patch_icpp(patch_id)%gamma*patch_icpp(patch_id)%pres + (1._wp - eta) &
108+
& *patch_icpp(smooth_patch_id)%gamma*patch_icpp(smooth_patch_id)%pres)
109109
110110
q_prim_vf(eqn_idx%pi_inf)%sf(j, k, l) = eta*patch_icpp(patch_id)%pi_inf + (1._wp - eta)*patch_icpp(smooth_patch_id)%pi_inf
111111

src/pre_process/m_check_ib_patches.fpp

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ contains
9393

9494
call s_int_to_str(patch_id, iStr)
9595

96-
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id) &
97-
& %length_y <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
98-
& %y_centroid), 'in ellipse IB patch ' // trim(iStr))
96+
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp &
97+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid), &
98+
& 'in ellipse IB patch ' // trim(iStr))
9999

100100
end subroutine s_check_ellipse_ib_patch_geometry
101101

@@ -107,9 +107,10 @@ contains
107107

108108
call s_int_to_str(patch_id, iStr)
109109

110-
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp .or. patch_ib(patch_id) &
111-
& %t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) &
112-
& .or. f_is_default(patch_ib(patch_id)%y_centroid), 'in airfoil IB patch ' // trim(iStr))
110+
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp &
111+
& .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp &
112+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid), &
113+
& 'in airfoil IB patch ' // trim(iStr))
113114

114115
end subroutine s_check_airfoil_ib_patch_geometry
115116

@@ -121,9 +122,9 @@ contains
121122

122123
call s_int_to_str(patch_id, iStr)
123124

124-
@:PROHIBIT(n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id) &
125-
& %p <= 0._wp .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id) &
126-
& %m <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
125+
@:PROHIBIT(n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp &
126+
& .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp &
127+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
127128
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. f_is_default(patch_ib(patch_id)%length_z), &
128129
& 'in 3d airfoil IB patch ' // trim(iStr))
129130

@@ -137,9 +138,9 @@ contains
137138

138139
call s_int_to_str(patch_id, iStr)
139140

140-
@:PROHIBIT(n == 0 .or. p > 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
141-
& %y_centroid) .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp, &
142-
& 'in rectangle IB patch ' // trim(iStr))
141+
@:PROHIBIT(n == 0 .or. p > 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
142+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. patch_ib(patch_id)%length_x <= 0._wp &
143+
& .or. patch_ib(patch_id)%length_y <= 0._wp, 'in rectangle IB patch ' // trim(iStr))
143144

144145
end subroutine s_check_rectangle_ib_patch_geometry
145146

@@ -151,9 +152,9 @@ contains
151152

152153
call s_int_to_str(patch_id, iStr)
153154

154-
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
155-
& %y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. patch_ib(patch_id)%radius <= 0._wp, &
156-
& 'in sphere IB patch ' // trim(iStr))
155+
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
156+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) &
157+
& .or. patch_ib(patch_id)%radius <= 0._wp, 'in sphere IB patch ' // trim(iStr))
157158

158159
end subroutine s_check_sphere_ib_patch_geometry
159160

@@ -165,10 +166,10 @@ contains
165166

166167
call s_int_to_str(patch_id, iStr)
167168

168-
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
169-
& %y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. patch_ib(patch_id) &
170-
& %length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp .or. patch_ib(patch_id)%length_z <= 0._wp, &
171-
& 'in cuboid IB patch ' // trim(iStr))
169+
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
170+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) &
171+
& .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp &
172+
& .or. patch_ib(patch_id)%length_z <= 0._wp, 'in cuboid IB patch ' // trim(iStr))
172173

173174
end subroutine s_check_cuboid_ib_patch_geometry
174175

@@ -181,15 +182,15 @@ contains
181182
call s_int_to_str(patch_id, iStr)
182183

183184
@:PROHIBIT(p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
184-
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. (patch_ib(patch_id) &
185-
& %length_x <= 0._wp .and. patch_ib(patch_id)%length_y <= 0._wp .and. patch_ib(patch_id)%length_z <= 0._wp) &
185+
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. (patch_ib(patch_id)%length_x <= 0._wp &
186+
& .and. patch_ib(patch_id)%length_y <= 0._wp .and. patch_ib(patch_id)%length_z <= 0._wp) &
186187
& .or. patch_ib(patch_id)%radius <= 0._wp, 'in cylinder IB patch ' // trim(iStr))
187188

188189
@:PROHIBIT((patch_ib(patch_id)%length_x > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_y)) &
189-
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id) &
190-
& %length_y > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
191-
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id) &
192-
& %length_z > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
190+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id)%length_y > 0._wp &
191+
& .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
192+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id)%length_z > 0._wp &
193+
& .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
193194
& .or. (.not. f_is_default(patch_ib(patch_id)%length_y)))), 'in cylinder IB patch ' // trim(iStr))
194195

195196
end subroutine s_check_cylinder_ib_patch_geometry
@@ -204,8 +205,8 @@ contains
204205

205206
@:PROHIBIT(patch_ib(patch_id)%model_filepath == dflt_char, 'Empty model file path for patch '//trim(iStr))
206207

207-
@:PROHIBIT(patch_ib(patch_id)%model_scale(1) <= 0._wp .or. patch_ib(patch_id)%model_scale(2) &
208-
& <= 0._wp .or. patch_ib(patch_id)%model_scale(3) <= 0._wp, 'Negative scale in model IB patch ' // trim(iStr))
208+
@:PROHIBIT(patch_ib(patch_id)%model_scale(1) <= 0._wp .or. patch_ib(patch_id)%model_scale(2) <= 0._wp &
209+
& .or. patch_ib(patch_id)%model_scale(3) <= 0._wp, 'Negative scale in model IB patch ' // trim(iStr))
209210

210211
end subroutine s_check_model_ib_patch_geometry
211212

@@ -217,8 +218,8 @@ contains
217218
call s_int_to_str(patch_id, iStr)
218219

219220
@:PROHIBIT((.not. f_is_default(patch_ib(patch_id)%x_centroid)) .or. (.not. f_is_default(patch_ib(patch_id)%y_centroid)) &
220-
& .or. (.not. f_is_default(patch_ib(patch_id)%z_centroid)) .or. (.not. f_is_default(patch_ib(patch_id) &
221-
& %length_x)) .or. (.not. f_is_default(patch_ib(patch_id)%length_y)) &
221+
& .or. (.not. f_is_default(patch_ib(patch_id)%z_centroid)) &
222+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_x)) .or. (.not. f_is_default(patch_ib(patch_id)%length_y)) &
222223
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)) .or. (.not. f_is_default(patch_ib(patch_id)%radius)), &
223224
& 'in inactive IB patch ' // trim(iStr))
224225

src/pre_process/m_check_patches.fpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ contains
104104

105105
! Constraints on smoothing initial condition patch parameters
106106
do i = 1, num_patches
107-
if (i > 1 .and. (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 3 .or. patch_icpp(i) &
108-
& %geometry == 4 .or. patch_icpp(i)%geometry == 5 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i) &
109-
& %geometry == 9 .or. patch_icpp(i)%geometry == 10 .or. patch_icpp(i)%geometry == 11 .or. patch_icpp(i) &
110-
& %geometry == 12 .or. patch_icpp(i)%geometry == 13 .or. patch_icpp(i)%geometry == 14)) then
107+
if (i > 1 .and. (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 3 .or. patch_icpp(i)%geometry == 4 &
108+
& .or. patch_icpp(i)%geometry == 5 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i)%geometry == 9 &
109+
& .or. patch_icpp(i)%geometry == 10 .or. patch_icpp(i)%geometry == 11 .or. patch_icpp(i)%geometry == 12 &
110+
& .or. patch_icpp(i)%geometry == 13 .or. patch_icpp(i)%geometry == 14)) then
111111
call s_check_supported_patch_smoothing(i)
112112
else
113113
call s_check_unsupported_patch_smoothing(i)
@@ -462,11 +462,13 @@ contains
462462
call s_int_to_str(patch_id, iStr)
463463
464464
@:PROHIBIT(f_is_default(patch_icpp(patch_id)%vel(1)), "Patch "//trim(iStr)//": vel(1) must be set")
465-
@:PROHIBIT(n == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(2))) .and. (.not. f_approx_equal(patch_icpp(patch_id) &
466-
& %vel(2), 0._wp)) .and. (.not. mhd), "Patch " // trim(iStr) // ": vel(2) must not be set when n = 0")
465+
@:PROHIBIT(n == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(2))) &
466+
& .and. (.not. f_approx_equal(patch_icpp(patch_id)%vel(2), 0._wp)) .and. (.not. mhd), &
467+
& "Patch " // trim(iStr) // ": vel(2) must not be set when n = 0")
467468
@:PROHIBIT(n > 0 .and. f_is_default(patch_icpp(patch_id)%vel(2)), "Patch "//trim(iStr)//": vel(2) must be set when n > 0")
468-
@:PROHIBIT(p == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(3))) .and. (.not. f_approx_equal(patch_icpp(patch_id) &
469-
& %vel(3), 0._wp)) .and. (.not. mhd), "Patch " // trim(iStr) // ": vel(3) must not be set when p = 0")
469+
@:PROHIBIT(p == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(3))) &
470+
& .and. (.not. f_approx_equal(patch_icpp(patch_id)%vel(3), 0._wp)) .and. (.not. mhd), &
471+
& "Patch " // trim(iStr) // ": vel(3) must not be set when p = 0")
470472
@:PROHIBIT(p > 0 .and. f_is_default(patch_icpp(patch_id)%vel(3)), "Patch "//trim(iStr)//": vel(3) must be set when p > 0")
471473
@:PROHIBIT(mhd .and. (f_is_default(patch_icpp(patch_id)%vel(2)) .or. f_is_default(patch_icpp(patch_id)%vel(3))), &
472474
& "Patch " // trim(iStr) // ": All velocities (vel(1:3)) must be set when mhd = true")

0 commit comments

Comments
 (0)