dimensionSets.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "dimensionSet.H"
27 #include "demandDrivenData.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
35 
36 // Delete the above data at the end of the run
38 {
40  {
42  }
43 };
44 
46 
47 }
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 const Foam::dimensionSet Foam::dimless(0, 0, 0, 0, 0, 0, 0);
52 
53 const Foam::dimensionSet Foam::dimMass(1, 0, 0, 0, 0, 0, 0);
54 const Foam::dimensionSet Foam::dimLength(0, 1, 0, 0, 0, 0, 0);
55 const Foam::dimensionSet Foam::dimTime(0, 0, 1, 0, 0, 0, 0);
56 const Foam::dimensionSet Foam::dimTemperature(0, 0, 0, 1, 0, 0, 0);
57 const Foam::dimensionSet Foam::dimMoles(0, 0, 0, 0, 1, 0, 0);
58 const Foam::dimensionSet Foam::dimCurrent(0, 0, 0, 0, 0, 1, 0);
59 const Foam::dimensionSet Foam::dimLuminousIntensity(0, 0, 0, 0, 0, 0, 1);
60 
63 
65 
69 
74 
82 (
84 );
86 (
88 );
89 
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
97 {
98  static const NamedEnum<dimensionSet::dimensionType, 7>& names =
99  dimensionSet::dimensionTypeNames_;
100 
101  if (!dimensionsPtr_)
102  {
104 
105  dimensionsPtr_->insert(names[dimensionSet::MASS], dimMass);
106  dimensionsPtr_->insert(names[dimensionSet::LENGTH], dimLength);
107  dimensionsPtr_->insert(names[dimensionSet::TIME], dimTime);
108  dimensionsPtr_->insert
109  (
110  names[dimensionSet::TEMPERATURE],
112  );
113  dimensionsPtr_->insert(names[dimensionSet::MOLES], dimMoles);
114  dimensionsPtr_->insert(names[dimensionSet::CURRENT], dimCurrent);
115  dimensionsPtr_->insert
116  (
117  names[dimensionSet::LUMINOUS_INTENSITY],
119  );
120 
121  dimensionsPtr_->insert("area", dimArea);
122  dimensionsPtr_->insert("volume", dimVolume);
123 
124  dimensionsPtr_->insert("rate", dimRate);
125 
126  dimensionsPtr_->insert("velocity", dimVelocity);
127  dimensionsPtr_->insert("momentum", dimMomentum);
128  dimensionsPtr_->insert("acceleration", dimAcceleration);
129 
130  dimensionsPtr_->insert("density", dimDensity);
131  dimensionsPtr_->insert("force", dimForce);
132  dimensionsPtr_->insert("energy", dimEnergy);
133  dimensionsPtr_->insert("power", dimPower);
134 
135  dimensionsPtr_->insert("pressure", dimPressure);
136  dimensionsPtr_->insert("kinematicPressure", dimKinematicPressure);
137  dimensionsPtr_->insert("compressibility", dimCompressibility);
138  dimensionsPtr_->insert("gasConstant", dimGasConstant);
139  dimensionsPtr_->insert("specificHeatCapacity", dimSpecificHeatCapacity);
140  dimensionsPtr_->insert("kinematicViscosity", dimKinematicViscosity);
141  dimensionsPtr_->insert("dynamicViscosity", dimDynamicViscosity);
142  dimensionsPtr_->insert("thermalConductivity", dimThermalConductivity);
143 
144  dimensionsPtr_->insert("volumetricFlux", dimVolumetricFlux);
145  dimensionsPtr_->insert("massFlux", dimMassFlux);
146  }
147 
148  return *dimensionsPtr_;
149 }
150 
151 
152 // ************************************************************************* //
An STL-conforming hash table.
Definition: HashTable.H:127
Initialise the NamedEnum HashTable from the static list of names.
Definition: NamedEnum.H:54
Dimension set for the base types.
Definition: dimensionSet.H:125
Template functions to aid in the implementation of demand driven data.
Namespace for OpenFOAM.
const dimensionSet dimDynamicViscosity
const dimensionSet dimEnergy
const dimensionSet dimCurrent
const dimensionSet dimPressure
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimKinematicPressure
const HashTable< dimensionSet > & dimensions()
Get the table of dimension sets.
Definition: dimensionSets.C:96
dimensionedScalar pow3(const dimensionedScalar &ds)
const dimensionSet dimKinematicViscosity
const dimensionSet dimMassFlux
deleteDimensionsPtr deleteDimensionsPtr_
Definition: dimensionSets.C:45
const dimensionSet dimPower
const dimensionSet dimVolumetricFlux
const dimensionSet dimRate
void deleteDemandDrivenData(DataType *&dataPtr)
const dimensionSet dimGasConstant
const dimensionSet dimless
const dimensionSet dimLength
const dimensionSet dimTemperature
const dimensionSet dimAcceleration
const dimensionSet dimForce
const dimensionSet dimCompressibility
const dimensionSet dimSpecificHeatCapacity
const dimensionSet dimMomentum
const dimensionSet dimTime
HashTable< dimensionSet > * dimensionsPtr_(nullptr)
const dimensionSet dimDensity
const dimensionSet dimVolume
const dimensionSet dimMoles
const dimensionSet dimLuminousIntensity
const dimensionSet dimMass
const dimensionSet dimVelocity
const dimensionSet dimArea
const dimensionSet dimThermalConductivity