Skip to content

Commit

Permalink
Minor corrections to turbulent taylor couette example (#1377)
Browse files Browse the repository at this point in the history
Description
Default variables were removed from prm file and the linear solver parameters were simplified. The results remain the same. Since the example is pretty recent only minor corrections were done in the documentation page.
  • Loading branch information
lpsaavedra authored Nov 21, 2024
1 parent e74a763 commit a3b15e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The inner cylinder rotates counterclockwise at a constant angular velocity :math
:name: geometry
:height: 6cm

The initial conditions for velocity and pressure are defined as follow:
The initial conditions for velocity and pressure are defined as follows:

.. math::
u_{\theta} &= Ar + \frac{B}{r} + \epsilon U\sin(\theta) \sin \left( \frac{(r-r_i)\pi}{r_i} \right) \sin \left( \frac{z}{d} \right) \\
Expand Down Expand Up @@ -185,7 +185,7 @@ The ``initial conditions`` subsection lets us set-up the velocity and pressure o
end
end
The ``type`` is set to ``nodal`` (as per now, ``lethe-fluid-matrix-free`` solver only lets us use this option). Then we choose the ``uvwp subsection`` which allows us to respectively set the :math:`u_x;u_y;u_z;p` expressions under the ``function expression``. Switching from cylindrical to Cartesian coordinates results in a quite complex expression. To help with that matter, we use the ``Function constant``.
The ``type`` is set to ``nodal``. Then we choose the ``uvwp subsection`` which allows us to respectively set the :math:`u_x;u_y;u_z;p` expressions under the ``function expression``. Switching from cylindrical to Cartesian coordinates results in a quite complex expression. To help with that matter, we use the ``Function constant``.

FEM Interpolation
~~~~~~~~~~~~~~~~~
Expand All @@ -207,8 +207,7 @@ The ``forces`` subsection controls the postprocessing of the torque and the forc
.. code-block:: text
subsection forces
set verbosity = quiet # Output force and torques in log <quiet|verbose>
set calculate torque = true # Enable torque calculation
set calculate torque = true
end
By setting ``calculate torque = true``, the calculation of the torque resulting from the fluid dynamics physics on every boundary of the domain is automatically calculated. Setting ``verbosity = quiet`` will disable the print out on the terminal for each time step.
Expand All @@ -220,16 +219,8 @@ Post-processing
.. code-block:: text
subsection post-processing
set verbosity = quiet
set output frequency = 1
# Kinetic energy calculation
set calculate kinetic energy = true
set kinetic energy name = kinetic_energy
# Enstrophy calculation
set calculate enstrophy = true
set enstrophy name = enstrophy
set calculate kinetic energy = true
set calculate enstrophy = true
end
To monitor the kinetic energy and the enstrophy, we set calculation to ``true`` in the post-processing section.
Expand Down Expand Up @@ -258,7 +249,7 @@ The ``simulation control`` subsection controls the flow of the simulation. To ma
Other Subsections
~~~~~~~~~~~~~~~~~~~~~~~~

The ``non-linear solver`` and ``linear solver`` subsections use the same parameters as the `Taylor-Green Vortex <https://chaos-polymtl.github.io/lethe/documentation/examples/incompressible-flow/3d-taylor-green-vortex/3d-taylor-green-vortex.html>`_ example. More details can be found in this example and a complete overview of the ``lethe-fluid-matrix-free`` linear solver can be found in the **Theory Guide** (under construction).
The ``non-linear solver`` and ``linear solver`` subsections use the same parameters as the `Taylor-Green Vortex <https://chaos-polymtl.github.io/lethe/documentation/examples/incompressible-flow/3d-taylor-green-vortex/3d-taylor-green-vortex.html>`_ example. More details can be found in this example and a complete overview of the ``lethe-fluid-matrix-free`` linear solver can be found in the the :doc:`../../../parameters/cfd/linear_solver_control` section.

----------------------
Running the Simulation
Expand All @@ -271,6 +262,8 @@ Launching the simulation is as simple as specifying the executable name and the
mpirun -np n_proc lethe-fluid-matrix-free tc-matrix-free.prm
and choosing the number of processes ``n_proc`` according to the resources you have available.

----------------------
Results and Discussion
----------------------
Expand All @@ -284,12 +277,12 @@ The flow patterns generated by the Taylor-Couette flow are quite complex. The fo
| |
+----------------------------------------------------------------------------------------------------------------------------------------------------+

Using the ``enstrophy.dat`` file generated by Lethe, the history of enstrophy can be monitored and compared to the reference values extracted from the case study. Assuming that the file is in the same directory as the post-processing scripts, a plot comparing our simulation results to the reference enstrophy data will be generated by using the following command:
Using the ``enstrophy.dat`` file generated by Lethe, the history of enstrophy can be monitored and compared to the reference values extracted from the case study. A plot comparing our simulation results to the reference enstrophy data will be generated by using the following command:

.. code-block:: text
:class: copy-button
python3 tc_postprocessing.py
python3 tc_postprocessing.py -ens output/enstrophy.dat
The enstrophy plot features a zoomed section of the enstrophy cascade. The following plot shows the history of the enstrophy as measured with the Q2 scheme:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ end
#---------------------------------------------------
# Source term
#---------------------------------------------------

subsection source term
subsection fluid dynamics
set enable = false
set enable = false
end
end

Expand All @@ -71,8 +72,7 @@ end
#---------------------------------------------------

subsection forces
set verbosity = quiet # Output force and torques in log <quiet|verbose>
set calculate torque = true # Enable torque calculation
set calculate torque = true
end

#---------------------------------------------------
Expand All @@ -89,11 +89,8 @@ end
#---------------------------------------------------

subsection post-processing
# Kinetic energy calculation
set calculate kinetic energy = true

# Enstrophy calculation
set calculate enstrophy = true
set calculate enstrophy = true
end

#---------------------------------------------------
Expand Down Expand Up @@ -159,28 +156,20 @@ subsection linear solver
set verbosity = verbose

# MG parameters
set mg verbosity = quiet
set mg min level = -1
set mg level min cells = 16
set mg verbosity = verbose
set mg enable hessians in jacobian = false

# Smoother
set mg smoother iterations = 10
set mg smoother eig estimation = true
set mg smoother iterations = 5
set mg smoother eig estimation = true
set mg smoother preconditioner type = inverse diagonal

# Eigenvalue estimation parameters
set eig estimation smoothing range = 5
set eig estimation cg n iterations = 20
set eig estimation verbosity = verbose

# Coarse-grid solver
set mg coarse grid solver = gmres
set mg gmres max iterations = 2000
set mg gmres tolerance = 1e-7
set mg gmres reduce = 1e-4
set mg gmres max krylov vectors = 30
set mg gmres preconditioner = ilu
set ilu preconditioner fill = 1
set ilu preconditioner absolute tolerance = 1e-10
set ilu preconditioner relative tolerance = 1.00
set eig estimation verbosity = quiet

#coarse-grid solver
set mg coarse grid solver = direct
end
end

0 comments on commit a3b15e8

Please sign in to comment.