Skip to content

Commit ba86586

Browse files
authored
Merge pull request #46 from henryleberre/support-cyl
2 parents d80602a + 7f03eaf commit ba86586

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

doc/documentation/running.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Parallel I/O enables the use of different number of processors in each of the pr
302302
| `num_mono` | Integer | Number of acoustic sources |
303303
| `Mono(i)%pulse` | Integer | Acoustic wave form: [1] Sine [2] Gaussian [3] Square |
304304
| `Mono(i)%npulse` | Integer | Number of pulse cycles |
305-
| `Mono(i)%support` | Integer | Type of the spatial support of the acoustic source : [1] 1D [2] Finite width (2D) [3] Support for finite line/patch |
305+
| `Mono(i)%support` | Integer | Type of the spatial support of the acoustic source : [1] 1D [2] Finite width (2D) [3] Support for finite line/patch [4] General support for 3D simulation in cartesian systems [5] Support along monopole acoustic transducer [6] Support for cylindrical coordinate system along axial-dir |
306306
| `Mono(i)%loc(j)` | Real | $j$-th coordinate of the point that consists of $i$-th source plane |
307307
| `Mono(i)%dir` | Real | Direction of acoustic propagation |
308308
| `Mono(i)%mag` | Real | Pulse magnitude |
@@ -330,7 +330,7 @@ The $i$-th source plane is determined by the point at [`Mono(i)%loc(1)`, `Mono(i
330330
The source plane is defined in the finite region of the domain: $x\in[-\infty,\infty]$ and $y\in$[-`mymono_length`/2, `mymono_length`/2].\\
331331
`Mono(i)%support` $=3$ specifies a semi-infinite source plane in 3-D simulation.
332332
The $i$-th source plane is determined by the point at [`Mono(i)%loc(1)`, `Mono(i)%loc(2)`, `Mono(i)%loc(3)`] and the normal vector [$\mathrm{cos}$(`Mono(i)%dir`), $\mathrm{sin}$(`Mono(i)%dir`), 1] that consists of this point.
333-
The source plane is defined in the finite region of the domain: $x\in[-\infty,\infty]$ and $y,z\in$[-`mymono_length`/2, `mymono_length`/2].
333+
The source plane is defined in the finite region of the domain: $x\in[-\infty,\infty]$ and $y,z\in$[-`mymono_length`/2, `mymono_length`/2]. There are a few additional spatial support types available for special source types and coordinate systems tabulated in [Monopole supports](#monopole-supports).
334334

335335
### 8. Ensemble-Averaged Bubble Model
336336

@@ -443,6 +443,21 @@ also listed in this table.
443443

444444
The flux limiters supported by the MFC are listed in table [Flux Limiters](#flux-limiters). Each limiter can be specified by specifying the value of `flux_lim`. Details of their implementations can be found in [Meng (2016)](references.md#Meng16).
445445

446+
### Monopole supports
447+
448+
| # | Description |
449+
| ---: | :---- |
450+
| 1 | 1D normal to x-axis |
451+
| 2 | 2D semi-infinite source plane |
452+
| 3 | 3D semi-infinite source plane along some lines |
453+
| 4 | 3D semi-infinite source plane |
454+
| 5 | Transducer |
455+
| 6 | Cyl_coord along axial-dir|
456+
457+
The monopole support types available in MFC are listed in table [Monopole supports](#monopole-supports). This includes
458+
types exclusive to one-, two-, and three-dimensional problems with special souce geometry like transducers as well as coordinate systems such as cylindrical coordinates. The monopole support number (`#`) corresponds to the input value in `input.py` labeled `Mono(i)%support` where
459+
$i$ is the monopole source index.
460+
446461
## Running
447462

448463
MFC can be run using `mfc.sh`'s `run` command. It supports both interactive and

src/simulation/m_monopole.f90

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ subroutine s_monopole_calculations(mono_mass_src, mono_mom_src, mono_e_src, q_c
217217
if (support(q) == 5) then
218218
mono_mom_src(1, j, k, l) = mono_mom_src(1, j, k, l) + s2*cos(angle)
219219
mono_mom_src(2, j, k, l) = mono_mom_src(2, j, k, l) + s2*sin(angle)
220+
else if (support(q) == 6) then
221+
! Cylindrical Coordinate
222+
mono_mom_src(1, j, k, l) = mono_mom_src(1, j, k, l) + s2*cos(dir(q))
223+
mono_mom_src(2, j, k, l) = mono_mom_src(2, j, k, l)
220224
else
221225
mono_mom_src(1, j, k, l) = mono_mom_src(1, j, k, l) + s2*cos(dir(q))
222226
mono_mom_src(2, j, k, l) = mono_mom_src(2, j, k, l) + s2*sin(dir(q))
@@ -318,7 +322,9 @@ function f_delta(j, k, l, mono_loc, mono_leng, nm, angle, angle_z)
318322

319323
integer :: q
320324
real(kind(0d0)) :: h, hx, hy, hz
325+
real(kind(0d0)) :: hx_cyl, hy_cyl, hz_cyl
321326
real(kind(0d0)) :: hxnew, hynew
327+
real(kind(0d0)) :: hxnew_cyl, hynew_cyl
322328
real(kind(0d0)) :: sig
323329
real(kind(0d0)) :: f_delta
324330
real(kind(0d0)) :: angle
@@ -436,6 +442,27 @@ function f_delta(j, k, l, mono_loc, mono_leng, nm, angle, angle_z)
436442
else
437443
f_delta = 0d0
438444
end if
445+
else if (support(nm) == 6) then
446+
! Support for cylindrical coordinate system
447+
!sig = maxval((/dx(j), dy(k)*sin(dz(l)), dz(l)*cos(dz(l))/))
448+
sig = dx(j)
449+
sig = sig*2.5d0
450+
hx_cyl = x_cc(j) - mono_loc(1)
451+
hy_cyl = y_cc(k)*sin(z_cc(l)) - mono_loc(2)
452+
hz_cyl = y_cc(k)*cos(z_cc(l)) - mono_loc(3)
453+
454+
! Rotate actual point by -theta
455+
hxnew_cyl = cos(dir(nm))*hx_cyl + sin(dir(nm))*hy_cyl
456+
hynew_cyl = -1.d0*sin(dir(nm))*hx_cyl + cos(dir(nm))*hy_cyl
457+
458+
if (abs(hynew_cyl) < length(nm)/2. .and. &
459+
abs(hz_cyl) < length(nm)/2.) then
460+
f_delta = 1.d0/(dsqrt(2.d0*pi)*sig/2.d0)* &
461+
dexp(-0.5d0*(hxnew_cyl/(sig/2.d0))**2.d0)
462+
else
463+
f_delta = 0d0
464+
end if
465+
439466
end if
440467
end if
441468

0 commit comments

Comments
 (0)