Skip to content

Commit df782b5

Browse files
fix swapped vapor gas properties (#1093)
Co-authored-by: Spencer Bryngelson <[email protected]>
1 parent 32bd630 commit df782b5

File tree

25 files changed

+569
-825
lines changed

25 files changed

+569
-825
lines changed

docs/documentation/case.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -752,29 +752,29 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
752752

753753
| Parameter | Type | Description |
754754
| ---: | :----: | :--- |
755-
| `bubbles_euler` | Logical | Ensemble-averaged bubble modeling |
756-
| `bubbles_lagrange` | Logical | Volume-averaged bubble modeling |
757-
| `bubble_model` | Integer | [1] Gilmore; [2] Keller--Miksis; [3] Rayleigh-Plesset |
758-
| `bub_pp%R0ref`*†‡ | Real | Reference bubble radius |
759-
| `bub_pp%p0ref`*†‡ | Real | Reference pressure |
760-
| `bub_pp%rho0ref`*†‡| Real | Reference density |
761-
| `bub_pp%T0ref`†‡ | Real | Reference temperature |
762-
| `bub_pp%ss`*†‡ | Real | Surface tension between host and gas (bubble) |
763-
| `bub_pp%pv`*†‡ | Real | Vapor pressure of host |
764-
| `bub_pp%vd`† ‡ | Real | Vapor diffusivity in gas (bubble) |
765-
| `bub_pp%mu_l`*†‡ | Real | Viscosity of host in liquid state |
766-
| `bub_pp%mu_v`| Real | Viscosity of host in vapor state |
767-
| `bub_pp%mu_g`| Real | Viscosity of gas (bubble) |
768-
| `bub_pp%gam_v`†‡ | Real | Specific heat ratio of host in vapor state |
769-
| `bub_pp%gam_g`*†‡ | Real | Specific heat ratio of gas (bubble) |
770-
| `bub_pp%M_v`†‡ | Real | Molecular weight of host |
771-
| `bub_pp%M_g`†‡ | Real | Molecular weight of gas (bubble) |
772-
| `bub_pp%k_v`†‡ | Real | Thermal conductivity of host in vapor state |
773-
| `bub_pp%k_g`†‡ | Real | Thermal conductivity of gas (bubble) |
774-
| `bub_pp%cp_v`| Real | Specific heat capacity in constant pressure of host in vapor state |
775-
| `bub_pp%cp_g`| Real | Specific heat capacity in constant pressure of gas (bubble) |
776-
| `bub_pp%R_v`†‡ | Real | Gas constant of host in vapor state |
777-
| `bub_pp%R_g`†‡ | Real | Gas constant of gas (bubble) |
755+
| `bubbles_euler` | Logical | Ensemble-averaged bubble modeling |
756+
| `bubbles_lagrange` | Logical | Volume-averaged bubble modeling |
757+
| `bubble_model` | Integer | [1] Gilmore; [2] Keller--Miksis; [3] Rayleigh-Plesset |
758+
| `bub_pp%%R0ref`*†‡ | Real | Reference bubble radius |
759+
| `bub_pp%%p0ref`*†‡ | Real | Reference pressure |
760+
| `bub_pp%%rho0ref`*†‡| Real | Reference density |
761+
| `bub_pp%%T0ref`†‡ | Real | Reference temperature |
762+
| `bub_pp%%ss`*†‡ | Real | Surface tension between host and gas (bubble) |
763+
| `bub_pp%%pv`*†‡ | Real | Vapor pressure of host |
764+
| `bub_pp%%vd`† ‡ | Real | Vapor diffusivity in gas (bubble) |
765+
| `bub_pp%%mu_l`*†‡ | Real | Viscosity of host in liquid state |
766+
| `bub_pp%%mu_v`| Real | Viscosity of host in vapor state |
767+
| `bub_pp%%mu_g`| Real | Viscosity of gas (bubble) |
768+
| `bub_pp%%gam_v`†‡ | Real | Specific heat ratio of host in vapor state |
769+
| `bub_pp%%gam_g`*†‡ | Real | Specific heat ratio of gas (bubble) |
770+
| `bub_pp%%M_v`†‡ | Real | Molecular weight of host |
771+
| `bub_pp%%M_g`†‡ | Real | Molecular weight of gas (bubble) |
772+
| `bub_pp%%k_v`†‡ | Real | Thermal conductivity of host in vapor state |
773+
| `bub_pp%%k_g`†‡ | Real | Thermal conductivity of gas (bubble) |
774+
| `bub_pp%%cp_v`| Real | Specific heat capacity in constant pressure of host in vapor state |
775+
| `bub_pp%%cp_g`| Real | Specific heat capacity in constant pressure of gas (bubble) |
776+
| `bub_pp%%R_v`†‡ | Real | Gas constant of host in vapor state |
777+
| `bub_pp%%R_g`†‡ | Real | Gas constant of gas (bubble) |
778778

779779
- \* These parameters are required for ensemble-averaged bubble model.
780780
- † These parameters are required for ensemble-averaged bubble model with `polytropic = F`.

examples/2D_lagrange_bubblescreen/case.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
R_uni = 8314 # Universal gas constant - J/kmol/K
2727
MW_g = 28.0 # Molar weight of the gas - kg/kmol
2828
MW_v = 18.0 # Molar weight of the vapor - kg/kmol
29-
gamma_g = 1.4 # Specific heat ratio of the gas
30-
gamma_v = 1.333 # Specific heat ratio of the vapor
29+
gam_g = 1.4 # Specific heat ratio of the gas
30+
gam_v = 1.333 # Specific heat ratio of the vapor
3131
pv = 2350 # Vapor pressure of the host - Pa
3232
cp_g = 1.0e3 # Specific heat of the gas - J/kg/K
3333
cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K
@@ -128,6 +128,8 @@
128128
# Lagrangian Bubbles
129129
"bubbles_lagrange": "T",
130130
"bubble_model": 2, # Keller-Miksis model
131+
"thermal": 3,
132+
"polytropic": "F",
131133
"lag_params%nBubs_glb": 1194, # Number of bubbles
132134
"lag_params%solver_approach": 2,
133135
"lag_params%cluster_type": 2,
@@ -139,33 +141,34 @@
139141
"lag_params%valmaxvoid": 0.9,
140142
"lag_params%write_bubbles": "F",
141143
"lag_params%write_bubbles_stats": "F",
142-
"lag_params%c0": c0,
143-
"lag_params%rho0": rho0,
144-
"lag_params%T0": T0,
145-
"lag_params%x0": x0,
146-
"lag_params%diffcoefvap": diffVapor,
147-
"lag_params%Thost": T_host,
148-
"lag_params%charwidth": z_virtual / x0,
144+
# Bubble parameters
145+
"bub_pp%R0ref": 1.0,
146+
"bub_pp%p0ref": 1.0,
147+
"bub_pp%rho0ref": 1.0,
148+
"bub_pp%T0ref": 1.0,
149+
"bub_pp%ss": sigBubble / (rho0 * x0 * c0 * c0),
150+
"bub_pp%pv": pv / p0,
151+
"bub_pp%vd": diffVapor / (x0 * c0),
152+
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
153+
"bub_pp%gam_v": gam_v,
154+
"bub_pp%gam_g": gam_g,
155+
"bub_pp%M_v": MW_v,
156+
"bub_pp%M_g": MW_g,
157+
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
158+
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
159+
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
160+
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
161+
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
162+
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
149163
# Fluids Physical Parameters
150164
# Host medium
151165
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),
152166
"fluid_pp(1)%pi_inf": gamma_host * (pi_inf_host / p0) / (gamma_host - 1.0),
153167
"fluid_pp(1)%Re(1)": 1.0 / (mu_host / (rho0 * c0 * x0)),
154-
"fluid_pp(1)%mul0": mu_host,
155-
"fluid_pp(1)%ss": sigBubble,
156-
"fluid_pp(1)%pv": pv,
157-
"fluid_pp(1)%gamma_v": gamma_v,
158-
"fluid_pp(1)%M_v": MW_v,
159-
"fluid_pp(1)%k_v": k_v,
160-
"fluid_pp(1)%cp_v": cp_v,
161168
# Bubble gas state
162-
"fluid_pp(2)%gamma": 1.0 / (gamma_g - 1.0),
169+
"fluid_pp(2)%gamma": 1.0 / (gam_g - 1.0),
163170
"fluid_pp(2)%pi_inf": 0.0e00,
164171
"fluid_pp(2)%Re(1)": 1.0 / (mu_g / (rho0 * c0 * x0)),
165-
"fluid_pp(2)%gamma_v": gamma_g,
166-
"fluid_pp(2)%M_v": MW_g,
167-
"fluid_pp(2)%k_v": k_g,
168-
"fluid_pp(2)%cp_v": cp_g,
169172
}
170173
)
171174
)

examples/3D_lagrange_bubblescreen/case.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@
162162
"bub_pp%pv": pv / p0,
163163
"bub_pp%vd": diffVapor / (x0 * c0),
164164
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
165-
"bub_pp%gam_v": gam_g,
166-
"bub_pp%gam_g": gam_v,
167-
"bub_pp%M_v": MW_g,
168-
"bub_pp%M_g": MW_v,
169-
"bub_pp%k_v": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
170-
"bub_pp%k_g": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
171-
"bub_pp%cp_v": cp_g * (T0 / (c0 * c0)),
172-
"bub_pp%cp_g": cp_v * (T0 / (c0 * c0)),
173-
"bub_pp%R_v": (R_uni / MW_g) * (T0 / (c0 * c0)),
174-
"bub_pp%R_g": (R_uni / MW_v) * (T0 / (c0 * c0)),
165+
"bub_pp%gam_v": gam_v,
166+
"bub_pp%gam_g": gam_g,
167+
"bub_pp%M_v": MW_v,
168+
"bub_pp%M_g": MW_g,
169+
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
170+
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
171+
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
172+
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
173+
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
174+
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
175175
# Fluids Physical Parameters
176176
# Host medium
177177
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),

examples/3D_lagrange_shbubcollapse/case.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@
164164
"bub_pp%pv": pv / p0,
165165
"bub_pp%vd": diffVapor / (x0 * c0),
166166
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
167-
"bub_pp%gam_v": gam_g,
168-
"bub_pp%gam_g": gam_v,
169-
"bub_pp%M_v": MW_g,
170-
"bub_pp%M_g": MW_v,
171-
"bub_pp%k_v": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
172-
"bub_pp%k_g": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
173-
"bub_pp%cp_v": cp_g * (T0 / (c0 * c0)),
174-
"bub_pp%cp_g": cp_v * (T0 / (c0 * c0)),
175-
"bub_pp%R_v": (R_uni / MW_g) * (T0 / (c0 * c0)),
176-
"bub_pp%R_g": (R_uni / MW_v) * (T0 / (c0 * c0)),
167+
"bub_pp%gam_v": gam_v,
168+
"bub_pp%gam_g": gam_g,
169+
"bub_pp%M_v": MW_v,
170+
"bub_pp%M_g": MW_g,
171+
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
172+
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
173+
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
174+
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
175+
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
176+
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
177177
# Fluids Physical Parameters
178178
# Host medium
179179
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),

src/common/m_derived_types.fpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,6 @@ module m_derived_types
473473
real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
474474
real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
475475
real(wp) :: valmaxvoid !< Maximum void fraction permitted
476-
real(wp) :: c0 !< Reference speed
477-
real(wp) :: rho0 !< Reference density
478-
real(wp) :: T0, Thost !< Reference temperature and host temperature
479-
real(wp) :: x0 !< Reference length
480476
481477
end type bubbles_lagrange_parameters
482478

src/simulation/m_global_parameters.fpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,11 +832,6 @@ contains
832832
lag_params%epsilonb = 1._wp
833833
lag_params%charwidth = dflt_real
834834
lag_params%valmaxvoid = dflt_real
835-
lag_params%c0 = dflt_real
836-
lag_params%rho0 = dflt_real
837-
lag_params%T0 = dflt_real
838-
lag_params%Thost = dflt_real
839-
lag_params%x0 = dflt_real
840835
841836
! Continuum damage model
842837
tau_star = dflt_real

src/simulation/m_mpi_proxy.fpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ contains
140140
call MPI_BCAST(lag_params%${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
141141
#:endfor
142142
143-
#:for VAR in [ 'c0', 'rho0', 'T0', 'x0', 'epsilonb','charwidth', &
144-
& 'valmaxvoid', 'Thost']
143+
#:for VAR in ['epsilonb','charwidth','valmaxvoid']
145144
call MPI_BCAST(lag_params%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
146145
#:endfor
147146
end if

0 commit comments

Comments
 (0)