Skip to content

Commit b41386d

Browse files
authored
Updates and corrections to surface tension (#728)
1 parent bb21236 commit b41386d

File tree

10 files changed

+211
-115
lines changed

10 files changed

+211
-115
lines changed

docs/documentation/case.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ MPI topology is automatically optimized to maximize the parallel efficiency for
165165
| `pres` * | Real | Supported | Pressure. |
166166
| `vel(i)` * | Real | Supported | Velocity in direction $i$. |
167167
| `hcid` * | Integer | N/A | Hard coded patch id |
168+
| `cf_val` * | Real | Supported | Surface tension color function value |
168169
| `model%%filepath` | String | Not Supported | Path to an STL or OBJ file (not all OBJs are supported). |
169170
| `model%%scale(i)` | Real | Not Supported | Model's (applied) scaling factor for component $i$. |
170171
| `model%%rotate(i)` | Real | Not Supported | Model's (applied) angle of rotation about axis $i$. |
@@ -447,7 +448,7 @@ If this option is false, velocity gradient is computed using finite difference s
447448
- `weno_avg` it activates the arithmetic average of the left and right, WENO-reconstructed, cell-boundary values.
448449
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.
449450

450-
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set.
451+
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set and `num_fluids`. The color function in each patch should be assigned such that `patch_icpp(i)%cf_val = 1` in patches where `patch_icpp(i)%alpha = 1 - eps` and `patch_icpp(i)%cf_val = 0` in patches where `patch_icpp(i)%alpha = eps`.
451452

452453
- `viscous` activates viscosity when set to ``'T'``. Requires `Re(1)` and `Re(2)` to be set.
453454

@@ -577,7 +578,7 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
577578

578579
- `%%dipole` changes the default monopole (one-sided) source to a dipole source. It is only available for planar waves.
579580

580-
- `%%loc(j)` specifies the location of the acoustic source in the $j$-th coordinate direction. For planer support, the location defines midpoint of the source plane. For transducer arrays, the location defines the center of the transducer or transducer array (not the focal point; for 3D it's the tip of the spherical cap, for 2D it's the tip of the arc).
581+
- `%%loc(j)` specifies the location of the acoustic source in the $j$-th coordinate direction. For planer support, the location defines midpoint of the source plane. For transducer arrays, the location defines the center of the transducer or transducer array (not the focal point; for 3D it's the tip of the spherical cap, for 2D it's the tip of the arc).
581582

582583
- `%%pulse` specifies the acoustic wave form. `%%pulse = 1`, `2`, `3` and `4` correspond to sinusoidal wave, Gaussian wave, square wave and broadband wave, respectively. The implementation of the broadband wave is based on [Tam (2005)](references.md#Tam05)
583584

@@ -601,13 +602,13 @@ Details of the transducer acoustic source model can be found in [Maeda and Colon
601602

602603
- `%%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.
603604

604-
- `%%num_elements` specifies the number of transducer elements in a transducer array.
605+
- `%%num_elements` specifies the number of transducer elements in a transducer array.
605606

606607
- `%%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.
607608

608609
- `%%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.
609610

610-
- `%%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.
611+
- `%%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.
611612

612613
- `%%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.
613614

@@ -847,14 +848,14 @@ Each patch requires a different set of parameters, which are also listed in this
847848

848849
### Immersed Boundary Patch Types
849850

850-
| # | Name | Dim. |
851-
| ---: | :----: | :--- |
852-
| 2 | 2D Circle | 2 |
853-
| 3 | 2D Rectangle | 2 |
854-
| 4 | 2D Airfoil | 2 |
855-
| 8 | 3D Sphere | 3 |
856-
| 10 | 3D Cylinder | 3 |
857-
| 11 | 3D Airfoil | 3 |
851+
| # | Name | Dim. |
852+
| ---: | :----: | :--- |
853+
| 2 | 2D Circle | 2 |
854+
| 3 | 2D Rectangle | 2 |
855+
| 4 | 2D Airfoil | 2 |
856+
| 8 | 3D Sphere | 3 |
857+
| 10 | 3D Cylinder | 3 |
858+
| 11 | 3D Airfoil | 3 |
858859

859860
### Acoustic Supports {#acoustic-supports}
860861

src/common/m_checker_common.fpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ contains
290290
!> Checks constraints on the surface tension parameters.
291291
!! Called by s_check_inputs_common for all three stages
292292
subroutine s_check_inputs_surface_tension
293+
294+
integer :: i
295+
293296
@:PROHIBIT(surface_tension .and. sigma < 0d0, &
294297
"sigma must be greater than or equal to zero")
295298

@@ -302,6 +305,16 @@ contains
302305
@:PROHIBIT(surface_tension .and. model_eqns /= 3, &
303306
"The surface tension model requires model_eqns=3")
304307

308+
@:PROHIBIT(surface_tension .and. num_fluids /= 2, &
309+
"The surface tension model requires num_fluids=2")
310+
311+
#ifdef MFC_PRE_PROCESS
312+
do i = 1, num_patches
313+
@:PROHIBIT(surface_tension .and. f_is_default(patch_icpp(i)%cf_val), &
314+
"patch_icpp(i)%cf_val must be set if surface_tension is enabled")
315+
end do
316+
#endif MFC_PRE_PROCESS
317+
305318
end subroutine s_check_inputs_surface_tension
306319

307320
!> Checks constraints on the inputs for moving boundaries.

src/post_process/m_mpi_proxy.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ contains
169169
& 'heat_ratio_wrt', 'pi_inf_wrt', 'pres_inf_wrt', 'cons_vars_wrt', &
170170
& 'prim_vars_wrt', 'c_wrt', 'qm_wrt','schlieren_wrt', 'bubbles', 'qbmm', &
171171
& 'polytropic', 'polydisperse', 'file_per_process', 'relax', 'cf_wrt', &
172-
& 'adv_n', 'ib', 'cfl_adap_dt', 'cfl_const_dt', 'cfl_dt' ]
172+
& 'adv_n', 'ib', 'cfl_adap_dt', 'cfl_const_dt', 'cfl_dt', &
173+
& 'surface_tension' ]
173174
call MPI_BCAST(${VAR}$, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)
174175
#:endfor
175176

tests/26264582/golden.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

tests/26264582/golden-metadata.txt renamed to tests/3859AF63/golden-metadata.txt

Lines changed: 69 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)