Skip to content

Commit 96f7006

Browse files
Hyeoksu LeeHyeoksu Lee
authored andcommitted
reduce redundancy
1 parent 76d6a5c commit 96f7006

File tree

15 files changed

+29
-25
lines changed

15 files changed

+29
-25
lines changed

examples/1D_qbmm/case.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
M_n = 28.97
2626
mu_n = 1.8e-05
2727
k_n = 0.02556
28+
D = 0.242e-4
2829

2930
# air props
3031
# gamma_gas = gamma_n
@@ -163,6 +164,7 @@
163164
"fluid_pp(2)%M_v": M_n,
164165
"fluid_pp(2)%mu_v": mu_n,
165166
"fluid_pp(2)%k_v": k_n,
167+
"fluid_pp(2)%D_v": D,
166168
# Non-polytropic gas compression model AND/OR Tait EOS
167169
"pref": p0,
168170
"rhoref": rho0,

examples/3D_lagrange_bubblescreen/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
"lag_params%rho0": rho0,
156156
"lag_params%T0": T0,
157157
"lag_params%x0": x0,
158-
"lag_params%diffcoefvap": diffVapor,
159158
"lag_params%Thost": T_host,
160159
# Fluids Physical Parameters
161160
# Host medium
@@ -177,6 +176,7 @@
177176
"fluid_pp(2)%M_v": MW_g,
178177
"fluid_pp(2)%k_v": k_g,
179178
"fluid_pp(2)%cp_v": cp_g,
179+
"fluid_pp(2)%D_v": diffVapor
180180
}
181181
)
182182
)

examples/3D_lagrange_shbubcollapse/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
"lag_params%rho0": rho0,
158158
"lag_params%T0": T0,
159159
"lag_params%x0": x0,
160-
"lag_params%diffcoefvap": diffVapor,
161160
"lag_params%Thost": T_host,
162161
# Fluids Physical Parameters
163162
# Host medium
@@ -179,6 +178,7 @@
179178
"fluid_pp(2)%M_v": MW_g,
180179
"fluid_pp(2)%k_v": k_g,
181180
"fluid_pp(2)%cp_v": cp_g,
181+
"fluid_pp(2)%D_v": diffVapor
182182
}
183183
)
184184
)

src/common/m_derived_types.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ module m_derived_types
357357
real(wp) :: k_v !< Bubble constants (see Preston (2007), Ando (2010))
358358
real(wp) :: cp_v
359359
real(wp) :: G
360+
real(wp) :: D_v !< Vapor diffusivity in the gas
361+
360362
end type physical_parameters
361363
362364
type mpi_io_airfoil_ib_var
@@ -459,7 +461,6 @@ module m_derived_types
459461
real(wp) :: rho0 !< Reference density
460462
real(wp) :: T0, Thost !< Reference temperature and host temperature
461463
real(wp) :: x0 !< Reference length
462-
real(wp) :: diffcoefvap !< Vapor diffusivity in the gas
463464
464465
end type bubbles_lagrange_parameters
465466

src/common/m_helper.fpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ contains
116116
real(wp), parameter :: k_poly = 1._wp !<
117117
!! polytropic index used to compute isothermal natural frequency
118118

119-
real(wp), parameter :: Ru = 8314._wp !<
120-
!! universal gas constant
121-
122119
rhol0 = rhoref
123120
pl0 = pref
124121
#ifdef MFC_SIMULATION
@@ -154,15 +151,15 @@ contains
154151
if (thermal == 2) gamma_m = 1._wp
155152

156153
temp = 293.15_wp
157-
D_m = 0.242e-4_wp
154+
D_m = fluid_pp(2)%D_v
158155
uu = sqrt(pl0/rhol0)
159156

160157
omega_ref = 3._wp*k_poly*Ca + 2._wp*(3._wp*k_poly - 1._wp)/Web
161158

162159
!!! thermal properties !!!
163160
! gas constants
164-
R_n = Ru/M_n
165-
R_v = Ru/M_v
161+
R_n = R_uni/M_n
162+
R_v = R_uni/M_v
166163
! phi_vn & phi_nv (phi_nn = phi_vv = 1)
167164
phi_vn = (1._wp + sqrt(mu_v/mu_n)*(M_n/M_v)**(0.25_wp))**2 &
168165
/(sqrt(8._wp)*sqrt(1._wp + M_v/M_n))

src/post_process/m_global_parameters.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ contains
423423
fluid_pp(i)%qv = 0._wp
424424
fluid_pp(i)%qvp = 0._wp
425425
fluid_pp(i)%G = dflt_real
426+
fluid_pp(i)%D_v = dflt_Real
426427
end do
427428

428429
! Formatted database file(s) structure parameters

src/post_process/m_mpi_proxy.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ contains
133133
call MPI_BCAST(fluid_pp(i)%qv, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
134134
call MPI_BCAST(fluid_pp(i)%qvp, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
135135
call MPI_BCAST(fluid_pp(i)%G, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
136+
call MPI_BCAST(fluid_pp(i)%D_v, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
136137
end do
137138
138139
#:for VAR in [ 'pref', 'rhoref', 'R0ref', 'poly_sigma', 'Web', 'Ca', &

src/pre_process/m_global_parameters.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@ contains
584584
fluid_pp(i)%qv = 0._wp
585585
fluid_pp(i)%qvp = 0._wp
586586
fluid_pp(i)%G = 0._wp
587+
fluid_pp(i)%D_v = dflt_real
587588
end do
588589

589590
Bx0 = dflt_real

src/pre_process/m_mpi_proxy.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ contains
144144
! Fluids physical parameters
145145
do i = 1, num_fluids_max
146146
#:for VAR in [ 'gamma','pi_inf','mul0','ss','pv','gamma_v','M_v', &
147-
& 'mu_v','k_v', 'G', 'cv', 'qv', 'qvp' ]
147+
& 'mu_v','k_v', 'G', 'cv', 'qv', 'qvp', 'D_v' ]
148148
call MPI_BCAST(fluid_pp(i)%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
149149
#:endfor
150150
end do
151151
152152
! Simplex noise and fluid physical parameters
153153
do i = 1, num_fluids_max
154154
#:for VAR in [ 'gamma','pi_inf','mul0','ss','pv','gamma_v','M_v', &
155-
& 'mu_v','k_v', 'G', 'cv', 'qv', 'qvp' ]
155+
& 'mu_v','k_v', 'G', 'cv', 'qv', 'qvp', 'D_v' ]
156156
call MPI_BCAST(fluid_pp(i)%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
157157
#:endfor
158158

src/simulation/m_bubbles_EL.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ contains
178178
cp_n = fluid_pp(id_host)%cp_v*(T0/(c0*c0))
179179
R_v = (R_uni/fluid_pp(id_bubbles)%M_v)*(T0/(c0*c0))
180180
R_n = (R_uni/fluid_pp(id_host)%M_v)*(T0/(c0*c0))
181-
lag_params%diffcoefvap = lag_params%diffcoefvap/(x0*c0)
181+
fluid_pp(id_bubbles)%D_v = fluid_pp(id_bubbles)%D_v/(x0*c0)
182182
ss = fluid_pp(id_host)%ss/(rho0*x0*c0*c0)
183183
mul0 = fluid_pp(id_host)%mul0/(rho0*x0*c0)
184184
@@ -386,9 +386,9 @@ contains
386386
call s_transcoeff(1._wp, PeT, Re_trans, Im_trans)
387387
gas_betaT(bub_id) = Re_trans*(heatflag)*kparticle
388388

389-
PeG = bub_R0(bub_id)**2._wp*omegaN_local/lag_params%diffcoefvap
389+
PeG = bub_R0(bub_id)**2._wp*omegaN_local/fluid_pp(num_fluids)%D_v
390390
call s_transcoeff(1._wp, PeG, Re_trans, Im_trans)
391-
gas_betaC(bub_id) = Re_trans*(massflag)*lag_params%diffcoefvap
391+
gas_betaC(bub_id) = Re_trans*(massflag)*fluid_pp(num_fluids)%D_v
392392

393393
if (gas_mg(bub_id) <= 0._wp) then
394394
call s_mpi_abort("Negative gas mass in the bubble, check if the bubble is in the domain.")

0 commit comments

Comments
 (0)