Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
dimensionality.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2022-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_dimensionality_h
5#define lethe_dimensionality_h
6
7#include <deal.II/base/parameter_handler.h>
8
9using namespace dealii;
10
11namespace Parameters
12{
13 /**
14 * @brief Class used to rescale physical properties for cases where the main dimensions
15 * of the problems (Length, Mass, Time and Temperature) are not expressed in
16 * SI, but are expressed in another set of units. For example, this can be
17 * used to carry out a simulation where the mesh is expressed in millimeters
18 * instead of meters. This class is currently only used to rescale the
19 * physical properties in the FEM-based physics (e.g. all of those that are
20 * solvers). Support for DEM, CFD-DEM and rescaling of boundary conditions is
21 * planned in the midterm.
22 */
24 {
25 public:
26 /**
27 * @brief
28 * Default constructor that assumes that the units used in the simulation
29 * are consistent.
30 */
32 : length(1)
33 , mass(1)
34 , time(1)
35 , temperature(1)
37 {
39 }
40
41 /**
42 * @brief
43 * Defines all the sub-scales that are relevant to simulations. This is used
44 * to define scaling laws for kinematic viscosity or other quantities which
45 * appear multiple times in the simulation. This prevents the recalculation
46 * of these scales (and thus, human errors).
47 */
48 void
50
51 /**
52 * @brief
53 * Declare the fundamental dimensions of the parameter file
54 *
55 * @param[in,out] prm The parameter handler object
56 */
57 static void
58 declare_parameters(ParameterHandler &prm);
59
60 /**
61 * @brief
62 * Parses the fundamental dimensions from the parameter file
63 *
64 * @param[in] prm The parameter handler object
65 */
66 void
67 parse_parameters(ParameterHandler &prm);
68
69 /*
70 * Fundamental dimensions. These are the dimensions that are read from the
71 * parameter file
72 */
73 double length;
74 double mass;
75 double time;
78
79 /*
80 * Scaling laws. These are constants that are used to rescale quantities
81 * arising frequently. Some of these quantities are not trivial to calculate
82 * (e.g. thermal conductivity). Thus, it is better to pre-calculate these
83 * scalings and to reuse them instead of calculating them on the fly
84 * everywhere.
85 */
103 };
104} // namespace Parameters
105
106#endif
Dimensionality()
Default constructor that assumes that the units used in the simulation are consistent.
static void declare_parameters(ParameterHandler &prm)
Declare the fundamental dimensions of the parameter file.
void parse_parameters(ParameterHandler &prm)
Parses the fundamental dimensions from the parameter file.
void define_all_scales()
Defines all the sub-scales that are relevant to simulations. This is used to define scaling laws for ...