AlanZee commited on
Commit
3569d45
·
verified ·
1 Parent(s): 8ae6fd4

Upload folder using huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. templates/cnoidal_wave/base/0/U +54 -0
  2. templates/cnoidal_wave/base/0/alpha.water +52 -0
  3. templates/cnoidal_wave/base/0/p_rgh +54 -0
  4. templates/cnoidal_wave/base/Allclean +7 -0
  5. templates/cnoidal_wave/base/Allrun +15 -0
  6. templates/cnoidal_wave/base/constant/g +22 -0
  7. templates/cnoidal_wave/base/constant/transportProperties +37 -0
  8. templates/cnoidal_wave/base/constant/turbulenceProperties +20 -0
  9. templates/cnoidal_wave/base/constant/waveProperties +47 -0
  10. templates/cnoidal_wave/base/system/blockMeshDict +89 -0
  11. templates/cnoidal_wave/base/system/controlDict +148 -0
  12. templates/cnoidal_wave/base/system/decomposeParDict +27 -0
  13. templates/cnoidal_wave/base/system/fvSchemes +53 -0
  14. templates/cnoidal_wave/base/system/fvSolution +77 -0
  15. templates/cnoidal_wave/base/system/setFieldsDict +36 -0
  16. templates/dam_break/base/0/U +41 -0
  17. templates/dam_break/base/0/alpha.water +42 -0
  18. templates/dam_break/base/0/p_rgh +45 -0
  19. templates/dam_break/base/Allrun +44 -0
  20. templates/dam_break/base/constant/g +10 -0
  21. templates/dam_break/base/constant/transportProperties +29 -0
  22. templates/dam_break/base/constant/turbulenceProperties +9 -0
  23. templates/dam_break/base/system/blockMeshDict +89 -0
  24. templates/dam_break/base/system/controlDict +36 -0
  25. templates/dam_break/base/system/decomposeParDict +21 -0
  26. templates/dam_break/base/system/fvSchemes +53 -0
  27. templates/dam_break/base/system/fvSolution +86 -0
  28. templates/droplet_impact/base/0/U +46 -0
  29. templates/droplet_impact/base/0/alpha.water +50 -0
  30. templates/droplet_impact/base/0/p_rgh +46 -0
  31. templates/droplet_impact/base/Allrun +42 -0
  32. templates/droplet_impact/base/constant/g +10 -0
  33. templates/droplet_impact/base/constant/transportProperties +33 -0
  34. templates/droplet_impact/base/constant/turbulenceProperties +9 -0
  35. templates/droplet_impact/base/system/blockMeshDict +73 -0
  36. templates/droplet_impact/base/system/controlDict +31 -0
  37. templates/droplet_impact/base/system/decomposeParDict +18 -0
  38. templates/droplet_impact/base/system/fvSchemes +47 -0
  39. templates/droplet_impact/base/system/fvSolution +85 -0
  40. templates/rising_bubble/base/0/U +39 -0
  41. templates/rising_bubble/base/0/alpha.water +40 -0
  42. templates/rising_bubble/base/0/p_rgh +43 -0
  43. templates/rising_bubble/base/Allrun +42 -0
  44. templates/rising_bubble/base/constant/g +12 -0
  45. templates/rising_bubble/base/constant/transportProperties +38 -0
  46. templates/rising_bubble/base/constant/turbulenceProperties +9 -0
  47. templates/rising_bubble/base/system/blockMeshDict +74 -0
  48. templates/rising_bubble/base/system/controlDict +31 -0
  49. templates/rising_bubble/base/system/decomposeParDict +18 -0
  50. templates/rising_bubble/base/system/fvSchemes +47 -0
templates/cnoidal_wave/base/0/U ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class volVectorField;
13
+ location "0";
14
+ object U;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ dimensions [0 1 -1 0 0 0 0];
19
+
20
+ internalField uniform (0 0 0);
21
+
22
+ boundaryField
23
+ {
24
+ inlet
25
+ {
26
+ type waveVelocity;
27
+ value uniform (0 0 0);
28
+ }
29
+
30
+ outlet
31
+ {
32
+ type waveVelocity;
33
+ value uniform (0 0 0);
34
+ }
35
+
36
+ sides
37
+ {
38
+ type empty;
39
+ }
40
+
41
+ ground
42
+ {
43
+ type fixedValue;
44
+ value uniform (0 0 0);
45
+ }
46
+
47
+ top
48
+ {
49
+ type pressureInletOutletVelocity;
50
+ value uniform (0 0 0);
51
+ }
52
+ }
53
+
54
+ // ************************************************************************* //
templates/cnoidal_wave/base/0/alpha.water ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class volScalarField;
13
+ object alpha.water;
14
+ }
15
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
16
+
17
+ dimensions [0 0 0 0 0 0 0];
18
+
19
+ internalField uniform 0;
20
+
21
+ boundaryField
22
+ {
23
+ inlet
24
+ {
25
+ type waveAlpha;
26
+ value uniform 0;
27
+ }
28
+
29
+ outlet
30
+ {
31
+ type zeroGradient;
32
+ }
33
+
34
+ ground
35
+ {
36
+ type zeroGradient;
37
+ }
38
+
39
+ sides
40
+ {
41
+ type empty;
42
+ }
43
+
44
+ top
45
+ {
46
+ type inletOutlet;
47
+ inletValue uniform 0;
48
+ value uniform 0;
49
+ }
50
+ }
51
+
52
+ // ************************************************************************* //
templates/cnoidal_wave/base/0/p_rgh ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class volScalarField;
13
+ object p_rgh;
14
+ }
15
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
16
+
17
+ dimensions [1 -1 -2 0 0 0 0];
18
+
19
+ internalField uniform 0;
20
+
21
+ boundaryField
22
+ {
23
+ inlet
24
+ {
25
+ type fixedFluxPressure;
26
+ value uniform 0;
27
+ }
28
+
29
+ outlet
30
+ {
31
+ type fixedFluxPressure;
32
+ value uniform 0;
33
+ }
34
+
35
+ ground
36
+ {
37
+ type fixedFluxPressure;
38
+ value uniform 0;
39
+ }
40
+
41
+ sides
42
+ {
43
+ type empty;
44
+ }
45
+
46
+ top
47
+ {
48
+ type totalPressure;
49
+ p0 uniform 0;
50
+ }
51
+ }
52
+
53
+
54
+ // ************************************************************************* //
templates/cnoidal_wave/base/Allclean ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ cd ${0%/*} || exit 1 # Run from this directory
3
+ . $WM_PROJECT_DIR/bin/tools/CleanFunctions # Tutorial clean functions
4
+
5
+ cleanCase0
6
+
7
+ #------------------------------------------------------------------------------
templates/cnoidal_wave/base/Allrun ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ cd ${0%/*} || exit 1 # Run from this directory
3
+ . $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
4
+
5
+ restore0Dir
6
+
7
+ runApplication blockMesh
8
+
9
+ runApplication decomposePar
10
+
11
+ runParallel setFields
12
+
13
+ runParallel $(getApplication)
14
+
15
+ #------------------------------------------------------------------------------
templates/cnoidal_wave/base/constant/g ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class uniformDimensionedVectorField;
13
+ location "constant";
14
+ object g;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ dimensions [0 1 -2 0 0 0 0];
19
+ value ( 0 0 -9.81 );
20
+
21
+
22
+ // ************************************************************************* //
templates/cnoidal_wave/base/constant/transportProperties ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ location "constant";
14
+ object transportProperties;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ phases (water air);
19
+
20
+ water
21
+ {
22
+ transportModel Newtonian;
23
+ nu 1e-06;
24
+ rho 1000;
25
+ }
26
+
27
+ air
28
+ {
29
+ transportModel Newtonian;
30
+ nu 1.48e-05;
31
+ rho 1;
32
+ }
33
+
34
+ sigma 0.07;
35
+
36
+
37
+ // ************************************************************************* //
templates/cnoidal_wave/base/constant/turbulenceProperties ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ location "constant";
14
+ object turbulenceProperties;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ simulationType laminar;
19
+
20
+ // ************************************************************************* //
templates/cnoidal_wave/base/constant/waveProperties ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*---------------------------------------------------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ location "constant";
14
+ object waveProperties;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ inlet
19
+ {
20
+ alpha alpha.water;
21
+
22
+ waveModel cnoidal;
23
+
24
+ nPaddle 1;
25
+
26
+ waveHeight 0.1;
27
+
28
+ waveAngle 0.0;
29
+
30
+ rampTime 6.0;
31
+
32
+ activeAbsorption yes;
33
+
34
+ wavePeriod 4.0;
35
+ }
36
+
37
+ outlet
38
+ {
39
+ alpha alpha.water;
40
+
41
+ waveModel shallowWaterAbsorption;
42
+
43
+ nPaddle 1;
44
+ }
45
+
46
+
47
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/blockMeshDict ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ object blockMeshDict;
14
+ }
15
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
16
+
17
+ scale 1;
18
+
19
+ vertices
20
+ (
21
+ ( 0.0 0.0 0.0)
22
+ ( 30.0 0.0 0.0)
23
+ ( 30.0 0.04 0.0)
24
+ ( 0.0 0.04 0.0)
25
+ ( 0.0 0.0 0.7)
26
+ ( 30.0 0.0 0.7)
27
+ ( 30.0 0.04 0.7)
28
+ ( 0.0 0.04 0.7)
29
+ );
30
+
31
+ blocks
32
+ (
33
+ hex (0 1 2 3 4 5 6 7) (750 1 70) simpleGrading (1 1 1)
34
+ );
35
+
36
+ edges
37
+ (
38
+ );
39
+
40
+ boundary
41
+ (
42
+ inlet
43
+ {
44
+ type patch;
45
+ faces
46
+ (
47
+ (0 4 7 3)
48
+ );
49
+ }
50
+ outlet
51
+ {
52
+ type patch;
53
+ faces
54
+ (
55
+ (1 5 6 2)
56
+ );
57
+ }
58
+ ground
59
+ {
60
+ type wall;
61
+ faces
62
+ (
63
+ (0 1 2 3)
64
+ );
65
+ }
66
+ top
67
+ {
68
+ type patch;
69
+ faces
70
+ (
71
+ (4 5 6 7)
72
+ );
73
+ }
74
+ sides
75
+ {
76
+ type empty;
77
+ faces
78
+ (
79
+ (0 1 5 4)
80
+ (3 2 6 7)
81
+ );
82
+ }
83
+ );
84
+
85
+ mergePatchPairs
86
+ (
87
+ );
88
+
89
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/controlDict ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ location "system";
14
+ object controlDict;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ application interFoam;
19
+
20
+ startFrom latestTime;
21
+
22
+ startTime 0;
23
+
24
+ stopAt endTime;
25
+
26
+ endTime 50.0;
27
+
28
+ deltaT 0.01;
29
+
30
+ writeControl adjustableRunTime;
31
+
32
+ writeInterval 0.033;
33
+
34
+ purgeWrite 0;
35
+
36
+ writeFormat ascii;
37
+
38
+ writePrecision 6;
39
+
40
+ writeCompression off;
41
+
42
+ timeFormat general;
43
+
44
+ timePrecision 6;
45
+
46
+ runTimeModifiable yes;
47
+
48
+ adjustTimeStep yes;
49
+
50
+ maxCo 0.65;
51
+
52
+ maxAlphaCo 0.65;
53
+
54
+ maxDeltaT 0.05;
55
+
56
+
57
+ functions
58
+ {
59
+ line
60
+ {
61
+ type sets;
62
+ libs ("libsampling.so");
63
+ enabled true;
64
+ writeControl writeTime;
65
+ writeInterval 1;
66
+
67
+ interpolationScheme cellPoint;
68
+ setFormat raw;
69
+
70
+ sets
71
+ (
72
+ line1
73
+ {
74
+ type uniform;
75
+ axis distance;
76
+ start ( 1.0 0.005 0.0 );
77
+ end ( 1.0 0.005 0.8 );
78
+ nPoints 1001;
79
+ }
80
+ line2
81
+ {
82
+ type uniform;
83
+ axis distance;
84
+ start ( 2.0 0.005 0.0 );
85
+ end ( 2.0 0.005 0.8 );
86
+ nPoints 1001;
87
+ }
88
+ line3
89
+ {
90
+ type uniform;
91
+ axis distance;
92
+ start ( 3.0 0.005 0.0 );
93
+ end ( 3.0 0.005 0.8 );
94
+ nPoints 1001;
95
+ }
96
+ line4
97
+ {
98
+ type uniform;
99
+ axis distance;
100
+ start ( 5.0 0.005 0.0 );
101
+ end ( 5.0 0.005 0.8 );
102
+ nPoints 1001;
103
+ }
104
+ line5
105
+ {
106
+ type uniform;
107
+ axis distance;
108
+ start ( 7.5 0.005 0.0 );
109
+ end ( 7.5 0.005 0.8 );
110
+ nPoints 1001;
111
+ }
112
+
113
+ line6
114
+ {
115
+ type uniform;
116
+ axis distance;
117
+ start ( 10.0 0.005 0.0 );
118
+ end ( 10.0 0.005 0.8 );
119
+ nPoints 1001;
120
+ }
121
+ line7
122
+ {
123
+ type uniform;
124
+ axis distance;
125
+ start ( 12.0 0.005 0.0 );
126
+ end ( 12.0 0.005 0.8 );
127
+ nPoints 1001;
128
+ }
129
+ line8
130
+ {
131
+ type uniform;
132
+ axis distance;
133
+ start ( 14.0 0.005 0.0 );
134
+ end ( 14.0 0.005 0.8 );
135
+ nPoints 1001;
136
+ }
137
+ );
138
+
139
+ fixedLocations false;
140
+ fields
141
+ (
142
+ U alpha.water
143
+ );
144
+ }
145
+ }
146
+
147
+
148
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/decomposeParDict ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ object decomposeParDict;
14
+ }
15
+
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ numberOfSubdomains 2;
19
+
20
+ method hierarchical;
21
+
22
+ coeffs
23
+ {
24
+ n (2 1 1);
25
+ }
26
+
27
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/fvSchemes ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*--------------------------------*- C++ -*----------------------------------*\
3
+ | ========= | |
4
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
5
+ | \\ / O peration | Version: v1906 |
6
+ | \\ / A nd | Web: www.OpenFOAM.com |
7
+ | \\/ M anipulation | |
8
+ \*---------------------------------------------------------------------------*/
9
+ FoamFile
10
+ {
11
+ version 2.0;
12
+ format ascii;
13
+ class dictionary;
14
+ location "system";
15
+ object fvSchemes;
16
+ }
17
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18
+
19
+ ddtSchemes
20
+ {
21
+ default Euler;
22
+ }
23
+
24
+ gradSchemes
25
+ {
26
+ default Gauss linear;
27
+ }
28
+
29
+ divSchemes
30
+ {
31
+ div(rhoPhi,U) Gauss linearUpwind grad(U);
32
+ div(phi,alpha) Gauss vanLeer;
33
+ div(phirb,alpha) Gauss linear;
34
+ div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
35
+ }
36
+
37
+ laplacianSchemes
38
+ {
39
+ default Gauss linear orthogonal;
40
+ }
41
+
42
+ interpolationSchemes
43
+ {
44
+ default linear;
45
+ }
46
+
47
+ snGradSchemes
48
+ {
49
+ default orthogonal;
50
+ }
51
+
52
+
53
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/fvSolution ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ /*--------------------------------*- C++ -*----------------------------------*\
3
+ | ========= | |
4
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
5
+ | \\ / O peration | Version: v1906 |
6
+ | \\ / A nd | Web: www.OpenFOAM.com |
7
+ | \\/ M anipulation | |
8
+ \*---------------------------------------------------------------------------*/
9
+ FoamFile
10
+ {
11
+ version 2.0;
12
+ format ascii;
13
+ class dictionary;
14
+ location "system";
15
+ object fvSolution;
16
+ }
17
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18
+
19
+ solvers
20
+ {
21
+ "alpha.water.*"
22
+ {
23
+ nAlphaCorr 1;
24
+ nAlphaSubCycles 3;
25
+ cAlpha 1;
26
+ }
27
+
28
+ "pcorr.*"
29
+ {
30
+ solver PCG;
31
+ preconditioner DIC;
32
+ tolerance 1e-6;
33
+ relTol 0;
34
+ }
35
+
36
+ p_rgh
37
+ {
38
+ solver PCG;
39
+ preconditioner DIC;
40
+ tolerance 1e-6;
41
+ relTol 0.1;
42
+ }
43
+
44
+ p_rghFinal
45
+ {
46
+ solver GAMG;
47
+ smoother DIC;
48
+ tolerance 1e-7;
49
+ relTol 0;
50
+ }
51
+
52
+ U
53
+ {
54
+ solver PBiCG;
55
+ preconditioner DILU;
56
+ tolerance 1e-6;
57
+ relTol 0.1;
58
+ }
59
+
60
+ UFinal
61
+ {
62
+ solver PBiCG;
63
+ preconditioner DILU;
64
+ tolerance 1e-6;
65
+ relTol 0;
66
+ }
67
+ }
68
+
69
+ PIMPLE
70
+ {
71
+ momentumPredictor no;
72
+ nCorrectors 2;
73
+ nNonOrthogonalCorrectors 0;
74
+ }
75
+
76
+
77
+ // ************************************************************************* //
templates/cnoidal_wave/base/system/setFieldsDict ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*--------------------------------*- C++ -*----------------------------------*\
2
+ | ========= | |
3
+ | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4
+ | \\ / O peration | Version: v1906 |
5
+ | \\ / A nd | Web: www.OpenFOAM.com |
6
+ | \\/ M anipulation | |
7
+ \*---------------------------------------------------------------------------*/
8
+ FoamFile
9
+ {
10
+ version 2.0;
11
+ format ascii;
12
+ class dictionary;
13
+ location "system";
14
+ object setFieldsDict;
15
+ }
16
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
+
18
+ defaultFieldValues
19
+ (
20
+ volScalarFieldValue alpha.water 0
21
+ );
22
+
23
+ regions
24
+ (
25
+ boxToCell
26
+ {
27
+ box (0 0 0) (30.0 1.0 0.4);
28
+ fieldValues
29
+ (
30
+ volScalarFieldValue alpha.water 1
31
+ );
32
+ }
33
+ );
34
+
35
+
36
+ // ************************************************************************* //
templates/dam_break/base/0/U ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volVectorField;
6
+ object U;
7
+ }
8
+
9
+ dimensions [0 1 -1 0 0 0 0];
10
+
11
+ internalField uniform (0 0 0);
12
+
13
+ boundaryField
14
+ {
15
+ leftWall
16
+ {
17
+ type noSlip;
18
+ }
19
+
20
+ rightWall
21
+ {
22
+ type noSlip;
23
+ }
24
+
25
+ lowerWall
26
+ {
27
+ type noSlip;
28
+ }
29
+
30
+ upperWall
31
+ {
32
+ type pressureInletOutletVelocity;
33
+ phi phi;
34
+ value uniform (0 0 0);
35
+ }
36
+
37
+ defaultFaces
38
+ {
39
+ type empty;
40
+ }
41
+ }
templates/dam_break/base/0/alpha.water ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object alpha.water;
7
+ }
8
+
9
+ dimensions [0 0 0 0 0 0 0];
10
+
11
+ // 初始值:全部为空气(alpha=0),由 gen_init_conditions.py 覆盖水柱区域
12
+ internalField uniform 0;
13
+
14
+ boundaryField
15
+ {
16
+ leftWall
17
+ {
18
+ type zeroGradient;
19
+ }
20
+
21
+ rightWall
22
+ {
23
+ type zeroGradient;
24
+ }
25
+
26
+ lowerWall
27
+ {
28
+ type zeroGradient;
29
+ }
30
+
31
+ upperWall
32
+ {
33
+ type inletOutlet;
34
+ inletValue uniform 0;
35
+ value uniform 0;
36
+ }
37
+
38
+ defaultFaces
39
+ {
40
+ type empty;
41
+ }
42
+ }
templates/dam_break/base/0/p_rgh ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object p_rgh;
7
+ }
8
+
9
+ dimensions [1 -1 -2 0 0 0 0];
10
+
11
+ // 注意: OpenFOAM 中 p_rgh = p/rho - g·x,此处为 kinematic pressure
12
+ internalField uniform 0;
13
+
14
+ boundaryField
15
+ {
16
+ leftWall
17
+ {
18
+ type fixedFluxPressure;
19
+ value uniform 0;
20
+ }
21
+
22
+ rightWall
23
+ {
24
+ type fixedFluxPressure;
25
+ value uniform 0;
26
+ }
27
+
28
+ lowerWall
29
+ {
30
+ type fixedFluxPressure;
31
+ value uniform 0;
32
+ }
33
+
34
+ upperWall
35
+ {
36
+ type prghPressure;
37
+ p uniform 0;
38
+ value uniform 0;
39
+ }
40
+
41
+ defaultFaces
42
+ {
43
+ type empty;
44
+ }
45
+ }
templates/dam_break/base/Allrun ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # dam_break Allrun 脚本
3
+ # 用法: bash Allrun [n_procs]
4
+ # 注意: 初始场文件(0/alpha.water, 0/U)由 gen_init_conditions.py 预生成
5
+
6
+ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
7
+
8
+ N_PROCS=${1:-1}
9
+
10
+ echo "=== dam_break: blockMesh ==="
11
+ blockMesh > log.blockMesh 2>&1
12
+ if [ $? -ne 0 ]; then
13
+ echo "ERROR: blockMesh failed, see log.blockMesh"
14
+ exit 1
15
+ fi
16
+ echo " blockMesh 完成"
17
+
18
+ if [ "$N_PROCS" -gt 1 ]; then
19
+ echo "=== dam_break: decomposePar (np=$N_PROCS) ==="
20
+ decomposePar -force > log.decomposePar 2>&1
21
+ if [ $? -ne 0 ]; then
22
+ echo "ERROR: decomposePar failed, see log.decomposePar"
23
+ exit 1
24
+ fi
25
+
26
+ echo "=== dam_break: interFoam (parallel, np=$N_PROCS) ==="
27
+ mpirun -np "$N_PROCS" interFoam -parallel > log.interFoam 2>&1
28
+ if [ $? -ne 0 ]; then
29
+ echo "ERROR: interFoam failed, see log.interFoam"
30
+ exit 1
31
+ fi
32
+
33
+ echo "=== dam_break: reconstructPar ==="
34
+ reconstructPar > log.reconstructPar 2>&1
35
+ else
36
+ echo "=== dam_break: interFoam (serial) ==="
37
+ interFoam > log.interFoam 2>&1
38
+ if [ $? -ne 0 ]; then
39
+ echo "ERROR: interFoam failed, see log.interFoam"
40
+ exit 1
41
+ fi
42
+ fi
43
+
44
+ echo "=== dam_break 完成 ==="
templates/dam_break/base/constant/g ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class uniformDimensionedVectorField;
6
+ object g;
7
+ }
8
+
9
+ dimensions [0 1 -2 0 0 0 0];
10
+ value (0 -9.81 0);
templates/dam_break/base/constant/transportProperties ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object transportProperties;
7
+ }
8
+
9
+ // 两相流物性参数
10
+ // 参考: OpenFOAM Foundation. OpenFOAM v9 User Guide, 2021.
11
+ // 水和空气的标准物理参数
12
+
13
+ phases (water air);
14
+
15
+ water
16
+ {
17
+ transportModel Newtonian;
18
+ nu 1.0e-06; // 运动粘度 [m^2/s] (20 deg C)
19
+ rho 1000; // 密度 [kg/m^3]
20
+ }
21
+
22
+ air
23
+ {
24
+ transportModel Newtonian;
25
+ nu 1.48e-05; // 运动粘度 [m^2/s] (20 deg C)
26
+ rho 1.225; // 密度 [kg/m^3]
27
+ }
28
+
29
+ sigma 0.07; // 表面张力系数 [N/m] (水-空气, 20 deg C)
templates/dam_break/base/constant/turbulenceProperties ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object turbulenceProperties;
7
+ }
8
+
9
+ simulationType laminar;
templates/dam_break/base/system/blockMeshDict ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object blockMeshDict;
7
+ }
8
+
9
+ // 溃坝算例 — 简化矩形域(去除原始 damBreakLaminar 教程中的中间障碍物)
10
+ // 参考: OpenFOAM Foundation. OpenFOAM v9 User Guide, 2021.
11
+ // Section 2.1.1 "Breaking of a dam"
12
+ // 域尺寸: 0.584m x 0.584m (X x Y), Z 方向单层(2D, empty 边界)
13
+ // 网格: 128 x 128 (X x Y)
14
+
15
+ scale 1; // 坐标单位: m
16
+
17
+ // 四个顶点 (Z=0 和 Z=0.001 两层构成退化 3D 网格)
18
+ vertices
19
+ (
20
+ (0 0 0) // 0: 左下前
21
+ (0.584 0 0) // 1: 右下前
22
+ (0.584 0.584 0) // 2: 右上前
23
+ (0 0.584 0) // 3: 左上前
24
+ (0 0 0.001) // 4: 左下后
25
+ (0.584 0 0.001) // 5: 右下后
26
+ (0.584 0.584 0.001) // 6: 右上后
27
+ (0 0.584 0.001) // 7: 左上后
28
+ );
29
+
30
+ // 单一六面体块,128x128x1 网格
31
+ // vertex ordering: 右手定则,从 0-3 (Z=0) 到 4-7 (Z=0.001)
32
+ blocks
33
+ (
34
+ hex (0 1 2 3 4 5 6 7) (128 128 1) simpleGrading (1 1 1)
35
+ );
36
+
37
+ edges
38
+ (
39
+ );
40
+
41
+ // 边界面定义
42
+ boundary
43
+ (
44
+ leftWall
45
+ {
46
+ type wall;
47
+ faces
48
+ (
49
+ (0 4 7 3) // X=0 面(左侧壁)
50
+ );
51
+ }
52
+
53
+ rightWall
54
+ {
55
+ type wall;
56
+ faces
57
+ (
58
+ (1 2 6 5) // X=0.584 面(右侧壁)
59
+ );
60
+ }
61
+
62
+ lowerWall
63
+ {
64
+ type wall;
65
+ faces
66
+ (
67
+ (0 1 5 4) // Y=0 面(底部壁)
68
+ );
69
+ }
70
+
71
+ upperWall
72
+ {
73
+ type patch;
74
+ faces
75
+ (
76
+ (3 7 6 2) // Y=0.584 面(顶部开口)
77
+ );
78
+ }
79
+
80
+ defaultFaces
81
+ {
82
+ type empty;
83
+ faces
84
+ (
85
+ (0 3 2 1) // Z=0 前面
86
+ (4 5 6 7) // Z=0.001 后面
87
+ );
88
+ }
89
+ );
templates/dam_break/base/system/controlDict ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object controlDict;
7
+ }
8
+
9
+ application interFoam;
10
+
11
+ startFrom startTime;
12
+ startTime 0;
13
+ stopAt endTime;
14
+ endTime 2.0; // 溃坝物理时长 [s]
15
+
16
+ deltaT 0.002; // 初始时间步 [s](自适应调整)
17
+ writeControl adjustableRunTime;
18
+ writeInterval 0.08; // endTime/25 → 25 帧
19
+
20
+ purgeWrite 0;
21
+ writeFormat ascii; // ASCII 格式,便于后处理脚本读取
22
+ writePrecision 8;
23
+ timeFormat general;
24
+ timePrecision 6;
25
+
26
+ adjustTimeStep yes; // 自适应时间步
27
+ maxCo 0.5; // Courant 数限制
28
+ maxAlphaCo 0.5; // alpha Courant 数限制
29
+ maxDeltaT 0.005; // 最大时间步上限 [s]
30
+
31
+ functions {};
32
+
33
+ OptimisationSwitches
34
+ {
35
+ trapFpe no; // 禁用浮点异常捕获(避免数值噪声导致崩溃)
36
+ }
templates/dam_break/base/system/decomposeParDict ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object decomposeParDict;
7
+ }
8
+
9
+ // 并行分解设置
10
+ // 2D case: Z 方向仅 1 个分区(empty 边界限制)
11
+ // numberOfSubdomains 由 run_case.sh 传入,此处为默认值
12
+ numberOfSubdomains 4;
13
+
14
+ method hierarchical;
15
+
16
+ hierarchicalCoeffs
17
+ {
18
+ n (2 2 1); // X: 2分区, Y: 2分区, Z: 1分区
19
+ delta 0.001;
20
+ order xyz;
21
+ }
templates/dam_break/base/system/fvSchemes ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object fvSchemes;
7
+ }
8
+
9
+ ddtSchemes
10
+ {
11
+ default Euler;
12
+ }
13
+
14
+ gradSchemes
15
+ {
16
+ default Gauss linear;
17
+ }
18
+
19
+ divSchemes
20
+ {
21
+ default none;
22
+
23
+ // 速度对流项:线性迎风(一阶稳定)
24
+ div(rhoPhi,U) Gauss linearUpwind grad(U);
25
+
26
+ // alpha 方程:van Leer 界面压缩格式
27
+ // gcnl: 人工压缩通量,保持界面锐利
28
+ div(phi,alpha) Gauss vanLeer;
29
+ div(phirb,alpha) Gauss interfaceCompression vanLeer;
30
+
31
+ // ESI v1906 粘性应力项
32
+ div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear corrected;
33
+ }
34
+
35
+ laplacianSchemes
36
+ {
37
+ default Gauss linear corrected;
38
+ }
39
+
40
+ interpolationSchemes
41
+ {
42
+ default linear;
43
+ }
44
+
45
+ snGradSchemes
46
+ {
47
+ default uncorrected;
48
+ }
49
+
50
+ wallDist
51
+ {
52
+ method meshWave;
53
+ }
templates/dam_break/base/system/fvSolution ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object fvSolution;
7
+ }
8
+
9
+ solvers
10
+ {
11
+ "alpha.water.*"
12
+ {
13
+ nAlphaCorr 3;
14
+ nAlphaSubCycles 2;
15
+ cAlpha 1;
16
+ solver smoothSolver;
17
+ smoother symGaussSeidel;
18
+ tolerance 1e-8;
19
+ relTol 0;
20
+ minIter 1;
21
+ }
22
+
23
+ "pcorr.*"
24
+ {
25
+ solver PCG;
26
+ preconditioner DIC;
27
+ tolerance 1e-8;
28
+ relTol 0;
29
+ minIter 1;
30
+ }
31
+
32
+ "pcorrFinal.*"
33
+ {
34
+ $pcorr;
35
+ relTol 0;
36
+ }
37
+
38
+ "p_rgh.*"
39
+ {
40
+ solver PCG;
41
+ preconditioner DIC;
42
+ tolerance 1e-8;
43
+ relTol 0.001;
44
+ minIter 1;
45
+ }
46
+
47
+ "p_rghFinal.*"
48
+ {
49
+ $p_rgh;
50
+ relTol 0;
51
+ }
52
+
53
+ "U.*"
54
+ {
55
+ solver smoothSolver;
56
+ smoother symGaussSeidel;
57
+ tolerance 1e-8;
58
+ relTol 0;
59
+ minIter 1;
60
+ }
61
+ }
62
+
63
+ MULES
64
+ {
65
+ nAlphaCorr 3;
66
+ nAlphaSubCycles 2;
67
+ cAlpha 1;
68
+ }
69
+
70
+ PIMPLE
71
+ {
72
+ nOuterCorrectors 1;
73
+ nCorrectors 3;
74
+ nNonOrthogonalCorrectors 0;
75
+ MULESCorr yes;
76
+ nLimiterIter 5;
77
+ momentumPredictor no;
78
+ pRefCell 0;
79
+ pRefValue 0;
80
+ }
81
+
82
+ relaxationFactors
83
+ {
84
+ fields {};
85
+ equations {};
86
+ }
templates/droplet_impact/base/0/U ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volVectorField;
6
+ object U;
7
+ }
8
+
9
+ dimensions [0 1 -1 0 0 0 0];
10
+
11
+ // 初始值:全零;液滴区域由 gen_init_conditions.py 设置为 (0, -1.5, 0)
12
+ internalField uniform (0 0 0);
13
+
14
+ boundaryField
15
+ {
16
+ bottomWall
17
+ {
18
+ type noSlip; // 撞击壁面:无滑移
19
+ }
20
+
21
+ topPatch
22
+ {
23
+ type pressureInletOutletVelocity;
24
+ phi phi;
25
+ value uniform (0 0 0);
26
+ }
27
+
28
+ leftWall
29
+ {
30
+ type pressureInletOutletVelocity;
31
+ phi phi;
32
+ value uniform (0 0 0);
33
+ }
34
+
35
+ rightWall
36
+ {
37
+ type pressureInletOutletVelocity;
38
+ phi phi;
39
+ value uniform (0 0 0);
40
+ }
41
+
42
+ defaultFaces
43
+ {
44
+ type empty;
45
+ }
46
+ }
templates/droplet_impact/base/0/alpha.water ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object alpha.water;
7
+ }
8
+
9
+ dimensions [0 0 0 0 0 0 0];
10
+
11
+ // 初始值:全部为空气(alpha=0)
12
+ // 液滴半球区域由 gen_init_conditions.py 设置为 1
13
+ internalField uniform 0;
14
+
15
+ boundaryField
16
+ {
17
+ bottomWall
18
+ {
19
+ type constantAlphaContactAngle;
20
+ theta0 75; // Pasandideh-Fard (1996): stainless steel, theta_e ~ 70-80 deg
21
+ limit gradient;
22
+ value uniform 0;
23
+ }
24
+
25
+ topPatch
26
+ {
27
+ type inletOutlet;
28
+ inletValue uniform 0;
29
+ value uniform 0;
30
+ }
31
+
32
+ leftWall
33
+ {
34
+ type inletOutlet;
35
+ inletValue uniform 0;
36
+ value uniform 0;
37
+ }
38
+
39
+ rightWall
40
+ {
41
+ type inletOutlet;
42
+ inletValue uniform 0;
43
+ value uniform 0;
44
+ }
45
+
46
+ defaultFaces
47
+ {
48
+ type empty;
49
+ }
50
+ }
templates/droplet_impact/base/0/p_rgh ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object p_rgh;
7
+ }
8
+
9
+ dimensions [1 -1 -2 0 0 0 0];
10
+
11
+ internalField uniform 0;
12
+
13
+ boundaryField
14
+ {
15
+ bottomWall
16
+ {
17
+ type fixedFluxPressure;
18
+ value uniform 0;
19
+ }
20
+
21
+ topPatch
22
+ {
23
+ type prghPressure;
24
+ p uniform 0;
25
+ value uniform 0;
26
+ }
27
+
28
+ leftWall
29
+ {
30
+ type prghPressure;
31
+ p uniform 0;
32
+ value uniform 0;
33
+ }
34
+
35
+ rightWall
36
+ {
37
+ type prghPressure;
38
+ p uniform 0;
39
+ value uniform 0;
40
+ }
41
+
42
+ defaultFaces
43
+ {
44
+ type empty;
45
+ }
46
+ }
templates/droplet_impact/base/Allrun ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # droplet_impact Allrun 脚本
3
+ # 参考: Pasandideh-Fard, M. et al. (1998). Phys. Fluids, 10(3), 631-638.
4
+
5
+ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
6
+
7
+ N_PROCS=${1:-1}
8
+
9
+ echo "=== droplet_impact: blockMesh ==="
10
+ blockMesh > log.blockMesh 2>&1
11
+ if [ $? -ne 0 ]; then
12
+ echo "ERROR: blockMesh failed, see log.blockMesh"
13
+ exit 1
14
+ fi
15
+
16
+ if [ "$N_PROCS" -gt 1 ]; then
17
+ echo "=== droplet_impact: decomposePar (np=$N_PROCS) ==="
18
+ decomposePar -force > log.decomposePar 2>&1
19
+ if [ $? -ne 0 ]; then
20
+ echo "ERROR: decomposePar failed"
21
+ exit 1
22
+ fi
23
+
24
+ echo "=== droplet_impact: interFoam (parallel, np=$N_PROCS) ==="
25
+ mpirun -np "$N_PROCS" interFoam -parallel > log.interFoam 2>&1
26
+ if [ $? -ne 0 ]; then
27
+ echo "ERROR: interFoam failed"
28
+ exit 1
29
+ fi
30
+
31
+ echo "=== droplet_impact: reconstructPar ==="
32
+ reconstructPar > log.reconstructPar 2>&1
33
+ else
34
+ echo "=== droplet_impact: interFoam (serial) ==="
35
+ interFoam > log.interFoam 2>&1
36
+ if [ $? -ne 0 ]; then
37
+ echo "ERROR: interFoam failed"
38
+ exit 1
39
+ fi
40
+ fi
41
+
42
+ echo "=== droplet_impact 完成 ==="
templates/droplet_impact/base/constant/g ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class uniformDimensionedVectorField;
6
+ object g;
7
+ }
8
+
9
+ dimensions [0 1 -2 0 0 0 0];
10
+ value (0 -9.81 0);
templates/droplet_impact/base/constant/transportProperties ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object transportProperties;
7
+ }
8
+
9
+ // 液滴撞击算例物性参数
10
+ // 参考: Pasandideh-Fard, M. et al. (1996). "Capillary effects during
11
+ // droplet impact on a solid surface." Phys. Fluids, 8(3), 650-659.
12
+ // 水滴撞击固体壁面,We≈69, Re≈3360
13
+
14
+ phases (water air);
15
+
16
+ water
17
+ {
18
+ transportModel Newtonian;
19
+ nu 1.005e-06; // 运动粘度 [m^2/s] (μ=1.003e-3 Pa·s / ρ=998 kg/m^3)
20
+ rho 998; // 密度 [kg/m^3] (20 deg C)
21
+ }
22
+
23
+ air
24
+ {
25
+ transportModel Newtonian;
26
+ nu 1.455e-05; // 运动粘度 [m^2/s] (μ=1.78e-5 Pa·s / ρ=1.225 kg/m^3)
27
+ rho 1.225; // 密度 [kg/m^3]
28
+ }
29
+
30
+ sigma 0.0728; // 表面张力系数 [N/m] (水-空气, 20 deg C)
31
+ // Pasandideh-Fard Table I: σ = 0.0728 N/m
32
+ // 注: Foundation 版 OpenFOAM 不需要 wallAdhesion 关键字
33
+ // interfaceProperties 自动检测 alphaContactAngle BC 并应用接触角修正
templates/droplet_impact/base/constant/turbulenceProperties ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object turbulenceProperties;
7
+ }
8
+
9
+ simulationType laminar;
templates/droplet_impact/base/system/blockMeshDict ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object blockMeshDict;
7
+ }
8
+
9
+ // 液滴撞击算例
10
+ // 参考: Pasandideh-Fard, M. et al. (1996). "Capillary effects during
11
+ // droplet impact on a solid surface." Phys. Fluids, 8(3), 650-659.
12
+ // 域尺寸: 0.05m x 0.05m (~22D, D=2.25mm, 足够铺展-回缩)
13
+ // 网格: 256 x 256 (~11 cells/D)
14
+
15
+ scale 1;
16
+
17
+ vertices
18
+ (
19
+ (0 0 0) // 0
20
+ (0.05 0 0) // 1
21
+ (0.05 0.05 0) // 2
22
+ (0 0.05 0) // 3
23
+ (0 0 0.001) // 4
24
+ (0.05 0 0.001) // 5
25
+ (0.05 0.05 0.001) // 6
26
+ (0 0.05 0.001) // 7
27
+ );
28
+
29
+ blocks
30
+ (
31
+ hex (0 1 2 3 4 5 6 7) (256 256 1) simpleGrading (1 1 1)
32
+ );
33
+
34
+ edges
35
+ (
36
+ );
37
+
38
+ boundary
39
+ (
40
+ bottomWall
41
+ {
42
+ type wall;
43
+ faces ( (0 1 5 4) ); // Y=0 面(撞击壁面)
44
+ }
45
+
46
+ topPatch
47
+ {
48
+ type patch;
49
+ faces ( (3 7 6 2) ); // Y=0.05 面(顶部开放边界)
50
+ }
51
+
52
+ leftWall
53
+ {
54
+ type patch;
55
+ faces ( (0 4 7 3) ); // X=0 面(侧面开放边界)
56
+ }
57
+
58
+ rightWall
59
+ {
60
+ type patch;
61
+ faces ( (1 2 6 5) ); // X=0.05 面(侧面开放边界)
62
+ }
63
+
64
+ defaultFaces
65
+ {
66
+ type empty;
67
+ faces
68
+ (
69
+ (0 3 2 1) // Z=0
70
+ (4 5 6 7) // Z=0.001
71
+ );
72
+ }
73
+ );
templates/droplet_impact/base/system/controlDict ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object controlDict;
7
+ }
8
+
9
+ application interFoam;
10
+
11
+ startFrom startTime;
12
+ startTime 0;
13
+ stopAt endTime;
14
+ endTime 0.2; // 液滴撞击物理时长 [s](铺展+初始回弹,原 0.5s 过长)
15
+
16
+ deltaT 5e-06; // 初始时间步 [s](撞击过程需小时间步)
17
+ writeControl adjustableRunTime;
18
+ writeInterval 0.008; // endTime/25 → 25 帧
19
+
20
+ purgeWrite 0;
21
+ writeFormat ascii; // ASCII 格式,便于后处理脚本读取
22
+ writePrecision 8;
23
+ timeFormat general;
24
+ timePrecision 6;
25
+
26
+ adjustTimeStep yes;
27
+ maxCo 0.5;
28
+ maxAlphaCo 0.5;
29
+ maxDeltaT 1e-04; // 最大时间步上限
30
+
31
+ functions {};
templates/droplet_impact/base/system/decomposeParDict ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object decomposeParDict;
7
+ }
8
+
9
+ numberOfSubdomains 4;
10
+
11
+ method hierarchical;
12
+
13
+ hierarchicalCoeffs
14
+ {
15
+ n (2 2 1);
16
+ delta 0.001;
17
+ order xyz;
18
+ }
templates/droplet_impact/base/system/fvSchemes ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object fvSchemes;
7
+ }
8
+
9
+ ddtSchemes
10
+ {
11
+ default Euler;
12
+ }
13
+
14
+ gradSchemes
15
+ {
16
+ default Gauss linear;
17
+ }
18
+
19
+ divSchemes
20
+ {
21
+ default none;
22
+
23
+ div(rhoPhi,U) Gauss linearUpwind grad(U);
24
+ div(phi,alpha) Gauss vanLeer;
25
+ div(phirb,alpha) Gauss interfaceCompression vanLeer;
26
+ div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear corrected;
27
+ }
28
+
29
+ laplacianSchemes
30
+ {
31
+ default Gauss linear corrected;
32
+ }
33
+
34
+ interpolationSchemes
35
+ {
36
+ default linear;
37
+ }
38
+
39
+ snGradSchemes
40
+ {
41
+ default uncorrected;
42
+ }
43
+
44
+ wallDist
45
+ {
46
+ method meshWave;
47
+ }
templates/droplet_impact/base/system/fvSolution ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object fvSolution;
7
+ }
8
+
9
+ solvers
10
+ {
11
+ "alpha.water.*"
12
+ {
13
+ nAlphaCorr 3;
14
+ nAlphaSubCycles 3;
15
+ cAlpha 1;
16
+
17
+ solver smoothSolver;
18
+ smoother symGaussSeidel;
19
+ tolerance 1e-8;
20
+ relTol 0;
21
+ }
22
+
23
+ "pcorr.*"
24
+ {
25
+ solver PCG;
26
+ preconditioner DIC;
27
+ tolerance 1e-5;
28
+ relTol 0;
29
+ }
30
+
31
+ "pcorrFinal.*"
32
+ {
33
+ $pcorr;
34
+ relTol 0;
35
+ }
36
+
37
+ "p_rgh.*"
38
+ {
39
+ solver PCG;
40
+ preconditioner DIC;
41
+ tolerance 1e-08;
42
+ relTol 0.01;
43
+ }
44
+
45
+ "p_rghFinal.*"
46
+ {
47
+ $p_rgh;
48
+ relTol 0;
49
+ }
50
+
51
+ "U.*"
52
+ {
53
+ solver smoothSolver;
54
+ smoother symGaussSeidel;
55
+ tolerance 1e-06;
56
+ relTol 0;
57
+ }
58
+ }
59
+
60
+ MULES
61
+ {
62
+ nAlphaCorr 3;
63
+ nAlphaSubCycles 3;
64
+ cAlpha 1;
65
+ }
66
+
67
+ PIMPLE
68
+ {
69
+ nOuterCorrectors 1;
70
+ nCorrectors 3;
71
+ nNonOrthogonalCorrectors 0;
72
+ MULESCorr yes;
73
+ nLimiterIter 5;
74
+ momentumPredictor no;
75
+ pRefCell 0;
76
+ pRefValue 0;
77
+ }
78
+
79
+ relaxationFactors
80
+ {
81
+ equations
82
+ {
83
+ ".*" 1;
84
+ }
85
+ }
templates/rising_bubble/base/0/U ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volVectorField;
6
+ object U;
7
+ }
8
+
9
+ dimensions [0 1 -1 0 0 0 0];
10
+
11
+ internalField uniform (0 0 0);
12
+
13
+ boundaryField
14
+ {
15
+ leftWall
16
+ {
17
+ type slip;
18
+ }
19
+
20
+ rightWall
21
+ {
22
+ type slip;
23
+ }
24
+
25
+ lowerWall
26
+ {
27
+ type slip; // Hysing benchmark: 所有壁面均为自由滑移(对称面)
28
+ }
29
+
30
+ upperWall
31
+ {
32
+ type slip; // Hysing benchmark: 所有壁面均为自由滑移(对称面)
33
+ }
34
+
35
+ defaultFaces
36
+ {
37
+ type empty;
38
+ }
39
+ }
templates/rising_bubble/base/0/alpha.water ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object alpha.water;
7
+ }
8
+
9
+ dimensions [0 0 0 0 0 0 0];
10
+
11
+ // 初始值:全部为水(alpha=1),气泡区域由 gen_init_conditions.py 设置为 0
12
+ internalField uniform 1;
13
+
14
+ boundaryField
15
+ {
16
+ leftWall
17
+ {
18
+ type zeroGradient;
19
+ }
20
+
21
+ rightWall
22
+ {
23
+ type zeroGradient;
24
+ }
25
+
26
+ lowerWall
27
+ {
28
+ type zeroGradient;
29
+ }
30
+
31
+ upperWall
32
+ {
33
+ type zeroGradient;
34
+ }
35
+
36
+ defaultFaces
37
+ {
38
+ type empty;
39
+ }
40
+ }
templates/rising_bubble/base/0/p_rgh ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class volScalarField;
6
+ object p_rgh;
7
+ }
8
+
9
+ dimensions [1 -1 -2 0 0 0 0];
10
+
11
+ internalField uniform 0;
12
+
13
+ boundaryField
14
+ {
15
+ leftWall
16
+ {
17
+ type fixedFluxPressure;
18
+ value uniform 0;
19
+ }
20
+
21
+ rightWall
22
+ {
23
+ type fixedFluxPressure;
24
+ value uniform 0;
25
+ }
26
+
27
+ lowerWall
28
+ {
29
+ type fixedFluxPressure;
30
+ value uniform 0;
31
+ }
32
+
33
+ upperWall
34
+ {
35
+ type fixedFluxPressure;
36
+ value uniform 0;
37
+ }
38
+
39
+ defaultFaces
40
+ {
41
+ type empty;
42
+ }
43
+ }
templates/rising_bubble/base/Allrun ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # rising_bubble Allrun 脚本
3
+ # 参考: Hysing, S. et al. (2009), Int. J. Numer. Meth. Fluids, 60(11), 1259-1288.
4
+
5
+ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
6
+
7
+ N_PROCS=${1:-1}
8
+
9
+ echo "=== rising_bubble: blockMesh ==="
10
+ blockMesh > log.blockMesh 2>&1
11
+ if [ $? -ne 0 ]; then
12
+ echo "ERROR: blockMesh failed, see log.blockMesh"
13
+ exit 1
14
+ fi
15
+
16
+ if [ "$N_PROCS" -gt 1 ]; then
17
+ echo "=== rising_bubble: decomposePar (np=$N_PROCS) ==="
18
+ decomposePar -force > log.decomposePar 2>&1
19
+ if [ $? -ne 0 ]; then
20
+ echo "ERROR: decomposePar failed"
21
+ exit 1
22
+ fi
23
+
24
+ echo "=== rising_bubble: interFoam (parallel, np=$N_PROCS) ==="
25
+ mpirun -np "$N_PROCS" interFoam -parallel > log.interFoam 2>&1
26
+ if [ $? -ne 0 ]; then
27
+ echo "ERROR: interFoam failed"
28
+ exit 1
29
+ fi
30
+
31
+ echo "=== rising_bubble: reconstructPar ==="
32
+ reconstructPar > log.reconstructPar 2>&1
33
+ else
34
+ echo "=== rising_bubble: interFoam (serial) ==="
35
+ interFoam > log.interFoam 2>&1
36
+ if [ $? -ne 0 ]; then
37
+ echo "ERROR: interFoam failed"
38
+ exit 1
39
+ fi
40
+ fi
41
+
42
+ echo "=== rising_bubble 完成 ==="
templates/rising_bubble/base/constant/g ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class uniformDimensionedVectorField;
6
+ object g;
7
+ }
8
+
9
+ dimensions [0 1 -2 0 0 0 0];
10
+ value (0 -0.98 0);
11
+ // Hysing 无量纲 g*=-0.98; 有量纲值 g = g* × U_ref^2 / L_ref
12
+ // = -0.98 × 1^2 / 1 = -0.98 m/s^2
templates/rising_bubble/base/constant/transportProperties ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object transportProperties;
7
+ }
8
+
9
+ // 浮力气泡算例物性参数
10
+ // 参考: Hysing, S. et al. (2009). "Quantitative benchmark computations
11
+ // of two-dimensional bubble dynamics." Int. J. Numer. Meth. Fluids,
12
+ // 60(11), 1259-1288.
13
+ //
14
+ // Hysing Case 1 (低变形): 密度比 10:1, 粘度比 10:1
15
+ // 无量纲参数: Re=35, Eo=10
16
+ // Mo = g·μ₁⁴·Δρ/(ρ₁·σ³) ≈ 0.60(Clift 定义;不同 Mo 定义数值差异可达 15x)
17
+ // Eo 定义: Eo = ρ1 * g * D² / σ (Hysing 原文用 ρ1 而非 Δρ)
18
+ // 有量纲参数基于 L_ref=1m, U_ref=1m/s 换算
19
+
20
+ phases (water air);
21
+
22
+ water
23
+ {
24
+ transportModel Newtonian;
25
+ nu 0.01; // 运动粘度 [m^2/s] (μ=10 Pa·s, Hysing Case 1)
26
+ rho 1000; // 密度 [kg/m^3]
27
+ }
28
+
29
+ air
30
+ {
31
+ transportModel Newtonian;
32
+ nu 0.01; // 运动粘度 [m^2/s] (μ=1 Pa·s, ρ=100 kg/m³)
33
+ rho 100; // 密度 [kg/m^3] (密度比 10:1)
34
+ }
35
+
36
+ sigma 24.5; // 表面张力系数 [N/m]
37
+ // Hysing Case 1: Eo = ρ1 × g × D² / σ = 10
38
+ // σ = ρ1 × g × D² / Eo = 1000 × 0.98 × 0.25 / 10 = 24.5 N/m (D=2R=0.5, D²=0.25)
templates/rising_bubble/base/constant/turbulenceProperties ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object turbulenceProperties;
7
+ }
8
+
9
+ simulationType laminar;
templates/rising_bubble/base/system/blockMeshDict ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object blockMeshDict;
7
+ }
8
+
9
+ // 浮力气泡算例 — Hysing et al. (2009) Case 1
10
+ // 参考: Hysing, S. et al. (2009). "Quantitative benchmark computations
11
+ // of two-dimensional bubble dynamics." Int. J. Numer. Meth. Fluids,
12
+ // 60(11), 1259-1288.
13
+ // 域尺寸: 1m x 2m (X x Y), Z 方向单层(2D, empty 边界)
14
+ // 网格: 128 x 256
15
+
16
+ scale 1;
17
+
18
+ vertices
19
+ (
20
+ (0 0 0) // 0
21
+ (1 0 0) // 1
22
+ (1 2 0) // 2
23
+ (0 2 0) // 3
24
+ (0 0 0.001) // 4
25
+ (1 0 0.001) // 5
26
+ (1 2 0.001) // 6
27
+ (0 2 0.001) // 7
28
+ );
29
+
30
+ blocks
31
+ (
32
+ hex (0 1 2 3 4 5 6 7) (128 256 1) simpleGrading (1 1 1)
33
+ );
34
+
35
+ edges
36
+ (
37
+ );
38
+
39
+ boundary
40
+ (
41
+ leftWall
42
+ {
43
+ type wall;
44
+ faces ( (0 4 7 3) );
45
+ }
46
+
47
+ rightWall
48
+ {
49
+ type wall;
50
+ faces ( (1 2 6 5) );
51
+ }
52
+
53
+ lowerWall
54
+ {
55
+ type wall;
56
+ faces ( (0 1 5 4) );
57
+ }
58
+
59
+ upperWall
60
+ {
61
+ type wall;
62
+ faces ( (3 7 6 2) );
63
+ }
64
+
65
+ defaultFaces
66
+ {
67
+ type empty;
68
+ faces
69
+ (
70
+ (0 3 2 1)
71
+ (4 5 6 7)
72
+ );
73
+ }
74
+ );
templates/rising_bubble/base/system/controlDict ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object controlDict;
7
+ }
8
+
9
+ application interFoam;
10
+
11
+ startFrom startTime;
12
+ startTime 0;
13
+ stopAt endTime;
14
+ endTime 3.0; // 气泡上升物理时长 [s](足够达到 terminal velocity)
15
+
16
+ deltaT 0.002; // 初始时间步 [s](高粘度,需更小时间步)
17
+ writeControl adjustableRunTime;
18
+ writeInterval 0.12; // endTime/25 → 25 帧
19
+
20
+ purgeWrite 0;
21
+ writeFormat ascii; // ASCII 格式,便于后处理脚本读取
22
+ writePrecision 8;
23
+ timeFormat general;
24
+ timePrecision 6;
25
+
26
+ adjustTimeStep yes;
27
+ maxCo 0.5;
28
+ maxAlphaCo 0.5;
29
+ maxDeltaT 0.002;
30
+
31
+ functions {};
templates/rising_bubble/base/system/decomposeParDict ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object decomposeParDict;
7
+ }
8
+
9
+ numberOfSubdomains 4;
10
+
11
+ method hierarchical;
12
+
13
+ hierarchicalCoeffs
14
+ {
15
+ n (2 2 1);
16
+ delta 0.001;
17
+ order xyz;
18
+ }
templates/rising_bubble/base/system/fvSchemes ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FoamFile
2
+ {
3
+ version 2.0;
4
+ format ascii;
5
+ class dictionary;
6
+ object fvSchemes;
7
+ }
8
+
9
+ ddtSchemes
10
+ {
11
+ default Euler;
12
+ }
13
+
14
+ gradSchemes
15
+ {
16
+ default Gauss linear;
17
+ }
18
+
19
+ divSchemes
20
+ {
21
+ default none;
22
+
23
+ div(rhoPhi,U) Gauss linearUpwind grad(U);
24
+ div(phi,alpha) Gauss vanLeer;
25
+ div(phirb,alpha) Gauss interfaceCompression vanLeer;
26
+ div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear corrected;
27
+ }
28
+
29
+ laplacianSchemes
30
+ {
31
+ default Gauss linear corrected;
32
+ }
33
+
34
+ interpolationSchemes
35
+ {
36
+ default linear;
37
+ }
38
+
39
+ snGradSchemes
40
+ {
41
+ default uncorrected;
42
+ }
43
+
44
+ wallDist
45
+ {
46
+ method meshWave;
47
+ }