Skip to content

Commit f45888f

Browse files
Add viscous and surface_tension logicals (#688)
Co-authored-by: Spencer Bryngelson <shb@gatech.edu>
1 parent 6bad379 commit f45888f

File tree

40 files changed

+331
-297
lines changed

40 files changed

+331
-297
lines changed

benchmarks/viscous_weno5_sgb_acoustic/case.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
cact = 1475.
8383
t0 = x0/c0
8484

85-
nbubbles = 1
85+
nbubbles = 1
8686
myr0 = R0ref
8787

8888
cfl = 0.01
@@ -98,7 +98,7 @@
9898
# Logistics ================================================
9999
'run_time_info' : 'F',
100100
# ==========================================================
101-
101+
102102
# Computational Domain Parameters ==========================
103103
'x_domain%beg' : -10.E-03/x0,
104104
'x_domain%end' : 10.E-03/x0,
@@ -127,7 +127,7 @@
127127
'time_stepper' : 3,
128128
'weno_order' : 5,
129129
'weno_eps' : 1.E-16,
130-
'weno_Re_flux' : 'F',
130+
'weno_Re_flux' : 'F',
131131
'weno_avg' : 'F',
132132
'mapped_weno' : 'T',
133133
'null_weights' : 'F',
@@ -141,15 +141,16 @@
141141
'bc_y%end' : -3,
142142
'bc_z%beg' : -3,
143143
'bc_z%end' : -3,
144+
'viscous' : 'T',
144145
# ==========================================================
145-
146+
146147
# Formatted Database Files Structure Parameters ============
147148
'format' : 1,
148149
'precision' : 2,
149150
'prim_vars_wrt' :'T',
150151
'parallel_io' :'T',
151-
# ==========================================================
152-
152+
# ==========================================================
153+
153154
# Patch 1 _ Background =====================================
154155
'patch_icpp(1)%geometry' : 9,
155156
'patch_icpp(1)%x_centroid' : 0.,
@@ -167,7 +168,7 @@
167168
'patch_icpp(1)%r0' : 1.,
168169
'patch_icpp(1)%v0' : 0.0E+00,
169170
# ==========================================================
170-
171+
171172
# Patch 2 Screen ===========================================
172173
'patch_icpp(2)%geometry' : 9,
173174
'patch_icpp(2)%x_centroid' : 0.,
@@ -186,7 +187,7 @@
186187
'patch_icpp(2)%r0' : 1.,
187188
'patch_icpp(2)%v0' : 0.0E+00,
188189
# ==========================================================
189-
190+
190191
# Fluids Physical Parameters ===============================
191192
# Surrounding liquid
192193
'fluid_pp(1)%gamma' : 1.E+00/(n_tait-1.E+00),
@@ -208,12 +209,12 @@
208209
'fluid_pp(2)%mu_v' : mu_n,
209210
'fluid_pp(2)%k_v' : k_n,
210211
# ==========================================================
211-
212+
212213
# Non-polytropic gas compression model AND/OR Tait EOS =====
213214
'pref' : p0,
214215
'rhoref' : rho0,
215216
# ==========================================================
216-
217+
217218
# Bubbles ==================================================
218219
'bubbles' : 'T',
219220
'bubble_model' : 3,
@@ -227,7 +228,7 @@
227228
'Web' : We,
228229
'Re_inv' : Re_inv,
229230
# ==========================================================
230-
231+
231232
# Acoustic source ==========================================
232233
'acoustic_source' : 'T',
233234
'num_source' : 1,

docs/documentation/case.md

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r
371371
| `n_start` | Integer | Save file from which to start simulation |
372372
| `t_save` | Real | Time duration between data output |
373373
| `t_stop` | Real | Simulation stop time |
374+
| `surface_tension` | Logical | Activate surface tension |
375+
| `viscous` | Logical | Activate viscosity |
374376

375377
- \* Options that work only with `model_eqns = 2`.
376378
- † Options that work only with ``cyl_coord = 'F'``.
@@ -445,33 +447,37 @@ If this option is false, velocity gradient is computed using finite difference s
445447
- `weno_avg` it activates the arithmetic average of the left and right, WENO-reconstructed, cell-boundary values.
446448
This option requires `weno_Re_flux` to be true because cell boundary values are only utilized when employing the scalar divergence method in the computation of velocity gradients.
447449

450+
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set.
451+
452+
- `viscous` activates viscosity when set to ``'T'``. Requires `Re(1)` and `Re(2)` to be set.
453+
448454
#### Constant Time-Stepping
449455

450-
- `dt` specifies the constant time step size that is used in simulation.
451-
The value of `dt` needs to be sufficiently small such that the Courant-Friedrichs-Lewy (CFL) condition is satisfied.
456+
- `dt` specifies the constant time step size used in the simulation.
457+
The value of `dt` needs to be sufficiently small to satisfy the Courant-Friedrichs-Lewy (CFL) condition.
452458

453-
- `t_step_start` and `t_step_end` define the time steps at which simulation starts and ends, respectively.
459+
- `t_step_start` and `t_step_end` define the time steps at which the simulation starts and ends.
454460

455461
`t_step_save` is the time step interval for data output during simulation.
456462
To newly start the simulation, set `t_step_start = 0`.
457-
To restart simulation from $k$-th time step, set `t_step_start = k`, see [Restarting Cases](running.md#restarting-cases).
463+
To restart the simulation from $k$-th time step, set `t_step_start = k`; see [Restarting Cases](running.md#restarting-cases).
458464

459465
##### Adaptive Time-Stepping
460466

461467
- `cfl_adap_dt` enables adaptive time stepping with a constant CFL when true
462468

463-
- `cfl_const_dt` enables constant dt time-stepping where dt results in a specified CFL for the initial condition
469+
- `cfl_const_dt` enables constant `dt` time-stepping where `dt` results in a specified CFL for the initial condition
464470

465471
- `cfl_target` specifies the target CFL value
466472

467473
- `n_start` specifies the save file to start at
468474

469-
- `t_save` specifies the time interval between data output during simulation
475+
- `t_save` specifies the time interval between data output during the simulation
470476

471477
- `t_stop` specifies at what time the simulation should stop
472478

473479
To newly start the simulation, set `n_start = 0`.
474-
To restart simulation from $k$-th time step, see [Restarting Cases](running.md#restarting-cases).
480+
To restart the simulation from $k$-th time step, see [Restarting Cases](running.md#restarting-cases).
475481

476482
### 7. Formatted Output
477483

@@ -512,23 +518,23 @@ The table lists formatted database output parameters. The parameters define vari
512518

513519
- `parallel_io` activates parallel input/output (I/O) of data files. It is highly recommended to activate this option in a parallel environment.
514520
With parallel I/O, MFC inputs and outputs a single file throughout pre-process, simulation, and post-process, regardless of the number of processors used.
515-
Parallel I/O enables the use of different number of processors in each of the processes (i.e., simulation data generated using 1000 processors can be post-processed using a single processor).
521+
Parallel I/O enables the use of different numbers of processors in each process (e.g., simulation data generated using 1000 processors can be post-processed using a single processor).
516522

517523
- `file_per_process` deactivates shared file MPI-IO and activates file per process MPI-IO.
518524
The default behavior is to use a shared file.
519-
File per process is useful when running on 10's of thousands of ranks.
525+
File per process is useful when running on >10K ranks.
520526
If `file_per_process` is true, then pre_process, simulation, and post_process must be run with the same number of ranks.
521527

522-
- `cons_vars_wrt` and `prim_vars_wrt` activate output of conservative and primitive state variables into the database, respectively.
528+
- `cons_vars_wrt` and `prim_vars_wrt` activate the output of conservative and primitive state variables into the database.
523529

524-
- `[variable's name]_wrt` activates output of the each specified variable into the database.
530+
- `[variable's name]_wrt` activates the output of each specified variable into the database.
525531

526532
- `schlieren_alpha(i)` specifies the intensity of the numerical Schlieren of $i$-th component.
527533

528-
- `fd_order` specifies the order of the finite difference scheme that is used to compute the vorticity from the velocity field and the numerical schlieren from the density field by an integer of 1, 2, and 4.
529-
`fd_order = 1`, `2`, and `4` correspond to the first, second, and fourth-order finite difference schemes, respectively.
534+
- `fd_order` specifies the order of the finite difference scheme used to compute the vorticity from the velocity field and the numerical schlieren from the density field using an integer of 1, 2, and 4.
535+
`fd_order = 1`, `2`, and `4` correspond to the first, second, and fourth-order finite difference schemes.
530536

531-
- `probe_wrt` activates output of state variables at coordinates specified by `probe(i)%[x;y,z]`.
537+
- `probe_wrt` activates the output of state variables at coordinates specified by `probe(i)%[x;y,z]`.
532538

533539
### 8. Acoustic Source {#acoustic-source}
534540

@@ -590,15 +596,15 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
590596

591597
- `%%foc_length` specifies the focal length of the transducer for transducer waves. It is the distance from the transducer to the focal point.
592598

593-
- `%%aperture` specifies the aperture of the transducer. It is the diameter of the projection of the transducer arc onto the y-axis (2D) or spherical cap onto the y-z plane (3D). To simulate a transducer enclosing half of the circle/sphere, set the aperture to double the focal length. For transducer array, it is the total aperture of the array.
599+
- `%%aperture` specifies the aperture of the transducer. It is the diameter of the projection of the transducer arc onto the y-axis (2D) or spherical cap onto the y-z plane (3D). Set the aperture to double the focal length to simulate a transducer enclosing half of the circle/sphere. For the transducer array, it is the total aperture of the array.
594600

595601
- `%%num_elements` specifies the number of transducer elements in a transducer array.
596602

597-
- `%%element_on` specifies the element number of the transducer array that is on. The element number starts from 1. If all elements are on, set `%%element_on` to 0.
603+
- `%%element_on` specifies the element number of the transducer array that is on. The element number starts from 1, if all elements are on, set `%%element_on` to 0.
598604

599-
- `%%element_spacing_angle` specifies the spacing angle between adjacent transducer in radians. The total aperture (`%%aperture`) is set, so each transducer element is smaller if `%%element_spacing_angle` is larger.
605+
- `%%element_spacing_angle` specifies the spacing angle between adjacent transducers in radians. The total aperture (`%%aperture`) is set, so each transducer element is smaller if `%%element_spacing_angle` is larger.
600606

601-
- `%%element_polygon_ratio` specifies the ratio of the polygon side length to the aperture diameter of each transducer element in a circular 3D transducer array. The polygon side length is calculated by using the total aperture (`%%aperture`) as the circumcicle diameter, and `%%num_elements` as the number of sides of the polygon. The ratio is used specify the aperture size of each transducer element in the array, as a ratio of the total aperture.
607+
- `%%element_polygon_ratio` specifies the ratio of the polygon side length to the aperture diameter of each transducer element in a circular 3D transducer array. The polygon side length is calculated by using the total aperture (`%%aperture`) as the circumcircle diameter and `%%num_elements` as the number of sides of the polygon. The ratio is used to specify the aperture size of each transducer element in the array as a ratio of the total aperture.
602608

603609
- `%%rotate_angle` specifies the rotation angle of the 3D circular transducer array along the x-axis (principal axis). It is optional and defaults to 0.
604610

@@ -626,16 +632,16 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
626632
| `mu_v`| Real | Viscosity |
627633
| `k_v`| Real | Thermal conductivity |
628634
| `qbmm` | Logical | Quadrature by method of moments|
629-
| `dist_type` | Integer | Joint probability density function for bubble radius and velocity (only when qbmm is true)|
630-
| `sigR` | Real | Standard deviation for probability density function of bubble radius (only when qbmm is true) |
631-
| `sigV` | Real | Standard deviation for probability density function of bubble velocity (only when qbmm is true) |
632-
| `rhoRV` | Real | Correlation coefficient for joint probability density function of bubble radius and velocity (only when qbmm is true) |
635+
| `dist_type` | Integer | Joint probability density function for bubble radius and velocity (only for ``qbmm = 'T'``)|
636+
| `sigR` | Real | Standard deviation for the probability density function of bubble radius (only for ``qbmm = 'T'``) |
637+
| `sigV` | Real | Standard deviation for the probability density function of bubble velocity (only for ``qbmm = 'T'``) |
638+
| `rhoRV` | Real | Correlation coefficient for the joint probability density function of bubble radius and velocity (only for ``qbmm = 'T'``) |
633639

634-
These options work only for gas-liquid two component flows.
640+
These options work only for gas-liquid two-component flows.
635641
Component indexes are required to be 1 for liquid and 2 for gas.
636642

637-
- \* These parameters should be pretended with patch index $1$ that is filled with liquid: `fluid_pp(1)%`.
638-
- † These parameters should be pretended with patch indexes that are respectively filled with liquid and gas: `fluid_pp(1)%` and `fluid_pp(2)%`.
643+
- \* These parameters should be prepended with patch index $1$ that is filled with liquid: `fluid_pp(1)%`.
644+
- † These parameters should be prepended with patch indexes filled with liquid and gas: `fluid_pp(1)%` and `fluid_pp(2)%`.
639645

640646
This table lists the ensemble-averaged bubble model parameters.
641647

@@ -645,9 +651,9 @@ This table lists the ensemble-averaged bubble model parameters.
645651
`bubble_model = 1`, `2`, and `3` correspond to the Gilmore, Keller-Miksis, and Rayleigh-Plesset models.
646652

647653
- `polytropic` activates polytropic gas compression in the bubble.
648-
When `polytropic` is set `False`, the gas compression is modeled as non-polytropic due to heat and mass transfer across the bubble wall with constant heat and mass transfer coefficients based on ([Preston et al., 2007](references.md#Preston07)).
654+
When ``polytropic = 'F'``, the gas compression is modeled as non-polytropic due to heat and mass transfer across the bubble wall with constant heat and mass transfer coefficients based on ([Preston et al., 2007](references.md#Preston07)).
649655

650-
- `polydisperse` activates polydispersity in the bubble model by means of a probability density function (PDF) of the equiliibrium bubble radius.
656+
- `polydisperse` activates polydispersity in the bubble model through a probability density function (PDF) of the equilibrium bubble radius.
651657

652658
- `thermal` specifies a model for heat transfer across the bubble interface by an integer from 1 through 3.
653659
`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#Preston07), respectively.
@@ -672,11 +678,11 @@ Implementation of the parameters into the model follow [Ando (2010)](references.
672678

673679
- `dist_type` specifies the initial joint PDF of initial bubble radius and bubble velocity required in qbmm. `dist_type = 1` and `2` correspond to binormal and lognormal-normal distributions respectively.
674680

675-
- `sigR` specifies the standard deviation of the PDF of bubble radius required in qbmm.
681+
- `sigR` specifies the standard deviation of the PDF of bubble radius required in the QBMM feature.
676682

677-
- `sigV` specifies the standard deviation of the PDF of bubble velocity required in qbmm.
683+
- `sigV` specifies the standard deviation of the PDF of bubble velocity required in the QBMM feature.
678684

679-
- `rhoRV` specifies the correlation coefficient of the joint PDF of bubble radius and bubble velocity required in qbmm.
685+
- `rhoRV` specifies the correlation coefficient of the joint PDF of bubble radius and bubble velocity required in the QBMM feature.
680686

681687
### 10. Velocity Field Setup
682688

@@ -705,7 +711,7 @@ The parameters are optionally used to define initial velocity profiles and pertu
705711

706712
- `perturb_sph_fluid` specifies the fluid component whose partial density is to be perturbed.
707713

708-
- `mixlayer_vel_profile` activates setting of the mean streamwise velocity to hyperbolic tangent profile. This option works only for 2D and 3D cases.
714+
- `mixlayer_vel_profile` activates setting the mean streamwise velocity to a hyperbolic tangent profile. This option works only for 2D and 3D cases.
709715

710716
- `mixlayer_vel_coef` is a parameter for the hyperbolic tangent profile of a mixing layer when `mixlayer_vel_profile = 'T'`. The mean streamwise velocity profile is given as:
711717

@@ -727,7 +733,7 @@ $$ u = patch\_icpp(1)\%vel(1) * tanh(y\_cc * mixlayer\_vel\_profile) $$
727733

728734
- `relax_model` Specifies the phase change model to be used: [5] enables pT-equilibrium, while [6] activates pTg-equilibrium (if criteria are met).
729735

730-
- `palpha_eps` Specifies the tolerance used for the Newton Solvers used in the pT-equilibrium model.
736+
- `palpha_eps` Specifies the tolerance for the Newton Solvers used in the pT-equilibrium model.
731737

732738
- `ptgalpha_eps` Specifies the tolerance used for the Newton Solvers used in the pTg-equilibrium model.
733739

@@ -855,7 +861,7 @@ Each patch requires a different set of parameters, which are also listed in this
855861
| 10 | Annular Transducer Array | 2D-Axisym | #9 requirements |
856862
| 11 | Circular Transducer Array | 3D | #7 requirements, `%%element_polygon_ratio`, and `%%rotate_angle` |
857863

858-
Details of the required parameters for each acoustic support type are listed in [Acoustic Source](#acoustic-source).
864+
The required parameters for each acoustic support type are listed in [Acoustic Source](#acoustic-source).
859865
The acoustic support number (`#`) corresponds to the acoustic support type `Acoustic(i)%%support`, where $i$ is the acoustic source index.
860866
For each `%%parameter`, prepend the parameter with `acoustic(i)%`.
861867

@@ -864,7 +870,7 @@ Additional requirements for all acoustic support types:
864870

865871
- `num_source` must be set to the total number of acoustic sources.
866872

867-
- `%%support` must be set to the acoustic support number listed in the table.
873+
- `%%support` must be set to the acoustic support number in the table.
868874

869875
- `%%dipole` is only supported for planar sources.
870876

examples/2D_TaylorGreenVortex/case.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
'bc_x%end' : -1,
5454
'bc_y%beg' : -1,
5555
'bc_y%end' : -1,
56+
'viscous' : 'T',
5657
# ==========================================================
5758

5859
# Formatted Database Files Structure Parameters ============
@@ -85,4 +86,4 @@
8586
'fluid_pp(1)%Re(1)' : 1/Mu,
8687
# ==========================================================
8788
}))
88-
# ==============================================================================
89+
# ==============================================================================

examples/2D_bubbly_steady_shock/case.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@
192192
'fluid_pp(1)%M_v' : M_v,
193193
'fluid_pp(1)%mu_v' : mu_v,
194194
'fluid_pp(1)%k_v' : k_v,
195-
#'fluid_pp(1)%Re(1)' : 80000,
196195

197196
# Last fluid_pp is always reserved for bubble gas state ===
198197
# if applicable ==========================================

examples/2D_ibm/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
# Set IB to True and add 1 patch
6363
'ib' : 'T',
6464
'num_ibs' : 1,
65+
'viscous' : 'T',
6566
# ==========================================================================
6667

6768
# Formatted Database Files Structure Parameters ============================

examples/2D_ibm_cfl_dt/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
# Set IB to True and add 1 patch
6565
'ib' : 'T',
6666
'num_ibs' : 1,
67+
'viscous' : 'T',
6768
# ==========================================================================
6869

6970
# Formatted Database Files Structure Parameters ============================

0 commit comments

Comments
 (0)