Revisão | 727dc8134c56c86dcd2a03b18953211cd5fb1786 (tree) |
---|---|
Hora | 2006-12-30 10:36:13 |
Autor | iselllo |
Commiter | iselllo |
I modified the file secdml.f in directory CODESCH2/SECD of the diskette
folder by adding my own comments to the code.
@@ -5,6 +5,38 @@ | ||
5 | 5 | c IN this code a function appropriate for a mixing |
6 | 6 | c layer is used |
7 | 7 | c |
8 | + | |
9 | + | |
10 | +c ########################################################################## | |
11 | +c ########################################################################## | |
12 | +c ########################################################################## | |
13 | +C Now I add my own comments to the code. | |
14 | +c the array y(i) contains the physical grid (which is called x(csi) in the book | |
15 | +c by Orlandi. | |
16 | + | |
17 | +c in the code, dx=1/(delta csi) and dxq=1/(delta csi)^2, if one wants to use the | |
18 | +c notation by Orlandi. | |
19 | +c the grid coord csi is in the interval [0,1]. | |
20 | +c n1 is the total number of points I use to break up [0,1] into subintervals. | |
21 | +c n1m=n1-1 is the total number of subinterval I create this way, which means that | |
22 | +c delta csi=1/n1m. | |
23 | +c Basically, n1 is the parameter which determines the accuracy of the computational | |
24 | +c grid. | |
25 | + | |
26 | + | |
27 | +c in most of the cases, when saving data, one rules out the case corresponding to | |
28 | +c y(i)=0, which is the boundary and which requires a separate treatment. | |
29 | + | |
30 | +c finally, yprer is a particular value of y(i) for which some data are saved in the file | |
31 | +c accuracy.plo | |
32 | + | |
33 | + | |
34 | +c al end alfu correspond to alpha and alpha_u, respectively | |
35 | +c They play a role in the definition of the initial velocity profile and in the | |
36 | +c case of the transformation relating physical and computational coord. | |
37 | +c (see eqs. 2.19 and 2.24 in the book by Orlandi). | |
38 | + | |
39 | + | |
8 | 40 | include 'param.f' |
9 | 41 | character *60 namfile |
10 | 42 | write(6,*)'enter alfu, al, yprer' |
@@ -66,12 +98,19 @@ | ||
66 | 98 | er3=0. |
67 | 99 | endif |
68 | 100 | if(y(i).ge.0.) then |
69 | - write(16,794)csi,er1,er2,er3 | |
101 | + write(16,794)csi,er1,er2,er3 | |
102 | +c the previous write(16,794) writes to file number 16 i.e. to 'errdis'//npoi//'.plo' | |
103 | +c NB: the data are saved for y(i)>0 which means int turn csi>0.5 (see the book by Orlandi). | |
104 | + | |
70 | 105 | write(17,794)csi,sd1(i),sd2(i),sda(i) |
106 | +c this write(17,794) will write the data to file Fort.17 | |
71 | 107 | endif |
72 | 108 | if(y(i).ge.yprer.and.y(i-1).le.yprer) then |
73 | 109 | write(20,794) an1,er1,er2,er3 |
74 | 110 | endif |
111 | +c this write(20,794) writes the data to file accuracy.plo (actually, the condition | |
112 | +c required is verified at for a single i | |
113 | + | |
75 | 114 | 794 format(4x,6e12.5) |
76 | 115 | enddo |
77 | 116 | return |
@@ -118,6 +157,11 @@ | ||
118 | 157 | enddo |
119 | 158 | return |
120 | 159 | end |
160 | + | |
161 | + | |
162 | +c u(i) defined above is simply the initial velocity profile for a mixing layer | |
163 | +c (see eqs 2.19 in the book by Orlandi). | |
164 | + | |
121 | 165 | c |
122 | 166 | c |
123 | 167 | c ********************************************************** |
@@ -145,6 +189,10 @@ | ||
145 | 189 | write(9,110)csi,y(i) |
146 | 190 | 110 format(5e12.5) |
147 | 191 | enddo |
192 | + | |
193 | +c the array y(i) which has been defined above is simply the physical grid (see | |
194 | +c equation 2.24 in the book by Orlandi. Here (and in the book) h is taken to be | |
195 | +c 1 so it does not appear. | |
148 | 196 | c |
149 | 197 | do i=1,n1m |
150 | 198 | csi=(i-1+0.5)/float(n1m) |
@@ -159,6 +207,12 @@ | ||
159 | 207 | c |
160 | 208 | return |
161 | 209 | end |
210 | + | |
211 | +c dcay and dmay are simply the central and forward derivative (evaluated | |
212 | +c analytically) of the physical coord wrt the computational coord. | |
213 | +c The central derivative is evaluated at the computationa grid | |
214 | +c point csi, whereas the forward derivative is evaluated in between 2 grid points. | |
215 | + | |
162 | 216 | c |
163 | 217 | c *************************************************************** |
164 | 218 | c |
@@ -169,6 +223,14 @@ | ||
169 | 223 | c at the grid points dcy and at the mid points dmy |
170 | 224 | c ddcy is the second derivative of the physical coordinate |
171 | 225 | c |
226 | + | |
227 | + | |
228 | +c this routine simply works out the 1st and 2nd derivatives of the physical | |
229 | +c coord wrt the computational coord, but this time this is done numerically | |
230 | +c using finite-differences. dcy and dmy are the central and forward first deriva | |
231 | +c tive, respectively. ddcy is the 2nd derivative evaluated by means of the | |
232 | +c central differences. | |
233 | + | |
172 | 234 | include 'param.f' |
173 | 235 | do i=2,n1m |
174 | 236 | dcy(i)=(y(i+1)-y(i-1))*0.5*dx |
@@ -205,6 +267,9 @@ | ||
205 | 267 | sd3(i)=(aa3*u(i+1)+bb3*u(i)+cc3*u(i-1)) |
206 | 268 | write(63,*)i,sd1(i),sd2(i),sda(i) |
207 | 269 | enddo |
270 | +c this routine saves the data into files Fort.63 and Fort.64 | |
271 | + | |
272 | + | |
208 | 273 | c |
209 | 274 | c the solutions are written in a file together |
210 | 275 | c with the exact value |