2 #include <configure.hpp>
5 #include <athena/coordinates/coordinates.hpp>
6 #include <athena/hydro/hydro.hpp>
7 #include <athena/mesh/mesh.hpp>
8 #include <athena/reconstruct/interpolation.hpp>
9 #include <athena/scalars/scalars.hpp>
10 #include <athena/stride_iterator.hpp>
39 std::vector<Real> mypmom(1 + npmom);
41 for (
int i = 0; i < ac.size(); ++i) {
47 for (
int m = 0; m < nspec; ++m) {
48 auto& spec =
pgrid_->spec[m];
49 Real kcoeff =
a->GetAttenuation(spec.wav1, spec.wav2, air);
51 a->GetSingleScatteringAlbedo(spec.wav1, spec.wav2, air) * kcoeff;
57 a->GetPhaseMomentum(mypmom.data(), spec.wav1, spec.wav2, air, npmom);
58 for (
int p = 0;
p <= npmom; ++
p)
pmom_(m, i,
p) += mypmom[
p] * dssalb;
64 int il = 0, iu = ac.size() - 1;
67 for (
int i = il + 2; i <= iu - 1; ++i)
73 for (
int m = 0; m < nspec; ++m) {
74 for (
int i = 0; i < ac.size(); ++i) {
76 for (
int p = 0;
p <= npmom; ++
p)
pmom_(m, i,
p) /=
ssa_(m, i);
81 for (
int p = 1;
p <= npmom; ++
p)
pmom_(m, i,
p) = 0.;
85 Real H0 = pcoord->GetPressureScaleHeight();
86 Real
Rgas = pthermo->RovRd(ac[i]) * pthermo->GetRd();
89 tau_(m, i) *= pcoord->dx1f(i) * (
Rgas *
tem_[i]) / (grav * H0);
91 tau_(m, i) *= pcoord->dx1f(i);
97 for (
int i = 0; i < ac.size(); ++i) {
100 for (
int p = 0;
p <= npmom; ++
p)
bpmom(
p, k,
j, i) = 0.;
102 for (
int m = 0; m < nspec; ++m) {
105 for (
int p = 0;
p <= npmom; ++
p)
111 btau(k,
j, i) /= nspec;
std::vector< AirParcel > AirColumn
std::vector< Real > temf_
temperature at cell boundary (face)
AthenaArray< Real > bpmom
band phase function moments
AthenaArray< Real > pmom_
spectral bin phase function moments
std::shared_ptr< SpectralGridBase > pgrid_
spectral grid
AthenaArray< Real > btau
band optical depth
AthenaArray< Real > ssa_
spectral bin single scattering albedo
std::vector< Real > tem_
temperature at cell center
std::vector< std::shared_ptr< Absorber > > absorbers_
all absorbers
void SetSpectralProperties(AirColumn &air, Coordinates const *pcoord, Real grav, int k, int j)
Set spectral properties for an air column.
AthenaArray< Real > tau_
spectral bin optical depth
size_t GetNumPhaseMoments() const
Get number of phase function moments.
size_t GetNumSpecGrids() const
Get number of spectral grids.
AthenaArray< Real > bssa
band single scattering albedo
static Thermodynamics const * GetInstance()
Return a pointer to the one and only instance of Thermodynamics.