Skip to content

Commit abcc2c3

Browse files
Add files via upload
1 parent c4a35d9 commit abcc2c3

25 files changed

+1045
-996
lines changed

Accuracy.txt

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,98 @@ Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
3636
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
3737
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
3838
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
39-
Cnoidal 5th order theory with Aitken convergence enhancement 6 0.3000 8.000 0.243 44 0.15877
39+
Cnoidal 5th order theory with Aitken convergence enhancement 6 0.3000 8.000 0.243 44 0.15877
40+
7-order Stokes theory 7 0.3000 8.000 1.#IO 147 -1.#IND0
41+
7-order Stokes theory 7 0.3000 8.000 1.#IO 147 -1.#IND0
42+
5-order Stokes theory 5 0.3000 8.000 1.#IO 147 -1.#IND0
43+
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
44+
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
45+
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
46+
7-order Stokes theory 7 0.3000 8.000 1.#IO 147 -1.#IND0
47+
5-order Stokes theory 5 0.3000 8.000 1.#IO 147 -1.#IND0
48+
7-order Stokes theory 7 0.3000 8.000 1.#IO 147 -1.#IND0
49+
7-order Stokes theory 7 0.3000 8.000 1.#IO 147 -1.#IND0
50+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.00000
51+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
52+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.00000
53+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
54+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
55+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
56+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
57+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
58+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
59+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
60+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
61+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
62+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
63+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
64+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
65+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
66+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
67+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
68+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
69+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.00000
70+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.00000
71+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
72+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
73+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
74+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.14865
75+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
76+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
77+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
78+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
79+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
80+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
81+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
82+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
83+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
84+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
85+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
86+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
87+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
88+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
89+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
90+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
91+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
92+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
93+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
94+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
95+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
96+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
97+
7-order Stokes theory 7 0.3000 8.000 0.000 147 -1.#IND0
98+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
99+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
100+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
101+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
102+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
103+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
104+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
105+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
106+
7-order Stokes theory 7 0.3000 8.000 inf inf nan
107+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
108+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
109+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
110+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
111+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
112+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
113+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
114+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
115+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
116+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
117+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
118+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
119+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
120+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
121+
Cnoidal 5th order theory with Aitken convergence enhancement 6 0.3000 8.000 0.243 44 0.15877
122+
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
123+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
124+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754
125+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
126+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
127+
Fourier method with 7 terms in series 7 0.3000 8.000 0.243 44 0.15830
128+
Fourier method with 20 terms in series 20 0.3000 8.000 0.243 44 0.15830
129+
Fourier method with 20 terms in series 20 0.4500 8.000 0.365 66 0.24542
130+
7-order Stokes theory 7 0.3000 8.000 0.243 44 0.15854
131+
7-order Stokes theory 7 0.4500 8.000 0.365 66 0.25072
132+
5-order Stokes theory 5 0.4500 8.000 0.365 66 0.23800
133+
5-order Stokes theory 5 0.3000 8.000 0.243 44 0.15754

Cnoidal.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
int main()
66
{
77
FentonInout<CnoidalClass> Inout(CnoidalSolution,(char *)"Data.dat",(char *)"Points.dat");
8-
Inout.Solve();
98
Inout.Output((char *)"Surface(Cnoidal).res",(char *)"Flowfield(Cnoidal).res",(char *)"Solution(Cnoidal).res",(char *)"Accuracy.txt");
109

1110
printf("\nTouch key to continue "); getch();

Data.dat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
Tsai's modification from Fenton 1985 Stokes paper with notional H/d and current (for Stokes and Fourier)
2-
0.3 H/d
1+
Tsai's modification from Fenton 1985 Stokes paper with notional H/d and current (for LtE paper)
2+
0.45 H/d
33
Wavelength Measure of length: "Wavelength" or "Period"
44
8 Value of that length: L/d or T(g/d)^1/2 respectively
55
1 Current criterion (1 or 2)
66
0.0 Current magnitude, (dimensionless) ubar/(gd)^1/2
7-
20 Number of Fourier components or Order of Stokes/cnoidal theory
8-
5 Number of height steps to reach H/d
7+
5 7 Number of Fourier components or Order of Stokes/cnoidal theory
8+
Number of height steps to reach H/d
99
FINISH
1010

1111

FentonInout.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ FentonInout<SolutionClass>::FentonInout(int modeltype,char* data_file,char* conv
8080

8181
monitor = stdout;
8282
assert(Read_data()==1);
83+
Solve();
8384
}
8485

8586
template<typename SolutionClass>
@@ -94,6 +95,7 @@ FentonInout<SolutionClass>::FentonInout(int modeltype,char* data_file,char* poin
9495

9596
monitor = stdout;
9697
assert(Read_data()==1);
98+
Solve();
9799
}
98100

99101
template<typename SolutionClass>
@@ -208,8 +210,7 @@ void FentonInout<SolutionClass>::Title_block(FILE* file)
208210
if ( ModelType==FourierSolution || ModelType==StokesSolution )
209211
{
210212
fprintf(file,"# %s", Title);
211-
fprintf(file,"\n\n# Height/Depth:%6.3f", SolutionObject.Get_z(2)
212-
/ SolutionObject.Get_z(1));
213+
fprintf(file,"\n\n# Height/Depth:%6.3f", SolutionObject.Get_z(2)/ SolutionObject.Get_z(1));
213214
fprintf(file," Length/Depth:%7.2f", 2*Fenton_pi/SolutionObject.Get_z(1));
214215
fprintf(file," Dimensionless Period T*sqrt(g/d):%7.2f", SolutionObject.Get_z(3)/sqrt(SolutionObject.Get_z(1)));
215216
// Highest wave - eqn (32) of Fenton (1990)
@@ -445,6 +446,7 @@ void FentonInout<SolutionClass>::Output(char* elevation_file,char* flowfield_fil
445446
{
446447
assert(false);
447448
}
449+
448450
}
449451

450452
#endif

FentonStokes.cbp

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Option output="./Stokes" prefix_auto="1" extension_auto="1" />
1212
<Option object_output="./obj" />
1313
<Option type="1" />
14-
<Option compiler="gcc" />
14+
<Option compiler="gnu_gcc_compiler_64" />
1515
<Compiler>
1616
<Add option="-O2" />
1717
</Compiler>
@@ -43,6 +43,18 @@
4343
<Add option="-s" />
4444
</Linker>
4545
</Target>
46+
<Target title="Stokes 5">
47+
<Option output="./Stokes5" prefix_auto="1" extension_auto="1" />
48+
<Option object_output="./obj" />
49+
<Option type="1" />
50+
<Option compiler="gnu_gcc_compiler_32" />
51+
<Compiler>
52+
<Add option="-O2" />
53+
</Compiler>
54+
<Linker>
55+
<Add option="-s" />
56+
</Linker>
57+
</Target>
4658
</Build>
4759
<Compiler>
4860
<Add option="-Wall" />
@@ -71,6 +83,9 @@
7183
<Unit filename="FentonSolve.h">
7284
<Option target="Fourier" />
7385
</Unit>
86+
<Unit filename="Figures(default).plt">
87+
<Option target="&lt;{~None~}&gt;" />
88+
</Unit>
7489
<Unit filename="Flowfield(Cnoidal).res">
7590
<Option target="&lt;{~None~}&gt;" />
7691
</Unit>
@@ -80,6 +95,9 @@
8095
<Unit filename="Flowfield(Stokes).res">
8196
<Option target="&lt;{~None~}&gt;" />
8297
</Unit>
98+
<Unit filename="Flowfield(Stokes5).res">
99+
<Option target="&lt;{~None~}&gt;" />
100+
</Unit>
83101
<Unit filename="Fourier.cpp">
84102
<Option target="Fourier" />
85103
</Unit>
@@ -89,6 +107,7 @@
89107
<Unit filename="FourierStokesData.h">
90108
<Option target="Stokes" />
91109
<Option target="Fourier" />
110+
<Option target="Stokes 5" />
92111
</Unit>
93112
<Unit filename="Points.dat">
94113
<Option target="&lt;{~None~}&gt;" />
@@ -102,11 +121,18 @@
102121
<Unit filename="Solution(Stokes).res">
103122
<Option target="&lt;{~None~}&gt;" />
104123
</Unit>
124+
<Unit filename="Solution(Stokes5).res">
125+
<Option target="&lt;{~None~}&gt;" />
126+
</Unit>
105127
<Unit filename="Stokes.cpp">
106128
<Option target="Stokes" />
107129
</Unit>
108130
<Unit filename="Stokes.h">
109131
<Option target="Stokes" />
132+
<Option target="Stokes 5" />
133+
</Unit>
134+
<Unit filename="Stokes5.cpp">
135+
<Option target="Stokes 5" />
110136
</Unit>
111137
<Unit filename="Surface(Cnoidal).res">
112138
<Option target="&lt;{~None~}&gt;" />
@@ -117,6 +143,9 @@
117143
<Unit filename="Surface(Stokes).res">
118144
<Option target="&lt;{~None~}&gt;" />
119145
</Unit>
146+
<Unit filename="Surface(Stokes5).res">
147+
<Option target="&lt;{~None~}&gt;" />
148+
</Unit>
120149
<Extensions>
121150
<code_completion />
122151
<debugger />

Figures(default).plt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#
2+
# Plot results using Gnuplot
3+
#
4+
5+
reset
6+
7+
Output=0
8+
9+
LW = 1
10+
set border lw 1.4
11+
12+
set style line 1 linecolor rgb "black" linewidth 2.000 pointtype 2 pointsize 2 pointinterval 0
13+
set style line 2 linecolor rgb "gray" linewidth 2.000 pointtype 2 pointsize 2 pointinterval 0
14+
set style line 3 linecolor rgb "gray" linewidth 2.000 pointtype 2 pointsize 0.8 pointinterval 5
15+
16+
Dir_FentonStokes = "D:/Dropbox/MyResearch/SymbolicStokesLagrange/FentonStokes/"
17+
Dir_Fourier = Dir_FentonStokes
18+
Dir_Stokes5 = Dir_FentonStokes
19+
Dir_Stokes7 = Dir_FentonStokes
20+
21+
set multiplot layout 3,1
22+
23+
#########################
24+
# Generic Surface profile
25+
#########################
26+
27+
set nokey
28+
set format x "%3.0f"
29+
set format y "%4.1f"
30+
if (Output==0) set xlabel "x/h"; set ylabel "y/h"
31+
if (Output>0) set xlabel "$x/d$" offset 0,-0.5; set ylabel "$\\dfrac{y}{d}$" offset -1
32+
set xtics nomirror
33+
set ytics 0, 0.5, 2
34+
#show ytics
35+
set yrange [0:1.6]
36+
set autoscale x
37+
if (Output >= 0)
38+
plot Dir_Fourier."Surface(Fourier).res" using 1:2 title "Fourier approximation" with lines ls 1,\
39+
Dir_Stokes5."Surface(Stokes5).res" using 1:2 title "Stokes theory 5" with lines ls 2,\
40+
Dir_Stokes7."Surface(Stokes).res" using 1:2 title "Stokes theory 7" with linespoints ls 3;\
41+
42+
43+
###############################
44+
# Generic Velocity profiles (u)
45+
###############################
46+
47+
#Xscale = 1; Yscale = 0.7
48+
49+
set nokey
50+
set format x "%5.2f"
51+
set format y "%4.1f"
52+
if (Output==0) set xlabel "u";
53+
if (Output>0) set xlabel "$(u)/\\sqrt{g d}$" offset 0,-0.5;
54+
set title ""
55+
if (Output >= 0)
56+
plot Dir_Fourier."Flowfield(Fourier).res" using 2:1 title "Fourier approximation" with lines ls 1,\
57+
Dir_Stokes5."Flowfield(Stokes5).res" using 2:1 title "Stokes theory 5" with lines ls 2,\
58+
Dir_Stokes7."Flowfield(Stokes).res" using 2:1 title "Stokes theory 7" with linespoints ls 3;\
59+
60+
###############################
61+
# Generic Velocity profiles (v)
62+
###############################
63+
64+
#Xscale = 1; Yscale = 0.7
65+
66+
set key top center reverse Left horizontal width +4
67+
set format x "%5.2f"
68+
set format y "%4.1f"
69+
if (Output==0) set xlabel "v";
70+
if (Output>0) set xlabel "$(v)/\\sqrt{g d}$" offset 0,-0.5;
71+
set title ""
72+
if (Output >= 0)
73+
plot Dir_Fourier."Flowfield(Fourier).res" using 3:1 title "Fourier approximation" with lines ls 1,\
74+
Dir_Stokes5."Flowfield(Stokes5).res" using 3:1 title "Stokes theory 5" with lines ls 2,\
75+
Dir_Stokes7."Flowfield(Stokes).res" using 3:1 title "Stokes theory 7" with linespoints ls 3;\
76+
77+
unset multiplot
78+
79+
pause -1 "multiplot"
80+
81+
unset output

Flowfield(Cnoidal).res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Tsai's modification from Fenton 1985 Stokes paper with notional H/d and current (for Stokes and FourWavelength
1+
// Tsai's modification from Fenton 1985 Stokes paper with notional H/d and current (for LtE paper)
22

33
# Cnoidal Theory - Cnoidal 5th order theory with Aitken convergence enhancement
44
# Velocity profiles

0 commit comments

Comments
 (0)