Skip to content

Commit 17c98ad

Browse files
authored
New functionality: Power-law liquids
Merge pull request #29 from fabiandenner/main
2 parents 4d449c1 + 919d9f5 commit 17c98ad

12 files changed

Lines changed: 195 additions & 13 deletions

File tree

.github/workflows/test_run.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ jobs:
108108
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/zener.apecss -tend 5e-6 -freq 1e6 -amp 1e6
109109
- name: Run ultrasound (Oldroyd-B)
110110
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/oldroydb.apecss -tend 3e-6 -freq 3e6 -amp 400e3
111+
- name: Run ultrasound (power-law)
112+
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/powerlaw.apecss -freq 636619 -amp 25331 -tend 25e-6
111113

112114
linux:
113115
runs-on: ubuntu-latest
@@ -206,3 +208,5 @@ jobs:
206208
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/zener.apecss -tend 5e-6 -freq 1e6 -amp 1e6
207209
- name: Run ultrasound (Oldroyd-B)
208210
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/oldroydb.apecss -tend 3e-6 -freq 3e6 -amp 400e3
211+
- name: Run ultrasound (power-law)
212+
run: ${{github.workspace}}/examples/ultrasound/build/ultrasound_apecss -options ${{github.workspace}}/examples/ultrasound/powerlaw.apecss -freq 636619 -amp 25331 -tend 25e-6

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"stdio.h": "c",
1111
"*.tcc": "c",
1212
"random": "c",
13-
"ratio": "c"
14-
}
13+
"ratio": "c",
14+
"apecss.h": "c"
15+
},
16+
"cmake.sourceDirectory": "${workspaceFolder}/lib"
1517
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Key features of APECSS are:
2323
- Acoustic interactions of multiple bubbles under different assumptions (incompressible, quasi-acoustic).
2424
- Interbubble interactions through their acoustic emissions
2525
- Prediction of the formation and attenuation of shock fronts emitted by the bubble.
26-
- Viscoelastic media (Kelvin-Voigt, Zener, Oldroyd-B).
26+
- Non-Newtonian (power-law) and viscoelastic (Kelvin-Voigt, Zener, Oldroyd-B) media.
2727
- Lipid monolayer coating of the bubble as used for ultrasound contrast agents.
2828
- APECSS has, aside from the C standard library, no external dependencies.
2929

@@ -91,7 +91,7 @@ If you use APECSS for your scientific work, please consider citing the [paper](h
9191

9292
F. Denner and S. Schenke, APECSS: A software library for cavitation bubble dynamics and acoustic emissions. Journal of Open Source Software 8 (2023), 5435. https://doi.org/10.21105/joss.05435
9393

94-
and, in the interest of reproducibility, the version of APECSS you've used for your work, e.g.
94+
and, in the interest of reproducibility, the version of APECSS you've used for your work, for instance
9595

9696
F. Denner, S. Schenke and P. Coulombel, APECSS (v1.7), Zenodo (2024). https://doi.org/10.5281/zenodo.13850831
9797

-1.99 KB
Binary file not shown.

documentation/chapters/bubble.tex

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,21 @@ \section{The gas}
145145
\section{The liquid}
146146
\label{sec:liquid}
147147

148-
In the same way that every bubble contains a gas, in APECSS every bubble is surrounded by a liquid, which requires to select an appropriate equation of state and fluid type, as well as define meaningful properties.
148+
In the same way that every bubble contains a gas, in APECSS every bubble is surrounded by a liquid, which requires to select an appropriate equation of state and liquid type, as well as define meaningful properties.
149149

150150
\vspace{0.8em}
151151

152152
\noindent
153-
\begin{tabular}{p{0.1\textwidth} p{0.35\textwidth} p{0.5\textwidth}}
153+
\begin{tabular}{p{0.08\textwidth} p{0.385\textwidth} p{0.485\textwidth}}
154154
\textbf{Section} &\textbf{Command} & \textbf{Description}
155155
\vspace{1mm} \\ \hline
156156
{\tt LIQUID} & {\tt EoS Tait} & The Tait EoS is applied to the liquid. Only relevant for the Gilmore model and acoustic emissions based on the Kirkwood-Bethe hypothesis.\\
157157
& {\tt EoS NASG} & The Noble-Abel-stiffened-gas EoS is applied to the liquid. Only relevant for the Gilmore model and acoustic emissions based on the Kirkwood-Bethe hypothesis.\\
158-
& {\tt LiquidType Newtonian} & Newtonian fluid. This is the default.\\
158+
& {\tt LiquidType Newtonian} & Newtonian liquid. This is the default.\\
159159
& {\tt LiquidType KelvinVoigt} & Kelvin-Voigt solid.\\
160160
& {\tt LiquidType Zener} & Zener solid.\\
161-
& {\tt LiquidType OldroydB} & Oldroyd-B (or upper-convected Maxwell) fluid.\\
161+
& {\tt LiquidType OldroydB} & Oldroyd-B (or upper-convected Maxwell) liquid.\\
162+
& {\tt LiquidType PowerLaw} & Power-law liquid.\\
162163
& {\tt PolytropicExponent <float>} & Polytropic exponent $\Gamma_{\ell}$.\\
163164
& {\tt ReferencePressure <float>} & Reference pressure $p_{\ell,\text{ref}}$.\\
164165
& {\tt ReferenceDensity <float>} & Reference density $\rho_{\ell,\text{ref}}$.\\
@@ -169,6 +170,8 @@ \section{The liquid}
169170
& {\tt PolymerViscosity <float>} & Polymer viscosity $\eta_\ell$ associated with viscoelasticity.\\
170171
& {\tt ShearModulus <float>} & Shear modulus $G_\ell$ associated with viscoelasticity.\\
171172
& {\tt RelaxationTime <float>} & Relaxation time $\lambda_\ell$ associated with viscoelasticity.\\
173+
& {\tt PowerLawExponent <float>} & Exponent $n$ of a power-law liquid.\\
174+
& {\tt PowerLawConsistencyCoeff <float>} & Consistency coefficient $k$ of a power-law liquid.\\
172175
\hline
173176
\end{tabular} \vspace{1em}
174177

@@ -178,10 +181,21 @@ \section{The liquid}
178181
\end{equation}
179182
where $p_\text{G}$ is the gas pressure, see Section \ref{sec:gas}, $\sigma$ is the surface tension coefficient of the interface, see Section \ref{sec:interface}, and $\mu_\ell$ is the liquid (Newtonian) viscosity. The derivative of Eq.~\eqref{eq:pL} follows as
180183
\begin{equation}
181-
\dot{p}_\mathrm{L} = \dot{p}_\mathrm{G} + \frac{2 \, \sigma \, \dot{R}}{R^2} + 4 \, \mu_\ell \left(\frac{\dot{R}^2}{R^2} - \frac{\ddot{R}}{R}\right).
184+
\dot{p}_\mathrm{L} = \dot{p}_\mathrm{G} + \frac{2 \sigma \dot{R}}{R^2} + 4 \, \mu_\ell \left(\frac{\dot{R}^2}{R^2} - \frac{\ddot{R}}{R}\right).
182185
\label{eq:dotpL}
183186
\end{equation}
184187

188+
The pressure of a power-law liquid at the wall of a spherical bubble is given as \citep{Kaykanat2024}
189+
\begin{equation}
190+
p_\text{L} = p_\text{G} - \frac{2 \sigma}{R} - \frac{4 \, k^\star}{n} \, |\dot{R}|^{n-1} \frac{\dot{R}}{R^n}, \label{eq:pL_powerlaw}
191+
\end{equation}
192+
where $p_\text{G}$ is the gas pressure, see Section \ref{sec:gas}, $\sigma$ is the surface tension coefficient of the interface, see Section \ref{sec:interface}, $k^\star = k(2\sqrt{3})^{n-1}$ is an extended consistency coefficient \citep{Kaykanat2024}, and $n$ is the power-law exponent. The derivative of Eq.~\eqref{eq:pL_powerlaw} follows as
193+
\begin{equation}
194+
\dot{p}_\mathrm{L} = \dot{p}_\mathrm{G} + \frac{2 \sigma \dot{R}}{R^2} + 4 \, k^\star \, |\dot{R}|^{n-3} \dot{R}^2 \, \left(\frac{\dot{R}^2}{R^2} - \frac{\ddot{R}}{R}\right).
195+
\label{eq:dotpL_powerlaw}
196+
\end{equation}
197+
The power-law liquid, described by Eqs.~\eqref{eq:pL_powerlaw} and \eqref{eq:dotpL_powerlaw}, reduces to a Newtonian liquid, described by Eqs.~\eqref{eq:pL} and \eqref{eq:dotpL}, for $n=1$ and $k = \mu_\ell$.
198+
185199
\subsection{Equation of state}
186200

187201
For the Gilmore model \eqref{eq:gilmore} and the acoustic emissions based on the Kirkwood-Bethe hypothesis (see Section \ref{sec:emissionskb}), an equation of state (EoS) for the liquid has to be defined. Two EoS are currently available in APECSS: the Tait EoS and the NASG EoS.
@@ -285,7 +299,7 @@ \subsubsection{Zener model}
285299

286300
\subsubsection{Oldroyd-B model}
287301

288-
The Oldroyd-B model is a widely used constitutive model for viscoelastic fluids.
302+
The Oldroyd-B model is a widely used constitutive model for viscoelastic liquids.
289303
Following the work of \citet{Jimenez-Fernandez2005}, the liquid pressure at the bubble wall including the Oldroyd-B model is given as
290304
\begin{equation}
291305
p_\text{L} = p_\text{G} - \frac{2 \sigma}{R} - 4 \mu_\ell \frac{\dot{R}}{R} + \mathcal{S} \label{eq:pL_OldroydB}.
@@ -301,7 +315,7 @@ \subsubsection{Oldroyd-B model}
301315
\mathcal{S}_{1,n+1} &= \mathcal{S}_{1,n} + \Updelta t \frac{-\left(4 \lambda_\ell \dfrac{\dot{R}}{R}+1\right) \mathcal{S}_{1,n}- 2 \eta_\ell \dfrac{\dot{R}}{R}}{\lambda_\ell+\Updelta t} \label{eq:ode_oldroydB1disc} \\
302316
\mathcal{S}_{2,n+1} &= \mathcal{S}_{2,n} + \Updelta t \frac{-\left(\lambda_\ell \dfrac{\dot{R}}{R}+1\right) \mathcal{S}_{2,n}- 2 \eta_\ell \dfrac{\dot{R}}{R}}{\lambda_\ell+\Updelta t}.\label{eq:ode_oldroydB2disc}
303317
\end{align}
304-
For $\lambda_\ell = 0$ Eqs.~\eqref{eq:ode_oldroydB1disc} and \eqref{eq:ode_oldroydB2disc} still give a meaningful result and reduce to a Newtonian fluid with $\mathcal{S} = - 4 \eta_\ell \dot{R}/R$.
318+
For $\lambda_\ell = 0$ Eqs.~\eqref{eq:ode_oldroydB1disc} and \eqref{eq:ode_oldroydB2disc} still give a meaningful result and reduce to a Newtonian liquid with $\mathcal{S} = - 4 \eta_\ell \dot{R}/R$.
305319

306320
\section{The interface}
307321
\label{sec:interface}

documentation/references.bib

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,20 @@ @article{Jimenez-Fernandez2005
161161
doi = {10.1016/j.ultras.2005.03.010}
162162
}
163163

164+
@article{Kaykanat2024,
165+
title = {Shape Stability of a Microbubble in a Power--Law Liquid},
166+
author = {Kaykanat, S. Ilke and Uguz, Kerem},
167+
year = {2024},
168+
month = sep,
169+
journal = {The European Physical Journal Special Topics},
170+
volume = {233},
171+
number = {8-9},
172+
pages = {1625--1635},
173+
issn = {1951-6355, 1951-6401},
174+
doi = {10.1140/epjs/s11734-024-01174-7},
175+
urldate = {2025-07-01}
176+
}
177+
164178
@article{Keller1980,
165179
title = {Bubble Oscillations of Large Amplitude},
166180
author = {Keller, Joseph B. and Miksis, Michael},

examples/run_all.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,7 @@ rm Gilmore_R1.000e-06_fa1.000e+06_pa1.000e+06.txt
6565
./build/ultrasound_apecss -options oldroydb.apecss -tend 3e-6 -freq 3e6 -amp 400e3
6666
python3 plot_result_oldroydb.py
6767
rm RP_R1.000e-06_fa3.000e+06_pa4.000e+05.txt
68+
./build/ultrasound_apecss -options powerlaw.apecss -freq 636619 -amp 25331 -tend 25e-6
69+
python3 plot_result_powerlaw.py
70+
rm RP_R5.000e-06_fa6.366e+05_pa2.533e+04.txt
6871
cd ../

examples/ultrasound/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ This example simulated a lipid-coated microbubble using the Gilmore model and re
99
#### Sonoluminescence (with emissions)
1010
Using [sonolumin_emissions.apess](sonolum_emissions.apecss) with ````./build/ultrasound_apecss -options sonolum_emissions.apecss -tend 40e-6 -freq 23.5e3 -amp 145e3````, this example reproduces the argon bubble studied by [Holzfuss, _Proc. R. Soc. A: Math. Phys. Eng. Sci._ 466 (2010), 1829](https://doi.org/10.1098/rspa.2009.0594) in the context of sonoluminesence. The acoustic emissions at _pLmax_ may be compared to Figure 5 of Holzfuss' work.
1111

12+
#### Power-law liquid
13+
Using [powerlaw.apess](powerlaw.apecss) with ````./build/ultrasound_apecss -options powerlaw.apecss -freq 636619 -amp 25331 -tend 25e-6````, this example reproduces Figure 2c of [Kaykanat & Uguz, _The European Physical Journal Special Topics_ 233 (2024), 1625](https://doi.org/10.1140/epjs/s11734-024-01174-7).
14+
1215
#### Kelvin-Voigt
1316
Using [kelvinvoigt.apess](kelvinvoigt.apecss) with ````./build/ultrasound_apecss -options kelvinvoigt.apecss -tend 6e-6 -freq 1e6 -amp 3e6````, this example reproduces Figure 5b of [Yang & Church, _Journal of the Acoustical Society of America_ 118 (2005), 3595](https://doi.org/10.1121/1.2118307).
1417

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
4+
plt.rcParams['font.family']='serif'
5+
plt.rcParams['font.serif']=['Times New Roman'] + plt.rcParams['font.serif']
6+
plt.rcParams['mathtext.fontset']='stix'
7+
plt.rcParams['font.size']=10
8+
9+
cm = 1/2.54
10+
11+
Bubble = np.genfromtxt("RP_R5.000e-06_fa6.366e+05_pa2.533e+04.txt", delimiter=" ")
12+
13+
fig1 = plt.figure(figsize=(17*cm,5*cm))
14+
ax1 = plt.subplot2grid((1,3),(0,0),colspan=1)
15+
ax2 = plt.subplot2grid((1,3),(0,1),colspan=1)
16+
ax3 = plt.subplot2grid((1,3),(0,2),colspan=1)
17+
plt.subplots_adjust(wspace=1.2*cm,hspace=1.2*cm)
18+
19+
ax1.set(xlabel=r'$t\, f$',ylabel=r'$R(t)/R_0$')
20+
ax1.set_xlim(xmin=0,xmax=15)
21+
ax1.grid(color='gainsboro', linestyle='-', linewidth=0.5)
22+
ax1.plot(Bubble[:, 1]/1.570796e-6, Bubble[:, 3]/5e-6, linestyle='solid', linewidth=1,color='steelblue')
23+
24+
ax2.set(xlabel=r'$t\, f$',ylabel=r'$\dot{R}(t)$[m/s]')
25+
ax2.set_xlim(xmin=0,xmax=15)
26+
ax2.grid(color='gainsboro', linestyle='-', linewidth=0.5)
27+
ax2.plot(Bubble[:, 1]/1.570796e-6, Bubble[:, 4], linestyle='solid', linewidth=1,color='steelblue')
28+
29+
ax3.set_yscale('log')
30+
ax3.set(xlabel=r'$t\, f$',ylabel=r'$p_\mathrm{G}(t)$ [Pa]')
31+
ax3.set_xlim(xmin=0,xmax=15)
32+
ax3.grid(color='gainsboro', linestyle='-', linewidth=0.5)
33+
ax3.plot(Bubble[:, 1]/1.570796e-6, Bubble[:, 5]/1e3, linestyle='solid', linewidth=1.0,color='steelblue')
34+
35+
ax1.xaxis.set_label_coords(0.5,-0.24)
36+
ax2.xaxis.set_label_coords(0.5,-0.24)
37+
ax3.xaxis.set_label_coords(0.5,-0.24)
38+
39+
ax1.yaxis.set_label_coords(-0.28, 0.5)
40+
ax2.yaxis.set_label_coords(-0.25, 0.5)
41+
ax3.yaxis.set_label_coords(-0.25, 0.5)
42+
43+
fig1.savefig('ultrasound_powerlaw.pdf', bbox_inches='tight',pad_inches=0.035)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#########################################################
2+
# #
3+
# APECSS Options File #
4+
# #
5+
#########################################################
6+
7+
BUBBLE
8+
InitialRadius 5.0e-6
9+
RPModel RP
10+
PressureAmbient 1.01325e5
11+
END
12+
13+
GAS
14+
EoS IG
15+
ReferencePressure 1.0e5
16+
ReferenceDensity 1.2
17+
PolytropicExponent 1.4
18+
END
19+
20+
LIQUID
21+
LiquidType PowerLaw
22+
ReferencePressure 1.0e5
23+
ReferenceDensity 1000.0
24+
PowerLawExponent 0.75
25+
PowerLawConsistencyCoeff 0.002
26+
END
27+
28+
INTERFACE
29+
SurfaceTensionCoeff 0.0729
30+
END
31+
32+
RESULTS
33+
Bubble
34+
END

0 commit comments

Comments
 (0)