Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
dimensionality.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2022, 2024, 2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
5
6using namespace dealii;
7namespace Parameters
8{
9 void
11 {
12 // Define fundamental quantities using Wikipedia's notation
13 const double L = length;
14 const double M = mass;
15 const double theta = temperature;
16 const double T = time;
17 const double I = electric_current;
18
19 density_scaling = 1. * L * L * L / M;
20 specific_gas_constant_scaling = 1. / L / L * T * T * theta;
21 viscosity_scaling = 1. / L / L * T;
22 specific_heat_scaling = 1. / L / L * T * T * theta;
23 thermal_conductivity_scaling = 1. / M / L * T * T * T * theta;
24 enthalpy_scaling = 1. / M / L / L * T * T;
25 diffusivity_scaling = 1. / L / L * T;
26 thermal_expansion_scaling = 1. * theta;
27 surface_tension_scaling = 1. * T * T / M;
28 surface_tension_gradient_scaling = 1. * theta * T * T / M;
29 cahn_hilliard_mobility_scaling = 1. * M / L / L / L / T;
32 1. * L /
33 299792458.0; // speed of light in m/s to get the frequency scaling
34 // to match the other electromagnetic properties. It is not
35 // necessary to rescale by time because in the time harmonic
36 // form the time scale cancels out as the solution is
37 // independent of it.
38 electric_amplitude_scaling = 1 * I * T * T * T / M / L;
40 vacuum_permittivity_scaling = 1 * M * L * L * L / I / I / T / T / T / T;
41 vacuum_permeability_scaling = 1 * T * T * I * I / M / L;
42 }
43
44 void
46 {
47 prm.enter_subsection("dimensionality");
48 {
49 prm.declare_entry(
50 "length",
51 "1",
52 Patterns::Double(),
53 "Length scale. The default value assumed is meters. If the simulation is carried out in centimeters,"
54 " a length of 0.01 should be specified. If the simulation is carried out in kilometers, a length of 1000 should be specified.");
55
56 prm.declare_entry(
57 "time",
58 "1",
59 Patterns::Double(),
60 "Time scale. The default value assumed is seconds. If the simulation is carried out in milliseconds,"
61 " a time of 0.001 should be specified.");
62
63 prm.declare_entry(
64 "mass",
65 "1",
66 Patterns::Double(),
67 "Mass scale. The default value assumed is kilograms. If the simulation is carried out in grams,"
68 " a mass of 0.001 should be specified.");
69
70 prm.declare_entry(
71 "temperature",
72 "1",
73 Patterns::Double(),
74 "Temperature scale. The default value assumed is Kelvin. If the simulation is carried out in kiloKelvin,"
75 " a temperature of 1000 should be specified.");
76
77 prm.declare_entry(
78 "electric current",
79 "1",
80 Patterns::Double(),
81 "Electric current scale. The default value assumed is Amperes. If the simulation is carried out in milliamperes,"
82 " an electric current of 0.001 should be specified.");
83 }
84 prm.leave_subsection();
85 }
86
87
88 void
89 Dimensionality::parse_parameters(ParameterHandler &prm)
90 {
91 prm.enter_subsection("dimensionality");
92 {
93 length = prm.get_double("length");
94 time = prm.get_double("time");
95 mass = prm.get_double("mass");
96 temperature = prm.get_double("temperature");
97 electric_current = prm.get_double("electric current");
98 }
99 prm.leave_subsection();
100
101 // Define all scales using these dimensions
103 }
104} // namespace Parameters
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 ...