Skip to content

Commit d7d483c

Browse files
authored
Merge pull request #22 from S-Explorer/development
fix some WARNING, add bib ref
2 parents ed589ed + 24c190d commit d7d483c

7 files changed

Lines changed: 46 additions & 44 deletions

File tree

.github/workflows/test_IAMReX.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
# schedule:
55
# - cron: "*/5 * * * *"
66
push:
7+
paths:
8+
- 'Source/**'
9+
710
jobs:
811
test-IAMReX:
912
runs-on: ubuntu-latest
@@ -31,4 +34,4 @@ jobs:
3134
python Test_IAMReX/test_IAMReX.py
3235
- name: Finished.
3336
run: |
34-
echo "Tests completed!"
37+
echo "Tests completed!"

Docs/IAMReX_documentation/source/DiffusedIBM.rst

Lines changed: 10 additions & 10 deletions
Large diffs are not rendered by default.

Docs/IAMReX_documentation/source/IAMRandIAMReX.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ IAMR (Base)
77
- Standard incompressible Navier-Stokes
88

99
IAMReX (Extended)
10-
----------------
10+
-----------------
1111
- ``NUM_STATE_MAX = AMREX_SPACEDIM+5`` (adds level set field)
1212
- Additional advance methods:
1313
- ``advance_semistaggered_twophase_ls()``: Two-phase flow with level sets
@@ -72,4 +72,4 @@ Understanding the Flow
7272
----------------------
7373
1. Variable setup happens in ``NS_setup.cpp``
7474
2. Time advancement occurs in ``NavierStokes::advance()`` methods
75-
3. Boundary conditions are applied via functions in NS_BC.H
75+
3. Boundary conditions are applied via functions in NS_BC.H

Docs/IAMReX_documentation/source/LevelSet.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _LevelSetMethod:
22

33
Level Set Method
4-
===============
4+
================
55

66
The level set method is a powerful tool for capturing the interface between two immiscible fluids. It is based on the idea of a signed distance function, which is a function that assigns a signed distance to each point in the domain. The level set function is defined as follows:
77

@@ -12,7 +12,7 @@ The level set method is a powerful tool for capturing the interface between two
1212
where :math:`\phi` is the level set function, :math:`\mathbf{x}` is the position vector, and :math:`t` is the time.
1313

1414
Material Properties
15-
------------------
15+
-------------------
1616

1717
The density and viscosity are defined as functions of the level set field:
1818

@@ -36,7 +36,7 @@ where :math:`H(\phi)` is the Heaviside function:
3636
\end{cases}
3737
3838
Time Discretization
39-
------------------
39+
-------------------
4040

4141
For a single level, the momentum equation :eq:`eq:ns` is advanced by a fractional step method with the approximate projection to enforce the incompressibility condition (equation :eq:`eq:div`). The LS advection equation :eq:`eq:phi` is updated using the Godunov scheme.
4242

@@ -56,9 +56,9 @@ At the beginning of each time advancement of level :math:`l`, the velocity :math
5656
.. math::
5757
:label: eq:viscsolve
5858
59-
\begin{aligned}
60-
&\boldsymbol{u^{*,n+1}}-\frac{\Delta t}{2\rho(\phi^{n+1/2})Re}{\nabla} \cdot {\mu(\phi^{n+1})}{\nabla}\boldsymbol{u^{*,n+1}} =
61-
\boldsymbol{u^n}-\Delta t \left[\nabla \cdot (\boldsymbol{uu})\right]^{n+1/2} + \\ &\frac{\Delta t}{\rho(\phi^{n+1/2})}\bigg[-\nabla p^{n-1/2}+
59+
\begin{aligned}
60+
&\boldsymbol{u^{*,n+1}}-\frac{\Delta t}{2\rho(\phi^{n+1/2})Re}{\nabla} \cdot {\mu(\phi^{n+1})}{\nabla}\boldsymbol{u^{*,n+1}} =
61+
\boldsymbol{u^n}-\Delta t \left[\nabla \cdot (\boldsymbol{uu})\right]^{n+1/2} + \\ &\frac{\Delta t}{\rho(\phi^{n+1/2})}\bigg[-\nabla p^{n-1/2}+
6262
\frac{1}{2Re}{\nabla}\cdot{\mu(\phi^{n})}{\nabla}\boldsymbol{u^n} + \rho(\phi^{n+1/2}) \frac{z}{Fr^2} - \frac{1}{We}\kappa(\phi^{n+1/2})\delta(x^{n+1/2})\boldsymbol{n}\bigg].
6363
\end{aligned}
6464
@@ -74,25 +74,25 @@ At the beginning of each time advancement of level :math:`l`, the velocity :math
7474
3. **Apply the projection method** to obtain the pressure and a solenoidal velocity field. To conduct the level projection, a temporary variable :math:`\boldsymbol{V}` is defined as
7575

7676
.. math::
77-
:label: eq:ns_lp1
77+
:label: eq:ns_lp_ls1
7878
7979
\boldsymbol{V} = \frac{\boldsymbol{{u^{*,n+1}}}}{\Delta t} + \frac{1}{\rho(\phi^{n+1/2})} \nabla p^{n-1/2}
8080
8181
Then the updated pressure :math:`p^{n+1/2}` is calculated by
8282

8383
.. math::
84-
:label: eq:ns_lp2
84+
:label: eq:ns_lp_ls2
8585
8686
L^{cc,\mathrm{level}}_{\rho^{n+1/2}} p^{n+1/2} = \nabla \cdot \boldsymbol{V}
8787
8888
where :math:`L^{cc,\mathrm{level}}_{\rho^{n+1/2}}p^{n+1/2}` is a density-weighted approximation to :math:`\nabla \cdot (1/\rho^{n+1/2} \nabla p^{n+1/2})`. Finally, the velocity can be calculated as
8989

9090
.. math::
91-
:label: eq:ns_lp3
91+
:label: eq:ns_lp_ls3
9292
9393
\boldsymbol{{u^{n+1}}} = \Delta t \left(\boldsymbol{V} - \frac{1}{\rho^{n+1/2}} \nabla p^{n+1/2}\right)
9494
95-
As defined in the AMReX framework, :math:`\nabla \cdot` and :math:`\nabla` are the cell-centered level divergence operator :math:`D^{cc,\mathrm{level}}` and level gradient operator :math:`G^{cc,\mathrm{level}}`, respectively. The level gradient operator :math:`G^{cc,\mathrm{level}}` is not the minus transpose of the level divergence operator :math:`D^{cc,\mathrm{level}}`, i.e., :math:`G^{cc,\mathrm{level}} \neq -(D^{cc,\mathrm{level}})^T`. As a result, the idempotency of the approximate projection :math:`\boldsymbol{P} = I - G^{cc,\mathrm{level}}(L^{cc,\mathrm{level}})^{-1}D^{cc,\mathrm{level}}` is not ensured, i.e., :math:`\boldsymbol{P}^{2} \neq \boldsymbol{P}`. Yet, this nonidempotent approximate projection is stable and appears to be well-behaved in various numerical tests and practical applications. Notably, for a uniform single grid with periodic boundary conditions, Lai theoretically proved that this approximate projection method is stable, in that :math:`\|\boldsymbol{P}\| \leq 1`. It should be noted that the approximate projection is applied to the intermediate velocity :math:`\boldsymbol{{u^{*,n+1}}}` (equation :eq:`eq:ns_lp1`). Compared with the form that projects the increment velocity :math:`\boldsymbol{u^{*,n+1}}-\boldsymbol{u^n}`, e.g. as that used in other methods, the projection method used here can reduce the accumulation of pressure errors and lead to a more stable algorithm. The effectiveness and stability of this approximate projection has been validated through various numerical tests.
95+
As defined in the AMReX framework, :math:`\nabla \cdot` and :math:`\nabla` are the cell-centered level divergence operator :math:`D^{cc,\mathrm{level}}` and level gradient operator :math:`G^{cc,\mathrm{level}}`, respectively. The level gradient operator :math:`G^{cc,\mathrm{level}}` is not the minus transpose of the level divergence operator :math:`D^{cc,\mathrm{level}}`, i.e., :math:`G^{cc,\mathrm{level}} \neq -(D^{cc,\mathrm{level}})^T`. As a result, the idempotency of the approximate projection :math:`\boldsymbol{P} = I - G^{cc,\mathrm{level}}(L^{cc,\mathrm{level}})^{-1}D^{cc,\mathrm{level}}` is not ensured, i.e., :math:`\boldsymbol{P}^{2} \neq \boldsymbol{P}`. Yet, this nonidempotent approximate projection is stable and appears to be well-behaved in various numerical tests and practical applications. Notably, for a uniform single grid with periodic boundary conditions, Lai theoretically proved that this approximate projection method is stable, in that :math:`\|\boldsymbol{P}\| \leq 1`. It should be noted that the approximate projection is applied to the intermediate velocity :math:`\boldsymbol{{u^{*,n+1}}}` (equation :eq:`eq:ns_lp_ls1`). Compared with the form that projects the increment velocity :math:`\boldsymbol{u^{*,n+1}}-\boldsymbol{u^n}`, e.g. as that used in other methods, the projection method used here can reduce the accumulation of pressure errors and lead to a more stable algorithm. The effectiveness and stability of this approximate projection has been validated through various numerical tests.
9696
9797
4. **Reinitialize the LS function** :math:`\phi` to maintain :math:`\phi` as a signed distance function of the interface and guarantee the conservation of the mass of the two phases. In this step, a temporary LS function :math:`d(\boldsymbol{x},\tau)` is updated iteratively using the following pseudo evolution equation:
9898

@@ -121,6 +121,6 @@ At last, we give a summary of the single-level advancement algorithm as follows.
121121

122122
1. Advance the LS function using equation :eq:`eq:s0phin1`
123123
2. Solve the intermediate velocity using equation :eq:`eq:viscsolve`
124-
3. Apply the projection method to update the pressure and velocity field following equations :eq:`eq:ns_lp1`--:eq:`eq:ns_lp3`
124+
3. Apply the projection method to update the pressure and velocity field following equations :eq:`eq:ns_lp_ls1`--:eq:`eq:ns_lp_ls3`
125125
4. Re-initialize the LS function on the single level using equations :eq:`eq:ns_reinit1`--:eq:`eq:ns_reinit3`
126126

Docs/IAMReX_documentation/source/Results.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ where :math:`H` is the Heaviside function, defined by:
2929

3030
.. math::
3131
32-
H(\phi) =
32+
H(\phi) =
3333
\begin{cases}
3434
0, & \phi \le 0\\
3535
1, & \phi > 0
@@ -101,7 +101,7 @@ for any Eulerian cell :math:`(i,j,k)`. The computational domain is :math:`L_x \t
101101
| 128 | 0.40209828964 | 6.359·10⁻³ | 2.0678 |
102102
+-------+----------------+---------------------+-------------+
103103

104-
The numerical errors decrease with the increase of the :math:`d/h`, where :math:`h` is the Cartesian grid spacing on level :math:`0`. If the resolution on the finest level keeps unchanged, we validated that the results of a three-level grid are the same as those of the corresponding single-level grid. In addition, our results show the second-order convergence and agree well with the results in kempe. It also matches the overall second-order accuracy of the basic fluid solver.
104+
The numerical errors decrease with the increase of the :math:`d/h`, where :math:`h` is the Cartesian grid spacing on level :math:`0`. If the resolution on the finest level keeps unchanged, we validated that the results of a three-level grid are the same as those of the corresponding single-level grid. In addition, our results show the second-order convergence and agree well with the results in Kempe :cite:`kempe2012improved`. It also matches the overall second-order accuracy of the basic fluid solver.
105105

106106
Lastly, it is noted that this method is also applicable when multiple particles are close to each other or their surfaces are in direct contact. Because the PVF calculation is a separate operation for each particle, the total volume fraction is not needed as long as the Eulerian force considers the effects of all particles .
107107

@@ -114,7 +114,7 @@ Flow Past Sphere
114114

115115
The schematic of the flow passing through the spherical particles
116116

117-
We validate the accuracy and efficacy of our adaptive solver by simulating a spherical particle in uniform flow with different particle Reynolds numbers. The diameter of the particle is :math:`D_p = 1`, the computational domain is :math:`L_x \times L_y \times L_z = 20D_p \times 10D_p \times 10D_p`, the distance of the particle from the inlet is :math:`d = 5D_p` and located in the center of the yz plane. The inlet and outlet boundaries are applied in the x direction and the inlet velocity :math:`U` is :math:`1m/s`. Both y and z directions are periodic boundaries.
117+
We validate the accuracy and efficacy of our adaptive solver by simulating a spherical particle in uniform flow with different particle Reynolds numbers :cite:`schiller1933uber,zhu2022particle`. The diameter of the particle is :math:`D_p = 1`, the computational domain is :math:`L_x \times L_y \times L_z = 20D_p \times 10D_p \times 10D_p`, the distance of the particle from the inlet is :math:`d = 5D_p` and located in the center of the yz plane. The inlet and outlet boundaries are applied in the x direction and the inlet velocity :math:`U` is :math:`1m/s`. Both y and z directions are periodic boundaries.
118118

119119
The influence of AMR on the simulation results is investigated by using the subcycling method with different levels. As shown in Fig.
120120

@@ -134,7 +134,7 @@ The theoretical S-N law for calculating the drag coefficient of the shaped parti
134134
.. math::
135135
C_D = (24/Re_p)(1+0.15Re_p^{0.687}),
136136
137-
which is proposed by schiller et al., and :math:`Re_p = UD_p/\nu` represents the particle Reynolds number. It can be seen from above Fig that the present results under different particle Reynolds numbers are in good agreement with S-N law. The fact that different levels of grid produce the nearly identical results validated the accuracy of our solver on the adaptive grid.
137+
which is proposed by Schiller :cite:`schiller1933uber`., and :math:`Re_p = UD_p/\nu` represents the particle Reynolds number. It can be seen from above Fig that the present results under different particle Reynolds numbers are in good agreement with S-N law. The fact that different levels of grid produce the nearly identical results validated the accuracy of our solver on the adaptive grid.
138138

139139

140140
Cluster of monodisperse particles
@@ -148,7 +148,7 @@ We demonstrate the accuracy and efficacy of our codes for simulating clusters of
148148

149149
Monodisperse particles on a three-level AMR grid
150150

151-
80 particles of diameter :math:`D = 1` are randomly distributed in a channel of size :math:`L_x\times L_y \times L_z = 10\times 20 \times 10`. To choose an optimal interaction number :math:`N_s` in this complex configuration, the maximum error of the no-slip boundary condition among 80 particles is tested with a unit flow field :math:`u=(1,0,0)`.the maximum error of no-slip condition decreases as :math:`N_s` increases and it is strongly reduced for :math:`N_s=2`. According to the selection suggestions provided by Breugem et al., :math:`N_s=2` is the optimal value for balancing the accuracy of the no-slip boundary and the computational efficiency. After determining :math:`N_s`, the fluid flow is driven by applying a pressure gradient of 1.0 in the z direction. This case can represent a porous medium with a volume fraction of 0.02. Three levels of the AMR grid is applied. The grid resolution on the finest level is :math:`d/h=16`. Since the multi-direct forcing immersed boundary method and fictitious domain method require cube grid cells, the grid cell requirement is equals to case 1 in Table.
151+
80 particles of diameter :math:`D = 1` are randomly distributed in a channel of size :math:`L_x\times L_y \times L_z = 10\times 20 \times 10`. To choose an optimal interaction number :math:`N_s` in this complex configuration, the maximum error of the no-slip boundary condition among 80 particles is tested with a unit flow field :math:`u=(1,0,0)`.the maximum error of no-slip condition decreases as :math:`N_s` increases and it is strongly reduced for :math:`N_s=2`. According to the selection suggestions provided by Breugem :cite:`breugem2012second`. :math:`N_s=2` is the optimal value for balancing the accuracy of the no-slip boundary and the computational efficiency. After determining :math:`N_s`, the fluid flow is driven by applying a pressure gradient of 1.0 in the z direction. This case can represent a porous medium with a volume fraction of 0.02. Three levels of the AMR grid is applied. The grid resolution on the finest level is :math:`d/h=16`. Since the multi-direct forcing immersed boundary method :cite:`kidanemariam2022open,yousefi2023role` and fictitious domain method :cite:`xia2020effects,fan2023three` require cube grid cells, the grid cell requirement is equals to case 1 in Table.
152152

153153
+------+---------+---------+---------+-------------+
154154
| case | level 0 | level 1 | level 2 | Total cells |
@@ -158,14 +158,14 @@ We demonstrate the accuracy and efficacy of our codes for simulating clusters of
158158
| 2 | 128000 | 534656 | 1593664 | 2256320 |
159159
+------+---------+---------+---------+-------------+
160160

161-
Compared with them, our algorithm has a 72.5% grid reduction with :math:`d/h=16`. And it has a 62.5% Lagrangian markers reduction compared with the DLM method with :math:`d/h=16`.
161+
Compared with them, our algorithm has a 72.5% grid reduction with :math:`d/h=16`. And it has a 62.5% Lagrangian markers reduction compared with the DLM method :cite:`sharma2022coupled,zeng2022subcycling` with :math:`d/h=16`.
162162

163163
When the simulation reaches the steady state, the total pressure drop balances the IB force generated by all particles in the streamwise z direction. Following the equation in akiki et al., the theoretical drag force is given by
164164

165165
.. math::
166166
F_{theory} = (\frac{\Delta p}{\Delta z}L_z)L_xL_y
167167
168-
Fig. shows the time series of total IB force for all particles. The resistance gradually reaches a steady state after 40000 steps. In this case, the theoretical value of drag force given by :math:`F_{theory}` is 2000, while the present average values at steady state with :math:`N_s=2` and 4 are all converged around 2000. It indicates that :math:`N_s=2` is sufficient for this case. And the agreement between theory and present results validates the accuracy of our proposed framework in dealing with large amounts of particles in the fluid system.
168+
Fig. shows the time series of total IB force for all particles. The resistance gradually reaches a steady state after 40000 steps. In this case, the theoretical value of drag force given by :math:`F_{theory}` is 2000, while the present average values at steady state with :math:`N_s=2` and 4 are all converged around 2000. It indicates that :math:`N_s=2` is sufficient for this case. And the agreement between theory and present results validates the accuracy of our proposed framework in dealing with large amounts of particles in the fluid system.
169169

170170
.. figure:: ./Results/MonodispersPDrop.png
171171
:align: center

Docs/IAMReX_documentation/source/Software_Chapter.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Key Computational Functions
4949
- ``NavierStokesBase::rk_second_reinit()``: Second RK step during reinitialization
5050
- ``NavierStokesBase::mass_fix()``: Mass fix subroutine during reinitialization
5151

52-
Features
53-
^^^^^^^^
52+
Features(**Level Set**)
53+
^^^^^^^^^^^^^^^^^^^^^^^
5454
- **Sharp Interface**: Maintains interface thickness of 1.5~2 grid cells
5555
- **Mass Conservation**: Conservative advection schemes
5656
- **Reinitialization**: Periodic distance function correction
@@ -82,8 +82,8 @@ Particle Data Structure (**Kernel**)
8282
Vector<Real> phiK, thetaK; // Spherical marker distribution
8383
}
8484
85-
Key Computational functions
86-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
85+
Key Computational functions(**IBM**)
86+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787

8888
1. Fluid-Solid Coupling
8989
~~~~~~~~~~~~~~~~~~~~~~~
@@ -109,14 +109,14 @@ Key Computational functions
109109
4. Particle Dynamics
110110
~~~~~~~~~~~~~~~~~~~~
111111
- ``mParticle::UpdateParticles()``: 6-DOF motion integration
112-
- **Constraint Handling**:
112+
- **Constraint Handling**:
113113
- Translation locks (``TL[i]``): 0=fixed, 1=prescribed, 2=free
114114
- Rotation locks (``RL[i]``): Similar constraint system
115115
- **Collision Integration**: Seamless coupling with collision forces
116116
- ``nodal_phi_to_pvf()``: Particle volume fraction calculation
117117

118-
Features
119-
^^^^^^^^
118+
Features(**IBM**)
119+
^^^^^^^^^^^^^^^^^
120120

121121
Marker Distribution
122122
~~~~~~~~~~~~~~~~~~~
@@ -135,10 +135,10 @@ Core Architecture of Particle Collision
135135

136136
Primary Classes (**Collision**)
137137
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138-
- **``ParticleCollision``**: Main collision management
139-
- **``CollisionParticle``**: Particle representation for collisions
140-
- **``CollisionPair``**: Collision pair structure
141-
- **``CollisionCell``**: Spatial hashing cell
138+
- ``ParticleCollision``: Main collision management
139+
- ``CollisionParticle``: Particle representation for collisions
140+
- ``CollisionPair``: Collision pair structure
141+
- ``CollisionCell``: Spatial hashing cell
142142

143143
Collision Detection Algorithm
144144
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -196,4 +196,4 @@ V. Summary
196196

197197
IAMeX represents a substantial advancement in computational multi-physics, transforming the single-phase IAMR code into a comprehensive platform for complex fluid-solid interaction simulations. The integration of diffused immersed boundary methods, particle collision dynamics, and multiple interface tracking approaches provides researchers with unprecedented capabilities for studying real-world multi-physics phenomena while maintaining computational efficiency and scalability.
198198

199-
The modular design and robust implementation ensure that IAMeX serves as both a production simulation tool and a research platform for developing next-generation multi-physics algorithms. Its contributions to the computational fluid dynamics community extend beyond mere feature additions, representing fundamental advances in the numerical treatment of complex interfacial and particulate flows.
199+
The modular design and robust implementation ensure that IAMeX serves as both a production simulation tool and a research platform for developing next-generation multi-physics algorithms. Its contributions to the computational fluid dynamics community extend beyond mere feature additions, representing fundamental advances in the numerical treatment of complex interfacial and particulate flows.

0 commit comments

Comments
 (0)