Canoe
Comprehensive Atmosphere N' Ocean Engine
RadiationBand Class Reference

#include <radiation_band.hpp>

Inheritance diagram for RadiationBand:
[legend]

Classes

class  RTSolver
 
class  RTSolverLambert
 

Public Member Functions

 RadiationBand (std::string name, YAML::Node const &rad)
 
virtual ~RadiationBand ()
 
void Resize (int nc1, int nc2=1, int nc3=1, int nstr=8)
 Allocate memory for radiation band. More...
 
void ResizeSolver (int nlyr, int nstr=8, int nuphi=1, int numu=1)
 Allocate memory for radiation solver. More...
 
std::shared_ptr< RTSolverCreateRTSolverFrom (std::string const &name, YAML::Node const &rad)
 Create radiative transfer solver from YAML node. More...
 
size_t GetNumSpecGrids () const
 Get number of spectral grids. More...
 
size_t GetNumAbsorbers () const
 Get number of absorbers. More...
 
size_t GetNumPhaseMoments () const
 Get number of phase function moments. More...
 
size_t GetNumLayers () const
 Get number of phase function moments. More...
 
std::pair< Real, Real > GetRange () const
 Get range of wavenumbers. More...
 
std::shared_ptr< AbsorberGetAbsorber (int i)
 Get an individual absorber. More...
 
std::shared_ptr< AbsorberGetAbsorberByName (std::string const &name)
 Get an individual absorber by name. More...
 
size_t GetNumOutgoingRays ()
 Get number of outgoing rays. More...
 
Real GetCosinePolarAngle (int n) const
 Get cosine polar angle of the outgoing ray. More...
 
Real GetAzimuthalAngle (int n) const
 Get azimuthal angle of the outgoing ray. More...
 
void SetSpectralProperties (AirColumn &air, Coordinates const *pcoord, Real grav, int k, int j)
 Set spectral properties for an air column. More...
 
void CalBandFlux (MeshBlock const *pmb, int k, int j, int il, int iu)
 Calculate band radiative fluxes. More...
 
void CalBandRadiance (MeshBlock const *pmb, int k, int j)
 Calculate band radiances. More...
 
void SetOutgoingRays (std::vector< Direction > const &ray)
 Set outgoing ray directions. More...
 
void WriteAsciiHeader (OutputParameters const *) const override
 
void WriteAsciiData (OutputParameters const *) const override
 
void PackTemperature ()
 Pack temperature at cell face into send buffer 0. More...
 
bool UnpackTemperature (void *arg)
 Unpack temperature at cell face from receive buffer 0. More...
 
void PackSpectralGrid (int b)
 Pack data in spectral grid b into send buffer 1. More...
 
bool UnpackSpectralGrid (void *arg)
 Unpack data from receive buffer 1 into spectral grid b. More...
 
void Transfer (MeshBlock const *pmb, int n) override
 
- Public Member Functions inherited from NamedGroup
 NamedGroup (std::string name)
 
virtual ~NamedGroup ()
 
std::string GetName () const
 
- Public Member Functions inherited from FlagGroup
 FlagGroup (uint64_t flags=0LL)
 
virtual ~FlagGroup ()
 
int TestFlag (uint64_t flag) const
 
void SetFlag (uint64_t flag)
 
- Public Member Functions inherited from ParameterGroup
virtual ~ParameterGroup ()
 
void SetRealsFrom (YAML::Node const &node)
 
void SetPar (std::string const &name, Real value)
 Set real parameter. More...
 
void SetPar (std::string const &name, int value)
 Set int parameter. More...
 
void SetPar (std::string const &name, std::string const &value)
 Set string parameter. More...
 
template<typename T >
GetPar (std::string const &name) const
 Get parameter. More...
 
bool HasPar (std::string const &name) const
 Check if a parameter exists. More...
 
template<>
int GetPar (std::string const &name) const
 
template<>
Real GetPar (std::string const &name) const
 
- Public Member Functions inherited from ASCIIOutputGroup
virtual ~ASCIIOutputGroup ()
 
- Public Member Functions inherited from LinearExchanger< RadiationBand >
 LinearExchanger ()
 
int GetRankInGroup () const
 
void Regroup (MeshBlock const *pmb, CoordinateDirection dir)
 
- Public Member Functions inherited from Exchanger< T >
 Exchanger ()
 
virtual ~Exchanger ()
 
virtual void ClearBuffer (MeshBlock const *pmb)
 Clear buffer. More...
 
void SetBoundaryStatus (int bid, BoundaryStatus status)
 Set the boundary status. More...
 
- Public Member Functions inherited from ExchangerBase
 ExchangerBase ()
 
virtual ~ExchangerBase ()
 
virtual void PackData (MeshBlock const *pmb)
 Pack data to send buffer. More...
 
virtual bool UnpackData (MeshBlock const *pmb)
 Unpack data from receive buffer. More...
 

Public Attributes

AthenaArray< Real > btau
 band optical depth More...
 
AthenaArray< Real > bssa
 band single scattering albedo More...
 
AthenaArray< Real > bpmom
 band phase function moments More...
 
AthenaArray< Real > bflxup
 band upward flux More...
 
AthenaArray< Real > bflxdn
 band downward flux More...
 
AthenaArray< Real > btoa
 band top-of-the-atmosphere radiance More...
 

Protected Attributes

std::shared_ptr< RTSolverpsolver_
 radiative transfer solver More...
 
std::shared_ptr< SpectralGridBasepgrid_
 spectral grid More...
 
std::pair< Real, Real > wrange_
 identify wave- number (wavelength, frequency) range More...
 
std::vector< std::shared_ptr< Absorber > > absorbers_
 all absorbers More...
 
std::vector< DirectionrayOutput_
 outgoing rays More...
 
AthenaArray< Real > tau_
 spectral bin optical depth More...
 
AthenaArray< Real > ssa_
 spectral bin single scattering albedo More...
 
AthenaArray< Real > toa_
 spectral bin top-of-the-atmosphere radiance More...
 
AthenaArray< Real > flxup_
 spectral bin upward flux More...
 
AthenaArray< Real > flxdn_
 spectral bin downward flux More...
 
AthenaArray< Real > pmom_
 spectral bin phase function moments More...
 
std::vector< Real > tem_
 temperature at cell center More...
 
std::vector< Real > temf_
 temperature at cell boundary (face) More...
 
- Protected Attributes inherited from Exchanger< T >
enum BoundaryStatus status_flag_ [MessageTraits< T >::num_buffers]
 
BufferType send_buffer_ [MessageTraits< T >::num_buffers]
 
BufferType recv_buffer_ [MessageTraits< T >::num_buffers]
 

Additional Inherited Members

- Public Types inherited from LinearExchanger< RadiationBand >
using Base = Exchanger< RadiationBand >
 
- Public Types inherited from Exchanger< T >
using DataType = typename MessageTraits< T >::DataType
 
using BufferType = std::vector< DataType >
 

Detailed Description

Definition at line 32 of file radiation_band.hpp.

Constructor & Destructor Documentation

◆ RadiationBand()

RadiationBand::RadiationBand ( std::string  name,
YAML::Node const &  rad 
)

Definition at line 37 of file radiation_band.cpp.

◆ ~RadiationBand()

RadiationBand::~RadiationBand ( )
virtual

Definition at line 80 of file radiation_band.cpp.

Member Function Documentation

◆ Resize()

void RadiationBand::Resize ( int  nc1,
int  nc2 = 1,
int  nc3 = 1,
int  nstr = 8 
)

Allocate memory for radiation band.

Note
btoa, bflxup, bflxdn are shallow slices to Radiation variables

Definition at line 85 of file radiation_band.cpp.

◆ ResizeSolver()

void RadiationBand::ResizeSolver ( int  nlyr,
int  nstr = 8,
int  nuphi = 1,
int  numu = 1 
)

Allocate memory for radiation solver.

Definition at line 116 of file radiation_band.cpp.

◆ CreateRTSolverFrom()

std::shared_ptr< RadiationBand::RTSolver > RadiationBand::CreateRTSolverFrom ( std::string const &  name,
YAML::Node const &  rad 
)

Create radiative transfer solver from YAML node.

Parameters
[in]radYAML node containing whole radiation configuration

Definition at line 215 of file radiation_band.cpp.

◆ GetNumSpecGrids()

size_t RadiationBand::GetNumSpecGrids ( ) const
inline

Get number of spectral grids.

Definition at line 81 of file radiation_band.hpp.

◆ GetNumAbsorbers()

size_t RadiationBand::GetNumAbsorbers ( ) const
inline

Get number of absorbers.

Definition at line 84 of file radiation_band.hpp.

◆ GetNumPhaseMoments()

size_t RadiationBand::GetNumPhaseMoments ( ) const
inline

Get number of phase function moments.

Definition at line 87 of file radiation_band.hpp.

◆ GetNumLayers()

size_t RadiationBand::GetNumLayers ( ) const
inline

Get number of phase function moments.

Definition at line 90 of file radiation_band.hpp.

◆ GetRange()

std::pair<Real, Real> RadiationBand::GetRange ( ) const
inline

Get range of wavenumbers.

Definition at line 93 of file radiation_band.hpp.

◆ GetAbsorber()

std::shared_ptr<Absorber> RadiationBand::GetAbsorber ( int  i)
inline

Get an individual absorber.

Definition at line 96 of file radiation_band.hpp.

◆ GetAbsorberByName()

AbsorberPtr RadiationBand::GetAbsorberByName ( std::string const &  name)

Get an individual absorber by name.

Definition at line 120 of file radiation_band.cpp.

◆ GetNumOutgoingRays()

size_t RadiationBand::GetNumOutgoingRays ( )
inline

Get number of outgoing rays.

Definition at line 102 of file radiation_band.hpp.

◆ GetCosinePolarAngle()

Real RadiationBand::GetCosinePolarAngle ( int  n) const
inline

Get cosine polar angle of the outgoing ray.

Definition at line 105 of file radiation_band.hpp.

◆ GetAzimuthalAngle()

Real RadiationBand::GetAzimuthalAngle ( int  n) const
inline

Get azimuthal angle of the outgoing ray.

Definition at line 108 of file radiation_band.hpp.

◆ SetSpectralProperties()

void RadiationBand::SetSpectralProperties ( AirColumn air,
Coordinates const *  pcoord,
Real  grav,
int  k,
int  j 
)

Set spectral properties for an air column.

Parameters
[in]airmole fraction representation of air column
[in]pcoordcoordinates
[in]gravgravitational acceleration
[in]khorizontal index
[in]jhorizontal index

Definition at line 28 of file set_spectral_properties.cpp.

◆ CalBandFlux()

void RadiationBand::CalBandFlux ( MeshBlock const *  pmb,
int  k,
int  j,
int  il,
int  iu 
)

Calculate band radiative fluxes.

Definition at line 132 of file radiation_band.cpp.

◆ CalBandRadiance()

void RadiationBand::CalBandRadiance ( MeshBlock const *  pmb,
int  k,
int  j 
)

Calculate band radiances.

Definition at line 144 of file radiation_band.cpp.

◆ SetOutgoingRays()

void RadiationBand::SetOutgoingRays ( std::vector< Direction > const &  ray)
inline

Set outgoing ray directions.

Parameters
[in]rayOutputoutgoing ray directions

Definition at line 130 of file radiation_band.hpp.

◆ WriteAsciiHeader()

void RadiationBand::WriteAsciiHeader ( OutputParameters const *  pout) const
overridevirtual

Implements ASCIIOutputGroup.

Definition at line 155 of file radiation_band.cpp.

◆ WriteAsciiData()

void RadiationBand::WriteAsciiData ( OutputParameters const *  pout) const
overridevirtual

Implements ASCIIOutputGroup.

Definition at line 189 of file radiation_band.cpp.

◆ PackTemperature()

void RadiationBand::PackTemperature ( )

Pack temperature at cell face into send buffer 0.

Definition at line 18 of file radiation_band_exchanger.cpp.

◆ UnpackTemperature()

bool RadiationBand::UnpackTemperature ( void *  arg)

Unpack temperature at cell face from receive buffer 0.

Definition at line 23 of file radiation_band_exchanger.cpp.

◆ PackSpectralGrid()

void RadiationBand::PackSpectralGrid ( int  b)

Pack data in spectral grid b into send buffer 1.

Parameters
[in]bspectral bin index

Definition at line 46 of file radiation_band_exchanger.cpp.

◆ UnpackSpectralGrid()

bool RadiationBand::UnpackSpectralGrid ( void *  arg)

Unpack data from receive buffer 1 into spectral grid b.

Definition at line 63 of file radiation_band_exchanger.cpp.

◆ Transfer()

void RadiationBand::Transfer ( MeshBlock const *  pmb,
int  n 
)
overridevirtual
Bug:
only work for one block per process

Implements ExchangerBase.

Definition at line 107 of file radiation_band_exchanger.cpp.

Member Data Documentation

◆ btau

AthenaArray<Real> RadiationBand::btau

band optical depth

Definition at line 44 of file radiation_band.hpp.

◆ bssa

AthenaArray<Real> RadiationBand::bssa

band single scattering albedo

Definition at line 47 of file radiation_band.hpp.

◆ bpmom

AthenaArray<Real> RadiationBand::bpmom

band phase function moments

Definition at line 50 of file radiation_band.hpp.

◆ bflxup

AthenaArray<Real> RadiationBand::bflxup

band upward flux

Definition at line 53 of file radiation_band.hpp.

◆ bflxdn

AthenaArray<Real> RadiationBand::bflxdn

band downward flux

Definition at line 56 of file radiation_band.hpp.

◆ btoa

AthenaArray<Real> RadiationBand::btoa

band top-of-the-atmosphere radiance

This is a shallow reference to radiance in Radiation

Definition at line 61 of file radiation_band.hpp.

◆ psolver_

std::shared_ptr<RTSolver> RadiationBand::psolver_
protected

radiative transfer solver

Definition at line 155 of file radiation_band.hpp.

◆ pgrid_

std::shared_ptr<SpectralGridBase> RadiationBand::pgrid_
protected

spectral grid

Definition at line 158 of file radiation_band.hpp.

◆ wrange_

std::pair<Real, Real> RadiationBand::wrange_
protected

identify wave- number (wavelength, frequency) range

Definition at line 161 of file radiation_band.hpp.

◆ absorbers_

std::vector<std::shared_ptr<Absorber> > RadiationBand::absorbers_
protected

all absorbers

Definition at line 164 of file radiation_band.hpp.

◆ rayOutput_

std::vector<Direction> RadiationBand::rayOutput_
protected

outgoing rays

Definition at line 167 of file radiation_band.hpp.

◆ tau_

AthenaArray<Real> RadiationBand::tau_
protected

spectral bin optical depth

This is a two-dimensional array. The first dimension is the size of the spectral bin and the second dimension is the size of the vertical dimension.

Definition at line 174 of file radiation_band.hpp.

◆ ssa_

AthenaArray<Real> RadiationBand::ssa_
protected

spectral bin single scattering albedo

This is a two-dimensional array. The first dimension is the size of the spectral bin and the second dimension is the size of the vertical dimension.

Definition at line 181 of file radiation_band.hpp.

◆ toa_

AthenaArray<Real> RadiationBand::toa_
protected

spectral bin top-of-the-atmosphere radiance

This is a two-dimensional array. The first dimension is the size of the spectral bin and the second dimension is the size of the vertical dimension.

Definition at line 188 of file radiation_band.hpp.

◆ flxup_

AthenaArray<Real> RadiationBand::flxup_
protected

spectral bin upward flux

This is a two-dimensional array. The first dimension is the size of the spectral bin and the second dimension is the size of the vertical dimension.

Definition at line 195 of file radiation_band.hpp.

◆ flxdn_

AthenaArray<Real> RadiationBand::flxdn_
protected

spectral bin downward flux

This is a two-dimensional array. The first dimension is the size of the spectral bin and the second dimension is the size of the vertical dimension.

Definition at line 202 of file radiation_band.hpp.

◆ pmom_

AthenaArray<Real> RadiationBand::pmom_
protected

spectral bin phase function moments

This is a three-dimensional array. The first dimension is the size of the spectral bin. The second dimension is the size of the vertical dimension. The third dimension is the size of the phase function moments (1 + npmom).

Definition at line 209 of file radiation_band.hpp.

◆ tem_

std::vector<Real> RadiationBand::tem_
protected

temperature at cell center

Definition at line 212 of file radiation_band.hpp.

◆ temf_

std::vector<Real> RadiationBand::temf_
protected

temperature at cell boundary (face)

Definition at line 215 of file radiation_band.hpp.


The documentation for this class was generated from the following files: