-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtracer_formulation_2d.html
More file actions
212 lines (199 loc) · 14.5 KB
/
tracer_formulation_2d.html
File metadata and controls
212 lines (199 loc) · 14.5 KB
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
<!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>2D tracer formulation — Thetis 2025.10.1+1.gf513865b documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/thetis.css?v=0f3339d6" />
<script src="_static/documentation_options.js?v=b0987aea"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<!--[if lte IE 6]>
<link rel="stylesheet" href="_static/ie6.css" type="text/css" media="screen" charset="utf-8" />
<![endif]-->
<!-- <link rel="stylesheet" href="_static/featured.css"> -->
<link rel="shortcut icon" href="_static/icon_thetis.ico" />
</head><body>
<div class="wrapper">
<a href="index.html"><img src="_static/banner.jpg" height="180px" alt="Thetis Project Banner" /></a>
<div id="access">
<div class="menu">
<ul>
<li class="page_item"><a href="documentation.html" title="Thetis documentation">Documentation</a></li>
<li class="page_item"><a href="download.html" title="Install Thetis">Download</a></li>
<li class="page_item"><a href="team.html" title="Development team">Team</a></li>
<li class="page_item"><a href="publications.html" title="Publications">Publications</a></li>
<li class="page_item"><a href="funding.html" title="Our financial supporters">Funding</a></li>
<li class="page_item"><a href="contact.html" title="Getting in touch">Contact</a></li>
<li class="page_item"><a href="https://github.com/thetisproject/thetis" title="Thetis source on GitHub">GitHub</a></li>
</ul>
</div><!-- .menu -->
</div><!-- #access -->
</div><!-- #wrapper -->
<div class="document">
<div class="tracer_formulation_2d">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="d-tracer-formulation">
<h1>2D tracer formulation<a class="headerlink" href="#d-tracer-formulation" title="Link to this heading">¶</a></h1>
<section id="governing-equation">
<h2>Governing equation<a class="headerlink" href="#governing-equation" title="Link to this heading">¶</a></h2>
<p>The two dimensional tracer model solves an advection-diffusion
equation
<a class="reference internal" href="thetis.html#equation-tracer-eq-2d">(16)</a>.
If solved in non-conservative form, the prognostic variable
is the passive tracer concentration,
<span class="math notranslate nohighlight">\(T\)</span>. The corresponding field in Thetis is called
<code class="docutils literal notranslate"><span class="pre">'tracer_2d'</span></code>.</p>
<p>To activate the 2D tracer model, add tracers using the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.add_tracer_2d" title="thetis.options.ModelOptions2d.add_tracer_2d"><code class="xref py py-attr docutils literal notranslate"><span class="pre">add_tracer_2d</span></code></a>
method. An example of its usage is provided in the
<a class="reference external" href="./demos/demo_2d_tracer.py.html">2D tracer demo</a>.</p>
<p>A conservative tracer model is also available, given by
<a class="reference internal" href="thetis.html#equation-cons-tracer-eq-2d">(17)</a>.
In this case, the equation is solved for <span class="math notranslate nohighlight">\(q=HT\)</span>, where
<span class="math notranslate nohighlight">\(H\)</span> is the total water depth.
The conservative tracer model is specified by setting the
<code class="docutils literal notranslate"><span class="pre">use_conservative_form</span></code> keyword argument of
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.add_tracer_2d" title="thetis.options.ModelOptions2d.add_tracer_2d"><code class="xref py py-attr docutils literal notranslate"><span class="pre">add_tracer_2d</span></code></a>
to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
<p>The tracer model may also be run independently
by setting the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.tracer_only" title="thetis.options.ModelOptions2d.tracer_only"><code class="xref py py-attr docutils literal notranslate"><span class="pre">tracer_only</span></code></a>
option to
<code class="docutils literal notranslate"><span class="pre">True</span></code>. The hydrodynamics will be defined by any initial
conditions specified for the horizontal velocity, or any updates
imposed by the user.</p>
</section>
<section id="spatial-discretization">
<h2>Spatial discretization<a class="headerlink" href="#spatial-discretization" title="Link to this heading">¶</a></h2>
<p>Thetis supports two different tracer finite element discretizations
and associated stabilization methods, summarised in the table below.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 32.6%" />
<col style="width: 19.6%" />
<col style="width: 15.2%" />
<col style="width: 32.6%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Element Family</p></th>
<th class="head"><p>Name</p></th>
<th class="head"><p>Space</p></th>
<th class="head"><p>Stabilization</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>DG</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">'dg'</span></code></p></td>
<td><p>P1DG</p></td>
<td><p>Lax-Friedrichs</p></td>
</tr>
<tr class="row-odd"><td><p>CG</p></td>
<td><p><code class="docutils literal notranslate"><span class="pre">'cg'</span></code></p></td>
<td><p>P1</p></td>
<td><p>SUPG</p></td>
</tr>
</tbody>
</table>
<p>Table 1. <em>Finite element families and stabilization methods.</em></p>
<p>The element family is set by the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.tracer_element_family" title="thetis.options.ModelOptions2d.tracer_element_family"><code class="xref py py-attr docutils literal notranslate"><span class="pre">tracer_element_family</span></code></a>
option. Polynomial degrees other than one are not currently supported.</p>
<p>Lax-Friedrichs stabilization is used by default and may be
controlled using the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.CommonModelOptions.use_lax_friedrichs_tracer" title="thetis.options.CommonModelOptions.use_lax_friedrichs_tracer"><code class="xref py py-attr docutils literal notranslate"><span class="pre">use_lax_friedrichs_tracer</span></code></a>
option. Note that it is only a valid choice for the <code class="docutils literal notranslate"><span class="pre">'dg'</span></code> element family.
The scaling parameter used by this scheme may be controlled using the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.CommonModelOptions.lax_friedrichs_tracer_scaling_factor" title="thetis.options.CommonModelOptions.lax_friedrichs_tracer_scaling_factor"><code class="xref py py-attr docutils literal notranslate"><span class="pre">lax_friedrichs_tracer_scaling_factor</span></code></a>
option.</p>
<p>If the <code class="docutils literal notranslate"><span class="pre">'cg'</span></code> element family is chosen, then SUPG stabilization is used by
default. It can be controlled using the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.use_supg_tracer" title="thetis.options.ModelOptions2d.use_supg_tracer"><code class="xref py py-attr docutils literal notranslate"><span class="pre">use_supg_tracer</span></code></a>
option. In that case, it is advisable to set characteristic velocities and
diffusivities for your problem using the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.CommonModelOptions.horizontal_velocity_scale" title="thetis.options.CommonModelOptions.horizontal_velocity_scale"><code class="xref py py-attr docutils literal notranslate"><span class="pre">horizontal_velocity_scale</span></code></a>
and
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.CommonModelOptions.horizontal_diffusivity_scale" title="thetis.options.CommonModelOptions.horizontal_diffusivity_scale"><code class="xref py py-attr docutils literal notranslate"><span class="pre">horizontal_diffusivity_scale</span></code></a>
options.</p>
</section>
<section id="temporal-discretization">
<h2>Temporal discretization<a class="headerlink" href="#temporal-discretization" title="Link to this heading">¶</a></h2>
<p>Thetis supports different time integration methods, set by the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.tracer_timestepper_type" title="thetis.options.ModelOptions2d.tracer_timestepper_type"><code class="xref py py-attr docutils literal notranslate"><span class="pre">tracer_timestepper_type</span></code></a> option.
Use the
<a class="reference internal" href="model_options_2d.html#model-options-2d"><span class="std std-ref">ModelOptions2d</span></a>.<a class="reference internal" href="thetis.html#thetis.options.ModelOptions2d.set_timestepper_type" title="thetis.options.ModelOptions2d.set_timestepper_type"><code class="xref py py-attr docutils literal notranslate"><span class="pre">set_timestepper_type</span></code></a>
method to set the same timestepper for all 2D model components.</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 19.6%" />
<col style="width: 27.5%" />
<col style="width: 21.6%" />
<col style="width: 31.4%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Time integrator</p></th>
<th class="head"><p>Thetis class</p></th>
<th class="head"><p>Unconditionally stable</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'ForwardEuler'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.timeintegrator.ForwardEuler" title="thetis.timeintegrator.ForwardEuler"><code class="xref py py-class docutils literal notranslate"><span class="pre">ForwardEuler</span></code></a></p></td>
<td><p>No</p></td>
<td><p>Forward Euler method</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">'BackwardEuler'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.rungekutta.BackwardEuler" title="thetis.rungekutta.BackwardEuler"><code class="xref py py-class docutils literal notranslate"><span class="pre">BackwardEuler</span></code></a></p></td>
<td><p>Yes</p></td>
<td><p>Backward Euler method</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'CrankNicolson'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.timeintegrator.CrankNicolson" title="thetis.timeintegrator.CrankNicolson"><code class="xref py py-class docutils literal notranslate"><span class="pre">CrankNicolson</span></code></a></p></td>
<td><p>Yes</p></td>
<td><p>Crank-Nicolson method</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">'DIRK22'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.rungekutta.DIRK22" title="thetis.rungekutta.DIRK22"><code class="xref py py-class docutils literal notranslate"><span class="pre">DIRK22</span></code></a></p></td>
<td><p>Yes</p></td>
<td><p>DIRK(2,3,2) method</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'DIRK33'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.rungekutta.DIRK33" title="thetis.rungekutta.DIRK33"><code class="xref py py-class docutils literal notranslate"><span class="pre">DIRK33</span></code></a></p></td>
<td><p>Yes</p></td>
<td><p>DIRK(3,4,3) method</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">'SSPRK33'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.rungekutta.SSPRK33" title="thetis.rungekutta.SSPRK33"><code class="xref py py-class docutils literal notranslate"><span class="pre">SSPRK33</span></code></a></p></td>
<td><p>No</p></td>
<td><p>SSPRK(3,3) method</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">'SteadyState'</span></code></p></td>
<td><p><a class="reference internal" href="thetis.html#thetis.timeintegrator.SteadyState" title="thetis.timeintegrator.SteadyState"><code class="xref py py-class docutils literal notranslate"><span class="pre">SteadyState</span></code></a></p></td>
<td><p>–</p></td>
<td><p>Solves equations in steady state</p></td>
</tr>
</tbody>
</table>
<p>Table 2. <em>Time integration methods for 2D tracer model.</em></p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer" role="contentinfo">
© Copyright 2016-2025, Tuomas Kärnä et al..
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
</div>
</body>
</html>