ARTS 2.5.11 (git: 725533f0)
m_physics.cc
Go to the documentation of this file.
1
17/*===========================================================================
18 === External declarations
19 ===========================================================================*/
20
21#include "arts.h"
22#include "arts_constants.h"
23#include "auto_md.h"
24#include "check_input.h"
25#include "logic.h"
26#include "math_funcs.h"
27#include "messages.h"
28#include "physics_funcs.h"
29
30inline constexpr Numeric TEMP_0_C=Constant::temperature_at_0c;
32
33/*===========================================================================
34 === The functions (in alphabetical order)
35 ===========================================================================*/
36
37/* Workspace method: Doxygen documentation will be auto-generated */
38void MatrixCBR( // WS Output:
39 Matrix& m,
40 // WS Input:
41 const Index& stokes_dim,
42 // WS Generic Input:
43 const Vector& f,
44 const Verbosity&) {
45 const Index n = f.nelem();
46
47 if (n == 0) throw runtime_error("The given frequency vector is empty.");
48
49 m.resize(n, stokes_dim);
50 m = 0;
51
52 planck(m(joker, 0), f, COSMIC_BG_TEMP);
53}
54
55/* Workspace method: Doxygen documentation will be auto-generated */
56void MatrixPlanck( // WS Output:
57 Matrix& m,
58 // WS Input:
59 const Index& stokes_dim,
60 // WS Generic Input:
61 const Vector& f,
62 const Numeric& t,
63 const Verbosity& verbosity) {
65
66 const Index n = f.nelem();
67
68 if (n == 0) throw runtime_error("The given frequency vector is empty.");
69
70 out2 << " Setting blackbody radiation for a temperature of " << t << " K.\n";
71
72 m.resize(n, stokes_dim);
73 m = 0;
74
75 planck(m(joker, 0), f, t);
76}
77
78/* Workspace method: Doxygen documentation will be auto-generated */
79void MatrixUnitIntensity( // WS Output:
80 Matrix& m,
81 // WS Input:
82 const Index& stokes_dim,
83 // WS Generic Input:
84 const Vector& f,
85 const Verbosity& verbosity) {
87
88 const Index n = f.nelem();
89
90 if (n == 0) throw runtime_error("The given frequency vector is empty.");
91
92 out2 << " Setting unpolarised radiation with an intensity of 1.\n";
93
94 m.resize(n, stokes_dim);
95 m = 0;
96
97 for (Index i = 0; i < n; i++) {
98 m(i, 0) = 1.0;
99 }
100}
101
102/* Workspace method: Doxygen documentation will be auto-generated */
103void water_p_eq_fieldMK05(Tensor3& water_p_eq_field,
104 const Tensor3& t_field,
105 const Index& only_liquid,
106 const Verbosity&) {
107 const Index n1 = t_field.npages();
108 const Index n2 = t_field.nrows();
109 const Index n3 = t_field.ncols();
110
111 water_p_eq_field.resize(n1, n2, n3);
112
113 for (Index i = 0; i < n1; i++) {
114 for (Index j = 0; j < n2; j++) {
115 for (Index k = 0; k < n3; k++) {
116 const Numeric t = t_field(i, j, k);
117 if (t > TEMP_0_C || only_liquid) {
118 water_p_eq_field(i, j, k) =
119 exp(54.842763 - 6763.22 / t - 4.21 * log(t) + 0.000367 * t +
120 tanh(0.0415 * (t - 218.8)) *
121 (53.878 - 1331.22 / t - 9.44523 * log(t) + 0.014025 * t));
122 } else {
123 water_p_eq_field(i, j, k) =
124 exp(9.550426 - 5723.265 / t + 3.53068 * log(t) - 0.00728332 * t);
125 }
126 }
127 }
128 }
129}
The global header file for ARTS.
Constants of physical expressions as constexpr.
void water_p_eq_fieldMK05(Tensor3 &water_p_eq_field, const Tensor3 &t_field, const Index &only_liquid, const Verbosity &)
WORKSPACE METHOD: water_p_eq_fieldMK05.
Definition m_physics.cc:103
void MatrixPlanck(Matrix &m, const Index &stokes_dim, const Vector &f, const Numeric &t, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixPlanck.
Definition m_physics.cc:56
void MatrixUnitIntensity(Matrix &m, const Index &stokes_dim, const Vector &f, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixUnitIntensity.
Definition m_physics.cc:79
constexpr Numeric COSMIC_BG_TEMP
Definition m_physics.cc:31
constexpr Numeric TEMP_0_C
Definition m_physics.cc:30
void MatrixCBR(Matrix &m, const Index &stokes_dim, const Vector &f, const Verbosity &)
WORKSPACE METHOD: MatrixCBR.
Definition m_physics.cc:38
Declarations having to do with the four output streams.
#define CREATE_OUT2
Definition messages.h:188
constexpr Numeric cosmic_microwave_background_temperature
Global constant, Planck temperature for cosmic background radiation [K].
constexpr Numeric temperature_at_0c
Global constant, Temperature in Celsius of 0 Kelvin.
Numeric planck(const Numeric &f, const Numeric &t)
planck
This file contains declerations of functions of physical character.