Skip to content

Commit 3b4c60a

Browse files
oguevremontblaisbhepap
authored
Periodic boundary conditions for auxiliary physics (#1456)
Description The Cahn-Hilliard physics solver did not allow periodic boundary conditions yet, as well as heat transfer and tracer physics. Solution Using an approach similar to the VOF physics solver, Cahn-Hilliard, heat transfer and tracer physics now allow periodic boundary conditions. The periodic boundary conditions parameters for all auxiliary physics (including VOF) are now explicit; the syntax is the same as for the fluids dynamics solver. Testing A new test has been added and all past tests still pass. lethe-fluid/cahn_hilliard_periodic_boundaries lethe-fluid/heat_transfer_periodic_boundaries lethe-fluid/tracer_periodic_boundaries Documentation The documentation has been adjusted to mention how to use periodic boundary conditions with auxiliary physics solvers. Co-authored-by: Bruno Blais <blais.bruno@gmail.com> Co-authored-by: hepap <47506601+hepap@users.noreply.github.com>
1 parent b00325f commit 3b4c60a

22 files changed

+1843
-96
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to the Lethe project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/).
55

6+
## [Master] - 2025-03-20
7+
8+
### Added
9+
10+
- MINOR Addition of the periodic boundary conditions for the Cahn-Hilliard, heat transfer and tracer physics solvers. Parameters for periodic boundary conditions for all auxiliary physics (including VOF) now follow the same syntax as for the fluid dynamics solvers. [#1456](https://github.com/chaos-polymtl/lethe/pull/1456)
11+
612
## [Master] - 2025-03-19
713

814
### Added
@@ -20,12 +26,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
2026
### Added
2127

2228
- MINOR This PR adds the (almost) empty architecture of the SignedDistanceSolver and its coupling in the VOF solver (geometric reinitialization method), following the structure of the already existing vof_advection prototype. The parameters associated to the geometric reinitialization method for the VOF solver are also added. [#1451](https://github.com/chaos-polymtl/lethe/pull/1451)
23-
-
29+
2430
## [Master] - 2025-03-11
2531

2632
### Added
2733

2834
- MINOR Remove muParser and custom parsed function class (reversal of [#1143](https://github.com/chaos-polymtl/lethe/pull/1143), [#1153](https://github.com/chaos-polymtl/lethe/pull/1153), [#1160](https://github.com/chaos-polymtl/lethe/pull/1160)). [#1452](https://github.com/chaos-polymtl/lethe/pull/1452)
35+
2936
## [Master] - 2025-03-06
3037

3138
### Added
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
Running on 1 MPI rank(s)...
2+
Number of active cells: 64
3+
Number of degrees of freedom: 243
4+
Volume of triangulation: 4
5+
Number of Cahn-Hilliard degrees of freedom: 162
6+
7+
-------------------------
8+
Cahn-Hilliard Barycenter
9+
-------------------------
10+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
11+
0.000000e+00 9.141646e-18 -7.214176e-18 1.710754e-18 0.000000e+00
12+
Number of active cells: 160
13+
Number of degrees of freedom: 567
14+
Volume of triangulation: 4
15+
Number of Cahn-Hilliard degrees of freedom: 378
16+
17+
-------------------------
18+
Cahn-Hilliard Barycenter
19+
-------------------------
20+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
21+
0.000000e+00 7.841238e-18 -5.939492e-19 1.368603e-18 0.000000e+00
22+
Number of active cells: 388
23+
Number of degrees of freedom: 1335
24+
Volume of triangulation: 4
25+
Number of Cahn-Hilliard degrees of freedom: 890
26+
27+
-------------------------
28+
Cahn-Hilliard Barycenter
29+
-------------------------
30+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
31+
0.000000e+00 2.798299e-18 5.857601e-19 1.276418e-18 0.000000e+00
32+
33+
*******************************************************************************
34+
Transient iteration: 1 Time: 0.1 Time step: 0.1 CFL: 0.275885
35+
*******************************************************************************
36+
37+
-------------------------
38+
Cahn-Hilliard Barycenter
39+
-------------------------
40+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
41+
1.000000e-01 2.798299e-18 5.857601e-19 9.295018e-01 1.773974e-06
42+
43+
*******************************************************************************
44+
Transient iteration: 2 Time: 0.2 Time step: 0.1 CFL: 1.43992
45+
*******************************************************************************
46+
Number of active cells: 340
47+
Number of degrees of freedom: 1203
48+
Volume of triangulation: 4
49+
Number of Cahn-Hilliard degrees of freedom: 802
50+
51+
-------------------------
52+
Cahn-Hilliard Barycenter
53+
-------------------------
54+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
55+
2.000000e-01 9.214761e-02 1.490279e-07 9.313494e-01 -1.251653e-06
56+
57+
*******************************************************************************
58+
Transient iteration: 3 Time: 0.3 Time step: 0.1 CFL: 1.43972
59+
*******************************************************************************
60+
Number of active cells: 529
61+
Number of degrees of freedom: 1761
62+
Volume of triangulation: 4
63+
Number of Cahn-Hilliard degrees of freedom: 1174
64+
65+
-------------------------
66+
Cahn-Hilliard Barycenter
67+
-------------------------
68+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
69+
3.000000e-01 1.817110e-01 4.932793e-09 9.432320e-01 -2.555544e-06
70+
71+
*******************************************************************************
72+
Transient iteration: 4 Time: 0.4 Time step: 0.1 CFL: 1.45306
73+
*******************************************************************************
74+
Number of active cells: 649
75+
Number of degrees of freedom: 2121
76+
Volume of triangulation: 4
77+
Number of Cahn-Hilliard degrees of freedom: 1414
78+
79+
-------------------------
80+
Cahn-Hilliard Barycenter
81+
-------------------------
82+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
83+
4.000000e-01 2.617497e-01 1.002454e-06 9.462906e-01 2.705503e-06
84+
85+
*******************************************************************************
86+
Transient iteration: 5 Time: 0.5 Time step: 0.1 CFL: 1.45465
87+
*******************************************************************************
88+
Number of active cells: 682
89+
Number of degrees of freedom: 2217
90+
Volume of triangulation: 4
91+
Number of Cahn-Hilliard degrees of freedom: 1478
92+
93+
-------------------------
94+
Cahn-Hilliard Barycenter
95+
-------------------------
96+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
97+
5.000000e-01 3.213142e-01 1.442577e-06 9.482278e-01 1.173208e-06
98+
99+
*******************************************************************************
100+
Transient iteration: 6 Time: 0.6 Time step: 0.1 CFL: 1.45566
101+
*******************************************************************************
102+
Number of active cells: 718
103+
Number of degrees of freedom: 2337
104+
Volume of triangulation: 4
105+
Number of Cahn-Hilliard degrees of freedom: 1558
106+
107+
-------------------------
108+
Cahn-Hilliard Barycenter
109+
-------------------------
110+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
111+
6.000000e-01 3.523343e-01 1.389488e-06 9.495790e-01 7.290279e-07
112+
113+
*******************************************************************************
114+
Transient iteration: 7 Time: 0.7 Time step: 0.1 CFL: 1.45659
115+
*******************************************************************************
116+
Number of active cells: 697
117+
Number of degrees of freedom: 2280
118+
Volume of triangulation: 4
119+
Number of Cahn-Hilliard degrees of freedom: 1520
120+
121+
-------------------------
122+
Cahn-Hilliard Barycenter
123+
-------------------------
124+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
125+
7.000000e-01 3.502705e-01 -1.377413e-05 9.493334e-01 -4.904477e-06
126+
127+
*******************************************************************************
128+
Transient iteration: 8 Time: 0.8 Time step: 0.1 CFL: 1.45667
129+
*******************************************************************************
130+
Number of active cells: 721
131+
Number of degrees of freedom: 2352
132+
Volume of triangulation: 4
133+
Number of Cahn-Hilliard degrees of freedom: 1568
134+
135+
-------------------------
136+
Cahn-Hilliard Barycenter
137+
-------------------------
138+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
139+
8.000000e-01 3.156897e-01 -4.985812e-07 9.473282e-01 -1.916337e-03
140+
141+
*******************************************************************************
142+
Transient iteration: 9 Time: 0.9 Time step: 0.1 CFL: 1.45375
143+
*******************************************************************************
144+
Number of active cells: 712
145+
Number of degrees of freedom: 2328
146+
Volume of triangulation: 4
147+
Number of Cahn-Hilliard degrees of freedom: 1552
148+
149+
-------------------------
150+
Cahn-Hilliard Barycenter
151+
-------------------------
152+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
153+
9.000000e-01 2.542705e-01 -1.771304e-04 9.447748e-01 -2.447104e-05
154+
155+
*******************************************************************************
156+
Transient iteration: 10 Time: 1 Time step: 0.1 CFL: 1.45097
157+
*******************************************************************************
158+
Number of active cells: 709
159+
Number of degrees of freedom: 2319
160+
Volume of triangulation: 4
161+
Number of Cahn-Hilliard degrees of freedom: 1546
162+
163+
-------------------------
164+
Cahn-Hilliard Barycenter
165+
-------------------------
166+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
167+
1.000000e+00 1.743566e-01 -1.825746e-04 9.431318e-01 -1.352193e-05
168+
169+
*******************************************************************************
170+
Transient iteration: 11 Time: 1.1 Time step: 0.1 CFL: 1.45092
171+
*******************************************************************************
172+
Number of active cells: 727
173+
Number of degrees of freedom: 2388
174+
Volume of triangulation: 4
175+
Number of Cahn-Hilliard degrees of freedom: 1592
176+
177+
-------------------------
178+
Cahn-Hilliard Barycenter
179+
-------------------------
180+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
181+
1.100000e+00 8.513368e-02 -1.838895e-04 9.435853e-01 -4.044475e-06
182+
183+
*******************************************************************************
184+
Transient iteration: 12 Time: 1.2 Time step: 0.1 CFL: 1.45581
185+
*******************************************************************************
186+
Number of active cells: 727
187+
Number of degrees of freedom: 2376
188+
Volume of triangulation: 4
189+
Number of Cahn-Hilliard degrees of freedom: 1584
190+
191+
-------------------------
192+
Cahn-Hilliard Barycenter
193+
-------------------------
194+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
195+
1.200000e+00 -4.533727e-03 -1.914768e-04 9.406825e-01 -4.426158e-04
196+
197+
*******************************************************************************
198+
Transient iteration: 13 Time: 1.3 Time step: 0.1 CFL: 1.45306
199+
*******************************************************************************
200+
Number of active cells: 724
201+
Number of degrees of freedom: 2379
202+
Volume of triangulation: 4
203+
Number of Cahn-Hilliard degrees of freedom: 1586
204+
205+
-------------------------
206+
Cahn-Hilliard Barycenter
207+
-------------------------
208+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
209+
1.300000e+00 -8.661074e-02 -2.322010e-04 9.401689e-01 3.168932e-05
210+
211+
*******************************************************************************
212+
Transient iteration: 14 Time: 1.4 Time step: 0.1 CFL: 1.45546
213+
*******************************************************************************
214+
Number of active cells: 715
215+
Number of degrees of freedom: 2334
216+
Volume of triangulation: 4
217+
Number of Cahn-Hilliard degrees of freedom: 1556
218+
219+
-------------------------
220+
Cahn-Hilliard Barycenter
221+
-------------------------
222+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
223+
1.400000e+00 -1.547633e-01 -2.253168e-04 9.378217e-01 -5.517296e-04
224+
225+
*******************************************************************************
226+
Transient iteration: 15 Time: 1.5 Time step: 0.1 CFL: 1.45265
227+
*******************************************************************************
228+
Number of active cells: 721
229+
Number of degrees of freedom: 2367
230+
Volume of triangulation: 4
231+
Number of Cahn-Hilliard degrees of freedom: 1578
232+
233+
-------------------------
234+
Cahn-Hilliard Barycenter
235+
-------------------------
236+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
237+
1.500000e+00 -2.042688e-01 -2.795846e-04 9.380117e-01 -6.416754e-06
238+
239+
*******************************************************************************
240+
Transient iteration: 16 Time: 1.6 Time step: 0.1 CFL: 1.45533
241+
*******************************************************************************
242+
Number of active cells: 703
243+
Number of degrees of freedom: 2292
244+
Volume of triangulation: 4
245+
Number of Cahn-Hilliard degrees of freedom: 1528
246+
247+
-------------------------
248+
Cahn-Hilliard Barycenter
249+
-------------------------
250+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
251+
1.600000e+00 -2.327802e-01 -2.529040e-04 9.367188e-01 -1.470065e-03
252+
253+
*******************************************************************************
254+
Transient iteration: 17 Time: 1.7 Time step: 0.1 CFL: 1.45516
255+
*******************************************************************************
256+
Number of active cells: 715
257+
Number of degrees of freedom: 2331
258+
Volume of triangulation: 4
259+
Number of Cahn-Hilliard degrees of freedom: 1554
260+
261+
-------------------------
262+
Cahn-Hilliard Barycenter
263+
-------------------------
264+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
265+
1.700000e+00 -2.401852e-01 -3.914376e-04 9.380837e-01 -2.384484e-05
266+
267+
*******************************************************************************
268+
Transient iteration: 18 Time: 1.8 Time step: 0.1 CFL: 1.46098
269+
*******************************************************************************
270+
Number of active cells: 715
271+
Number of degrees of freedom: 2331
272+
Volume of triangulation: 4
273+
Number of Cahn-Hilliard degrees of freedom: 1554
274+
275+
-------------------------
276+
Cahn-Hilliard Barycenter
277+
-------------------------
278+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
279+
1.800000e+00 -2.279344e-01 -3.898199e-04 9.373024e-01 -6.321715e-04
280+
281+
*******************************************************************************
282+
Transient iteration: 19 Time: 1.9 Time step: 0.1 CFL: 1.45836
283+
*******************************************************************************
284+
Number of active cells: 715
285+
Number of degrees of freedom: 2331
286+
Volume of triangulation: 4
287+
Number of Cahn-Hilliard degrees of freedom: 1554
288+
289+
-------------------------
290+
Cahn-Hilliard Barycenter
291+
-------------------------
292+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
293+
1.900000e+00 -1.991551e-01 -4.515133e-04 9.384494e-01 -2.738432e-05
294+
295+
*******************************************************************************
296+
Transient iteration: 20 Time: 2 Time step: 0.1 CFL: 1.46048
297+
*******************************************************************************
298+
Number of active cells: 709
299+
Number of degrees of freedom: 2310
300+
Volume of triangulation: 4
301+
Number of Cahn-Hilliard degrees of freedom: 1540
302+
303+
-------------------------
304+
Cahn-Hilliard Barycenter
305+
-------------------------
306+
time x_cahn_hilliard y_cahn_hilliard vx_cahn_hilliard vy_cahn_hilliard
307+
2.000000e+00 -1.580186e-01 -4.616693e-04 9.372702e-01 -2.957594e-06

0 commit comments

Comments
 (0)