/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/constants.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/constants.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
constants.H
Go to the documentation of this file.
1#ifndef CONSTANTS_H
2#define CONSTANTS_H
3
4#include "AMReX_REAL.H"
5#include "AMReX_Math.H"
6#include "AMReX_GpuQualifiers.H"
7
8using namespace amrex::literals;
9
11
13static constexpr amrex::Real EPS =
14 static_cast<amrex::Real>(std::numeric_limits<amrex::Real>::epsilon());
15
17static constexpr amrex::Real TIGHT_TOL =
18 std::numeric_limits<amrex::Real>::epsilon() * 1.0e3_rt;
19
21static constexpr amrex::Real LOOSE_TOL =
22 std::numeric_limits<amrex::Real>::epsilon() * 1.0e8_rt;
23
25static constexpr amrex::Real LOW_NUM = static_cast<amrex::Real>(
26 std::numeric_limits<amrex::Real>::lowest() * 1.0e-10_rt);
27
29static constexpr amrex::Real LARGE_NUM = static_cast<amrex::Real>(
30 std::numeric_limits<amrex::Real>::max() * 1.0e-10_rt);
31
33AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool
34is_close(const amrex::Real a, const amrex::Real b)
35{
36 return amrex::Math::abs(a - b) < EPS;
37}
38
40static constexpr amrex::Real BOLTZMANN_CONSTANT = 1.380649_rt * 1.0e-23_rt;
41
43static constexpr amrex::Real AVOGADRO_CONSTANT = 6.02214076_rt * 1.0e23_rt;
44
46static constexpr amrex::Real UNIVERSAL_GAS_CONSTANT =
48
50static constexpr amrex::Real HEAT_CAPACITY_RATIO = 1.4_rt;
51
53static constexpr amrex::Real MOLAR_MASS_AIR = 0.02896492_rt;
54
56static constexpr amrex::Real MOLAR_MASS_WATER_VAPOR = 0.01801528_rt;
57
58} // namespace amr_wind::constants
59#endif
Definition constants.H:10
static constexpr amrex::Real TIGHT_TOL
A tight tolerance.
Definition constants.H:17
static constexpr amrex::Real AVOGADRO_CONSTANT
Avogadro's constant (mol^-1)
Definition constants.H:43
static constexpr amrex::Real LOOSE_TOL
A loose tolerance.
Definition constants.H:21
static constexpr amrex::Real LOW_NUM
A large negative number.
Definition constants.H:25
static constexpr amrex::Real EPS
A number very close to zero.
Definition constants.H:13
static constexpr amrex::Real BOLTZMANN_CONSTANT
Boltzmann constant (J/K)
Definition constants.H:40
static constexpr amrex::Real HEAT_CAPACITY_RATIO
Heat capacity ratio.
Definition constants.H:50
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool is_close(const amrex::Real a, const amrex::Real b)
Closeness comparison.
Definition constants.H:34
static constexpr amrex::Real MOLAR_MASS_WATER_VAPOR
Molar mass of water vapor (kg/mol)
Definition constants.H:56
static constexpr amrex::Real LARGE_NUM
A large positive number.
Definition constants.H:29
static constexpr amrex::Real UNIVERSAL_GAS_CONSTANT
Universal gas constant (J/K mol)
Definition constants.H:46
static constexpr amrex::Real MOLAR_MASS_AIR
Molar mass of air (kg/mol)
Definition constants.H:53