~fluidity-core/fluidity/remove_tictoc

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?xml version='1.0' encoding='utf-8'?>
<fluidity_options>
  <simulation_name>
    <string_value lines="1">MMS_E_cv</string_value>
  </simulation_name>
  <problem_type>
    <string_value lines="1">fluids</string_value>
  </problem_type>
  <geometry>
    <dimension>
      <integer_value rank="0">3</integer_value>
    </dimension>
    <mesh name="CoordinateMesh">
      <from_file file_name="MMS_E">
        <format name="gmsh"/>
        <stat>
          <include_in_stat/>
        </stat>
      </from_file>
    </mesh>
    <mesh name="VelocityMesh">
      <from_mesh>
        <mesh name="CoordinateMesh"/>
        <mesh_shape>
          <polynomial_degree>
            <integer_value rank="0">1</integer_value>
          </polynomial_degree>
        </mesh_shape>
        <stat>
          <exclude_from_stat/>
        </stat>
      </from_mesh>
    </mesh>
    <quadrature>
      <degree>
        <integer_value rank="0">5</integer_value>
      </degree>
      <controlvolume_surface_degree>
        <integer_value rank="0">5</integer_value>
      </controlvolume_surface_degree>
    </quadrature>
  </geometry>
  <io>
    <dump_format>
      <string_value>vtk</string_value>
    </dump_format>
    <dump_period>
      <constant>
        <real_value rank="0">1000.0</real_value>
      </constant>
    </dump_period>
    <output_mesh name="VelocityMesh"/>
    <stat/>
  </io>
  <timestepping>
    <current_time>
      <real_value rank="0">0.0</real_value>
    </current_time>
    <timestep>
      <real_value rank="0">0.00052280323880171751</real_value>
      <comment>0.00052280323880171751 gives a cv cfl number of 0.5</comment>
    </timestep>
    <finish_time>
      <real_value rank="0">5.0</real_value>
    </finish_time>
    <steady_state>
      <tolerance>
        <real_value rank="0">1.E-10</real_value>
        <infinity_norm/>
      </tolerance>
      <acceleration_form/>
    </steady_state>
  </timestepping>
  <material_phase name="Burgers">
    <vector_field name="Velocity" rank="1">
      <prescribed>
        <mesh name="VelocityMesh"/>
        <value name="WholeMesh">
          <python>
            <string_value lines="20" type="python">def val(XX, t):
   from math import sin,cos
   x = XX[0];
   y = XX[1];
   x2 = x*x;
   y2 = y*y;
   u = sin(5*(x2+y2));
   v = cos(3*(x2-y2));
   w = 0
   return (u, v, w)</string_value>
          </python>
        </value>
        <output/>
        <stat>
          <include_in_stat/>
        </stat>
        <detectors>
          <exclude_from_detectors/>
        </detectors>
      </prescribed>
    </vector_field>
    <scalar_field name="NumericalSolution" rank="0">
      <prognostic>
        <mesh name="VelocityMesh"/>
        <equation name="AdvectionDiffusion"/>
        <spatial_discretisation>
          <control_volumes>
            <mass_terms>
              <exclude_mass_terms/>
            </mass_terms>
            <face_value name="FirstOrderUpwind"/>
            <diffusion_scheme name="BassiRebay"/>
          </control_volumes>
          <conservative_advection>
            <real_value rank="0">0.0</real_value>
          </conservative_advection>
        </spatial_discretisation>
        <temporal_discretisation>
          <theta>
            <real_value rank="0">1.0</real_value>
          </theta>
        </temporal_discretisation>
        <solver>
          <iterative_method name="gmres">
            <restart>
              <integer_value rank="0">30</integer_value>
            </restart>
          </iterative_method>
          <preconditioner name="sor"/>
          <relative_error>
            <real_value rank="0">1.E-10</real_value>
          </relative_error>
          <max_iterations>
            <integer_value rank="0">350</integer_value>
          </max_iterations>
          <never_ignore_solver_failures/>
          <diagnostics>
            <monitors/>
          </diagnostics>
        </solver>
        <initial_condition name="WholeMesh">
          <constant>
            <real_value rank="0">0.0</real_value>
          </constant>
        </initial_condition>
        <boundary_conditions name="sides">
          <surface_ids>
            <integer_value shape="2" rank="1">7 10</integer_value>
          </surface_ids>
          <type name="dirichlet">
            <python>
              <string_value lines="20" type="python">def val(XX, t):
   from math import sin,cos,sqrt
   omega = 0.0;
   x = XX[0];
   y = XX[1];
   x4 = x*x*x*x;
   y2 = y*y;
   u = sin(25*x*y+omega*t)-2*y/(sqrt(x));
   return u</string_value>
            </python>
          </type>
        </boundary_conditions>
        <scalar_field name="Source" rank="0">
          <prescribed>
            <value name="WholeMesh">
              <python>
                <string_value lines="20" type="python">def val(XX, t):
   from math import sin,cos,sqrt
   omega = 0.0;
   x = XX[0];
   y = XX[1];
   x2 = x*x;
   y2 = y*y;
   xp5 = sqrt(x)
   x1p5 = xp5*x
   S = (25*y*cos(25*x*y) + 1.0*y/x1p5)*sin(5*(y2 + x2)) + (25*x*cos(25*x*y) - 2/xp5)*cos(3*(x2 - y2));
   return S</string_value>
              </python>
            </value>
            <output/>
            <stat/>
            <detectors>
              <exclude_from_detectors/>
            </detectors>
          </prescribed>
        </scalar_field>
        <output>
          <include_previous_time_step/>
        </output>
        <stat/>
        <convergence>
          <include_in_convergence/>
        </convergence>
        <detectors>
          <include_in_detectors/>
        </detectors>
        <steady_state>
          <include_in_steady_state/>
        </steady_state>
        <consistent_interpolation/>
      </prognostic>
    </scalar_field>
    <scalar_field name="AnalyticalSolution" rank="0">
      <prescribed>
        <mesh name="VelocityMesh"/>
        <value name="WholeMesh">
          <python>
            <string_value lines="20" type="python">def val(XX, t):
   from math import sin,cos,sqrt
   omega = 0.0;
   x = XX[0];
   y = XX[1];
   u = sin(25*x*y + omega*t) - 2*y/(sqrt(x));
   return u</string_value>
          </python>
        </value>
        <output/>
        <stat/>
        <detectors>
          <exclude_from_detectors/>
        </detectors>
      </prescribed>
    </scalar_field>
    <scalar_field name="AbsoluteDifference" rank="0">
      <diagnostic field_name_b="NumericalSolution" field_name_a="AnalyticalSolution">
        <algorithm name="Internal" material_phase_support="multiple"/>
        <mesh name="VelocityMesh"/>
        <output/>
        <stat>
          <include_cv_stats/>
        </stat>
        <convergence>
          <include_in_convergence/>
        </convergence>
        <detectors>
          <include_in_detectors/>
        </detectors>
        <steady_state>
          <include_in_steady_state/>
        </steady_state>
      </diagnostic>
    </scalar_field>
  </material_phase>
</fluidity_options>