Skip to content
Merged
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
46 changes: 23 additions & 23 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,29 +752,29 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon

| Parameter | Type | Description |
| ---: | :----: | :--- |
| `bubbles_euler` | Logical | Ensemble-averaged bubble modeling |
| `bubbles_lagrange` | Logical | Volume-averaged bubble modeling |
| `bubble_model` | Integer | [1] Gilmore; [2] Keller--Miksis; [3] Rayleigh-Plesset |
| `bub_pp%R0ref`*†‡ | Real | Reference bubble radius |
| `bub_pp%p0ref`*†‡ | Real | Reference pressure |
| `bub_pp%rho0ref`*†‡| Real | Reference density |
| `bub_pp%T0ref`†‡ | Real | Reference temperature |
| `bub_pp%ss`*†‡ | Real | Surface tension between host and gas (bubble) |
| `bub_pp%pv`*†‡ | Real | Vapor pressure of host |
| `bub_pp%vd`† ‡ | Real | Vapor diffusivity in gas (bubble) |
| `bub_pp%mu_l`*†‡ | Real | Viscosity of host in liquid state |
| `bub_pp%mu_v`† | Real | Viscosity of host in vapor state |
| `bub_pp%mu_g`† | Real | Viscosity of gas (bubble) |
| `bub_pp%gam_v`†‡ | Real | Specific heat ratio of host in vapor state |
| `bub_pp%gam_g`*†‡ | Real | Specific heat ratio of gas (bubble) |
| `bub_pp%M_v`†‡ | Real | Molecular weight of host |
| `bub_pp%M_g`†‡ | Real | Molecular weight of gas (bubble) |
| `bub_pp%k_v`†‡ | Real | Thermal conductivity of host in vapor state |
| `bub_pp%k_g`†‡ | Real | Thermal conductivity of gas (bubble) |
| `bub_pp%cp_v`‡ | Real | Specific heat capacity in constant pressure of host in vapor state |
| `bub_pp%cp_g`‡ | Real | Specific heat capacity in constant pressure of gas (bubble) |
| `bub_pp%R_v`†‡ | Real | Gas constant of host in vapor state |
| `bub_pp%R_g`†‡ | Real | Gas constant of gas (bubble) |
| `bubbles_euler` | Logical | Ensemble-averaged bubble modeling |
| `bubbles_lagrange` | Logical | Volume-averaged bubble modeling |
| `bubble_model` | Integer | [1] Gilmore; [2] Keller--Miksis; [3] Rayleigh-Plesset |
| `bub_pp%%R0ref`*†‡ | Real | Reference bubble radius |
| `bub_pp%%p0ref`*†‡ | Real | Reference pressure |
| `bub_pp%%rho0ref`*†‡| Real | Reference density |
| `bub_pp%%T0ref`†‡ | Real | Reference temperature |
| `bub_pp%%ss`*†‡ | Real | Surface tension between host and gas (bubble) |
| `bub_pp%%pv`*†‡ | Real | Vapor pressure of host |
| `bub_pp%%vd`† ‡ | Real | Vapor diffusivity in gas (bubble) |
| `bub_pp%%mu_l`*†‡ | Real | Viscosity of host in liquid state |
| `bub_pp%%mu_v`† | Real | Viscosity of host in vapor state |
| `bub_pp%%mu_g`† | Real | Viscosity of gas (bubble) |
| `bub_pp%%gam_v`†‡ | Real | Specific heat ratio of host in vapor state |
| `bub_pp%%gam_g`*†‡ | Real | Specific heat ratio of gas (bubble) |
| `bub_pp%%M_v`†‡ | Real | Molecular weight of host |
| `bub_pp%%M_g`†‡ | Real | Molecular weight of gas (bubble) |
| `bub_pp%%k_v`†‡ | Real | Thermal conductivity of host in vapor state |
| `bub_pp%%k_g`†‡ | Real | Thermal conductivity of gas (bubble) |
| `bub_pp%%cp_v`‡ | Real | Specific heat capacity in constant pressure of host in vapor state |
| `bub_pp%%cp_g`‡ | Real | Specific heat capacity in constant pressure of gas (bubble) |
| `bub_pp%%R_v`†‡ | Real | Gas constant of host in vapor state |
| `bub_pp%%R_g`†‡ | Real | Gas constant of gas (bubble) |

- \* These parameters are required for ensemble-averaged bubble model.
- † These parameters are required for ensemble-averaged bubble model with `polytropic = F`.
Expand Down
45 changes: 24 additions & 21 deletions examples/2D_lagrange_bubblescreen/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
R_uni = 8314 # Universal gas constant - J/kmol/K
MW_g = 28.0 # Molar weight of the gas - kg/kmol
MW_v = 18.0 # Molar weight of the vapor - kg/kmol
gamma_g = 1.4 # Specific heat ratio of the gas
gamma_v = 1.333 # Specific heat ratio of the vapor
gam_g = 1.4 # Specific heat ratio of the gas
gam_v = 1.333 # Specific heat ratio of the vapor
pv = 2350 # Vapor pressure of the host - Pa
cp_g = 1.0e3 # Specific heat of the gas - J/kg/K
cp_v = 2.1e3 # Specific heat of the vapor - J/kg/K
Expand Down Expand Up @@ -128,6 +128,8 @@
# Lagrangian Bubbles
"bubbles_lagrange": "T",
"bubble_model": 2, # Keller-Miksis model
"thermal": 3,
"polytropic": "F",
"lag_params%nBubs_glb": 1194, # Number of bubbles
"lag_params%solver_approach": 2,
"lag_params%cluster_type": 2,
Expand All @@ -139,33 +141,34 @@
"lag_params%valmaxvoid": 0.9,
"lag_params%write_bubbles": "F",
"lag_params%write_bubbles_stats": "F",
"lag_params%c0": c0,
"lag_params%rho0": rho0,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing charwidth parameter in 2D Lagrangian bubble example

The 2D Lagrangian bubble example no longer sets lag_params%charwidth, but this parameter is required for 2D non-cylindrical simulations. The simulation code uses charwidth for cell volume calculations and particle domain boundary checks in m_bubbles_EL.fpp. Without setting it, the default value of -1e6 is used, causing incorrect volume calculations (negative volumes) and domain checks. The variable z_virtual is still defined on line 52 but is now unused after this change removed "lag_params%charwidth": z_virtual / x0.

Fix in Cursor Fix in Web

"lag_params%T0": T0,
"lag_params%x0": x0,
"lag_params%diffcoefvap": diffVapor,
"lag_params%Thost": T_host,
"lag_params%charwidth": z_virtual / x0,
# Bubble parameters
"bub_pp%R0ref": 1.0,
"bub_pp%p0ref": 1.0,
"bub_pp%rho0ref": 1.0,
"bub_pp%T0ref": 1.0,
"bub_pp%ss": sigBubble / (rho0 * x0 * c0 * c0),
"bub_pp%pv": pv / p0,
"bub_pp%vd": diffVapor / (x0 * c0),
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
"bub_pp%gam_v": gam_v,
"bub_pp%gam_g": gam_g,
"bub_pp%M_v": MW_v,
"bub_pp%M_g": MW_g,
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
# Fluids Physical Parameters
# Host medium
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),
"fluid_pp(1)%pi_inf": gamma_host * (pi_inf_host / p0) / (gamma_host - 1.0),
"fluid_pp(1)%Re(1)": 1.0 / (mu_host / (rho0 * c0 * x0)),
"fluid_pp(1)%mul0": mu_host,
"fluid_pp(1)%ss": sigBubble,
"fluid_pp(1)%pv": pv,
"fluid_pp(1)%gamma_v": gamma_v,
"fluid_pp(1)%M_v": MW_v,
"fluid_pp(1)%k_v": k_v,
"fluid_pp(1)%cp_v": cp_v,
# Bubble gas state
"fluid_pp(2)%gamma": 1.0 / (gamma_g - 1.0),
"fluid_pp(2)%gamma": 1.0 / (gam_g - 1.0),
"fluid_pp(2)%pi_inf": 0.0e00,
"fluid_pp(2)%Re(1)": 1.0 / (mu_g / (rho0 * c0 * x0)),
"fluid_pp(2)%gamma_v": gamma_g,
"fluid_pp(2)%M_v": MW_g,
"fluid_pp(2)%k_v": k_g,
"fluid_pp(2)%cp_v": cp_g,
}
)
)
20 changes: 10 additions & 10 deletions examples/3D_lagrange_bubblescreen/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@
"bub_pp%pv": pv / p0,
"bub_pp%vd": diffVapor / (x0 * c0),
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
"bub_pp%gam_v": gam_g,
"bub_pp%gam_g": gam_v,
"bub_pp%M_v": MW_g,
"bub_pp%M_g": MW_v,
"bub_pp%k_v": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%k_g": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%cp_v": cp_g * (T0 / (c0 * c0)),
"bub_pp%cp_g": cp_v * (T0 / (c0 * c0)),
"bub_pp%R_v": (R_uni / MW_g) * (T0 / (c0 * c0)),
"bub_pp%R_g": (R_uni / MW_v) * (T0 / (c0 * c0)),
"bub_pp%gam_v": gam_v,
"bub_pp%gam_g": gam_g,
"bub_pp%M_v": MW_v,
"bub_pp%M_g": MW_g,
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
# Fluids Physical Parameters
# Host medium
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),
Expand Down
20 changes: 10 additions & 10 deletions examples/3D_lagrange_shbubcollapse/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,16 @@
"bub_pp%pv": pv / p0,
"bub_pp%vd": diffVapor / (x0 * c0),
"bub_pp%mu_l": mu_host / (rho0 * x0 * c0),
"bub_pp%gam_v": gam_g,
"bub_pp%gam_g": gam_v,
"bub_pp%M_v": MW_g,
"bub_pp%M_g": MW_v,
"bub_pp%k_v": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%k_g": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%cp_v": cp_g * (T0 / (c0 * c0)),
"bub_pp%cp_g": cp_v * (T0 / (c0 * c0)),
"bub_pp%R_v": (R_uni / MW_g) * (T0 / (c0 * c0)),
"bub_pp%R_g": (R_uni / MW_v) * (T0 / (c0 * c0)),
"bub_pp%gam_v": gam_v,
"bub_pp%gam_g": gam_g,
"bub_pp%M_v": MW_v,
"bub_pp%M_g": MW_g,
"bub_pp%k_v": k_v * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%k_g": k_g * (T0 / (x0 * rho0 * c0 * c0 * c0)),
"bub_pp%cp_v": cp_v * (T0 / (c0 * c0)),
"bub_pp%cp_g": cp_g * (T0 / (c0 * c0)),
"bub_pp%R_v": (R_uni / MW_v) * (T0 / (c0 * c0)),
"bub_pp%R_g": (R_uni / MW_g) * (T0 / (c0 * c0)),
# Fluids Physical Parameters
# Host medium
"fluid_pp(1)%gamma": 1.0 / (gamma_host - 1.0),
Expand Down
4 changes: 0 additions & 4 deletions src/common/m_derived_types.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@ module m_derived_types
real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
real(wp) :: valmaxvoid !< Maximum void fraction permitted
real(wp) :: c0 !< Reference speed
real(wp) :: rho0 !< Reference density
real(wp) :: T0, Thost !< Reference temperature and host temperature
real(wp) :: x0 !< Reference length

end type bubbles_lagrange_parameters

Expand Down
5 changes: 0 additions & 5 deletions src/simulation/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,11 +832,6 @@ contains
lag_params%epsilonb = 1._wp
lag_params%charwidth = dflt_real
lag_params%valmaxvoid = dflt_real
lag_params%c0 = dflt_real
lag_params%rho0 = dflt_real
lag_params%T0 = dflt_real
lag_params%Thost = dflt_real
lag_params%x0 = dflt_real

! Continuum damage model
tau_star = dflt_real
Expand Down
3 changes: 1 addition & 2 deletions src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ contains
call MPI_BCAST(lag_params%${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor

#:for VAR in [ 'c0', 'rho0', 'T0', 'x0', 'epsilonb','charwidth', &
& 'valmaxvoid', 'Thost']
#:for VAR in ['epsilonb','charwidth','valmaxvoid']
call MPI_BCAST(lag_params%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
#:endfor
end if
Expand Down
Loading
Loading