Skip to content

Commit 6695ef5

Browse files
committed
Merge branch 'muscl' of https://github.com/okBrian/MFC into muscl
2 parents 2477c7f + 570140a commit 6695ef5

File tree

18 files changed

+45
-82
lines changed

18 files changed

+45
-82
lines changed

docs/documentation/case.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
380380
| `time_stepper` | Integer | Runge--Kutta order [1-3] |
381381
| `adap_dt` | Logical | Strang splitting scheme with adaptive time stepping |
382382
| `recon_type` | Integer | Reconstruction Type: [1] WENO; [2] MUSCL |
383+
| `adap_dt_tol` | Real | Tolerance for adaptive time stepping in Strang splitting scheme|
384+
| `adap_dt_max_iters` | Integer | Max iteration for adaptive time stepping in Strang splitting scheme |
383385
| `weno_order` | Integer | WENO order [1,3,5] |
384386
| `weno_eps` | Real | WENO perturbation (avoid division by zero) |
385387
| `mapped_weno` | Logical | WENO-M (WENO with mapping of nonlinear weights) |
@@ -459,7 +461,7 @@ The effect and use of the source term are assessed by [Schmidmayer et al., 2019]
459461
- `time_stepper` specifies the order of the Runge-Kutta (RK) time integration scheme that is used for temporal integration in simulation, from the 1st to 5th order by corresponding integer.
460462
Note that `time_stepper = 3` specifies the total variation diminishing (TVD), third order RK scheme ([Gottlieb and Shu, 1998](references.md)).
461463

462-
- `adap_dt` activates the Strang operator splitting scheme which splits flux and source terms in time marching, and an adaptive time stepping strategy is implemented for the source term. It requires ``bubbles_euler = 'T'``, ``polytropic = 'T'``, ``adv_n = 'T'`` and `time_stepper = 3`. Additionally, it can be used with ``bubbles_lagrange = 'T'`` and `time_stepper = 3`
464+
- `adap_dt` activates the Strang operator splitting scheme which splits flux and source terms in time marching, and an adaptive time stepping strategy is implemented for the source term. It requires ``bubbles_euler = 'T'``, ``polytropic = 'T'``, ``adv_n = 'T'`` and `time_stepper = 3`. Additionally, it can be used with ``bubbles_lagrange = 'T'`` and `time_stepper = 3`. `adap_dt_tol` and `adap_dt_max_iters` are 1e-4 and 100, respectively, by default.
463465

464466
- `weno_order` specifies the order of WENO scheme that is used for spatial reconstruction of variables by an integer of 1, 3, 5, and 7, that correspond to the 1st, 3rd, 5th, and 7th order, respectively.
465467

@@ -756,7 +758,6 @@ Implementation of the parameters into the model follow [Ando (2010)](references.
756758
| `polydisperse` | Logical | Polydispersity in equilibrium bubble radius R0 |
757759
| `nb` | Integer | Number of bins: [1] Monodisperse; [$>1$] Polydisperse |
758760
| `poly_sigma` | Real | Standard deviation for probability density function of polydisperse bubble populations |
759-
| `R0_type` | Integer | Quadrature rule for probability density function of polydisperse bubble populations |
760761
| `Ca` | Real | Cavitation number |
761762
| `Web` | Real | Weber number |
762763
| `Re_inv` | Real | Inverse Reynolds number |
@@ -774,15 +775,12 @@ When ``polytropic = 'F'``, the gas compression is modeled as non-polytropic due
774775
- `thermal` specifies a model for heat transfer across the bubble interface by an integer from 1 through 3.
775776
`thermal = 1`, `2`, and `3` correspond to no heat transfer (adiabatic gas compression), isothermal heat transfer, and heat transfer with a constant heat transfer coefficient based on [Preston et al., 2007](references.md), respectively.
776777

777-
- `polydisperse` activates polydispersity in the bubble model through a probability density function (PDF) of the equilibrium bubble radius.
778+
- `polydisperse` activates polydispersity in the bubble model through a probability density function (PDF) of the equilibrium bubble radius. Simpson's rule is used for integrating the log-normal PDF of equilibrium bubble radius for polydisperse populations.
778779

779780
- `R0ref` specifies the reference bubble radius.
780781

781782
- `nb` specifies the number of discrete bins that define the probability density function (PDF) of the equilibrium bubble radius.
782783

783-
- `R0_type` specifies the quadrature rule for integrating the log-normal PDF of equilibrium bubble radius for polydisperse populations.
784-
`R0_type = 1` corresponds to Simpson's rule.
785-
786784
- `poly_sigma` specifies the standard deviation of the log-normal PDF of equilibrium bubble radius for polydisperse populations.
787785

788786
- `Ca`, `Web`, and `Re_inv` respectively specify the Cavitation number, Weber number, and the inverse Reynolds number that characterize the offset of the gas pressure from the vapor pressure, surface tension, and liquid viscosity when the polytropic gas compression model is used.

examples/0D_bubblecollapse_adap/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
"adv_n": "T",
119119
# adap_dt
120120
"adap_dt": "T",
121+
"adap_dt_max_iters": 200,
121122
# Gas compression model
122123
"polytropic": "T",
123124
"thermal": 1,

examples/1D_poly_bubscreen/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
"bubbles_euler": "T",
158158
"bubble_model": 2,
159159
"polytropic": "T",
160-
"R0_type": 1,
161160
"thermal": 3,
162161
"R0ref": myr0,
163162
"nb": 1,

examples/1D_qbmm/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@
171171
"bubble_model": 2,
172172
"polytropic": "F",
173173
"polydisperse": "T",
174-
"R0_type": 1,
175174
"poly_sigma": 0.3,
176175
"thermal": 3,
177176
"R0ref": myr0,

examples/2D_bubbly_steady_shock/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@
191191
"bubble_model": 2,
192192
"polytropic": "T",
193193
"polydisperse": "F",
194-
"R0_type": 1,
195194
"poly_sigma": 0.3,
196195
"thermal": 3,
197196
"R0ref": x0,

examples/2D_whale_bubble_annulus/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152
"bubbles_euler": "T",
153153
"bubble_model": 3,
154154
"polytropic": "T",
155-
"R0_type": 1,
156155
"thermal": 3,
157156
"R0ref": myr0,
158157
"nb": 1,

src/common/m_constants.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ module m_constants
6464

6565
! Strang Splitting constants
6666
real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
67-
integer, parameter :: adap_dt_max_iters = 100 !< Maximum number of iterations
67+
integer, parameter :: dflt_adap_dt_max_iters = 100 !< Default max iteration for adaptive step size
68+
6869
! Constants of the algorithm described by Heirer, E. Hairer S.P.Nørsett G. Wanner, Solving Ordinary Differential Equations I, Chapter II.4
6970
! to choose the initial time step size for the adaptive time stepping routine
7071
real(wp), parameter :: threshold_first_guess = 1.e-5_wp

src/post_process/m_global_parameters.fpp

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ module m_global_parameters
284284
integer :: nb
285285
real(wp) :: R0ref
286286
real(wp) :: Ca, Web, Re_inv
287-
real(wp), dimension(:), allocatable :: weight, R0, V0
287+
real(wp), dimension(:), allocatable :: weight, R0
288288
logical :: bubbles_euler
289289
logical :: qbmm
290290
logical :: polytropic
@@ -560,7 +560,7 @@ contains
560560

561561
allocate (bub_idx%rs(nb), bub_idx%vs(nb))
562562
allocate (bub_idx%ps(nb), bub_idx%ms(nb))
563-
allocate (weight(nb), R0(nb), V0(nb))
563+
allocate (weight(nb), R0(nb))
564564

565565
if (qbmm) then
566566
allocate (bub_idx%moms(nb, nmom))
@@ -592,11 +592,7 @@ contains
592592
if (nb == 1) then
593593
weight(:) = 1._wp
594594
R0(:) = 1._wp
595-
V0(:) = 0._wp
596-
else if (nb > 1) then
597-
!call s_simpson
598-
V0(:) = 0._wp
599-
else
595+
else if (nb < 1) then
600596
stop 'Invalid value of nb'
601597
end if
602598

@@ -663,7 +659,7 @@ contains
663659

664660
allocate (bub_idx%rs(nb), bub_idx%vs(nb))
665661
allocate (bub_idx%ps(nb), bub_idx%ms(nb))
666-
allocate (weight(nb), R0(nb), V0(nb))
662+
allocate (weight(nb), R0(nb))
667663

668664
do i = 1, nb
669665
if (polytropic .neqv. .true.) then
@@ -684,10 +680,7 @@ contains
684680
if (nb == 1) then
685681
weight(:) = 1._wp
686682
R0(:) = 1._wp
687-
V0(:) = 0._wp
688-
else if (nb > 1) then
689-
V0(:) = 0._wp
690-
else
683+
else if (nb < 1) then
691684
stop 'Invalid value of nb'
692685
end if
693686

src/pre_process/m_assign_variables.fpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ contains
405405
! Bubbles euler variables
406406
if (bubbles_euler) then
407407
do i = 1, nb
408-
muR = R0(i)*patch_icpp(smooth_patch_id)%r0 ! = R0(i)
409-
muV = V0(i)*patch_icpp(smooth_patch_id)%v0 ! = 0
408+
muR = R0(i)*patch_icpp(smooth_patch_id)%r0
409+
muV = patch_icpp(smooth_patch_id)%v0
410410
if (qbmm) then
411411
! Initialize the moment set
412412
if (dist_type == 1) then
@@ -610,8 +610,8 @@ contains
610610
! Smoothed bubble variables
611611
if (bubbles_euler) then
612612
do i = 1, nb
613-
muR = R0(i)*patch_icpp(patch_id)%r0 ! = 1*R0(i)
614-
muV = V0(i)*patch_icpp(patch_id)%v0 ! = 1*V0(i)
613+
muR = R0(i)*patch_icpp(patch_id)%r0
614+
muV = patch_icpp(patch_id)%v0
615615
if (qbmm) then
616616
! Initialize the moment set
617617
if (dist_type == 1) then
@@ -630,12 +630,6 @@ contains
630630
q_prim_vf(bub_idx%fullmom(i, 0, 2))%sf(j, k, l) = muV**2 + sigV**2
631631
end if
632632
else
633-
! q_prim_vf(bub_idx%rs(i))%sf(j,k,l) = &
634-
! (eta * R0(i)*patch_icpp(patch_id)%r0 &
635-
! + (1._wp-eta)*orig_prim_vf(bub_idx%rs(i)))
636-
! q_prim_vf(bub_idx%vs(i))%sf(j,k,l) = &
637-
! (eta * V0(i)*patch_icpp(patch_id)%v0 &
638-
! + (1._wp-eta)*orig_prim_vf(bub_idx%vs(i)))
639633
q_prim_vf(bub_idx%rs(i))%sf(j, k, l) = muR
640634
q_prim_vf(bub_idx%vs(i))%sf(j, k, l) = muV
641635

src/pre_process/m_checker.fpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,10 @@ contains
137137
end subroutine s_check_inputs_grid_stretching
138138

139139
!> Checks constraints on the QBMM and polydisperse bubble parameters
140-
!! (qbmm, polydisperse, dist_type, rhoRV, and R0_type)
140+
!! (qbmm, polydisperse, dist_type and rhoRV)
141141
impure subroutine s_check_inputs_qbmm_and_polydisperse
142142
@:PROHIBIT(qbmm .and. dist_type == dflt_int, "dist_type must be set if using QBMM")
143143
@:PROHIBIT(qbmm .and. dist_type /= 1 .and. rhoRV > 0._wp, "rhoRV cannot be used with dist_type != 1")
144-
@:PROHIBIT(polydisperse .and. R0_type == dflt_int, "R0 type must be set if using Polydisperse")
145144
end subroutine s_check_inputs_qbmm_and_polydisperse
146145

147146
!> Checks constraints on initial partial density perturbation

0 commit comments

Comments
 (0)