version 3.8
idealgas.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_IDEAL_GAS_HH
13#define DUMUX_IDEAL_GAS_HH
14
16
17namespace Dumux {
18
23template <class Scalar>
25{
26public:
28 static constexpr Scalar R = Constants<Scalar>::R;
29
37 static constexpr Scalar density(Scalar avgMolarMass,
38 Scalar temperature,
39 Scalar pressure)
40 { return molarDensity(temperature,pressure)*avgMolarMass;}
41
48 static constexpr Scalar pressure(Scalar temperature,
49 Scalar rhoMolar)
50 { return R*temperature*rhoMolar; }
51
58 static constexpr Scalar molarDensity(Scalar temperature,
59 Scalar pressure)
60 { return pressure/(R*temperature); }
61};
62} // end namespace
63
64#endif
A central place for various physical constants occurring in some equations.
Definition: constants.hh:27
Relations valid for an ideal gas.
Definition: idealgas.hh:25
static constexpr Scalar pressure(Scalar temperature, Scalar rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition: idealgas.hh:48
static constexpr Scalar R
The ideal gas constant .
Definition: idealgas.hh:28
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition: idealgas.hh:37
static constexpr Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of the gas , depending on pressure and temperature.
Definition: idealgas.hh:58
A central place for various physical constants occurring in some equations.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
Definition: adapt.hh:17