ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_sbm::SBMPhysicalBoundaryConfig Struct Reference

#include <ERF_SBMPhysicalBoundary.H>

Collaboration diagram for erf_sbm::SBMPhysicalBoundaryConfig:

Public Member Functions

bool all_periodic () const noexcept
 
bool periodic_in (int dir) const noexcept
 
std::string identity () const
 
bool has_inflow_or_outflow_face () const noexcept
 

Public Attributes

std::array< AdvectionFaceKind, physical_face_count > kind {}
 
std::array< std::vector< amrex::Real >, physical_face_count > inflow_z
 
std::array< erf_auxiliary::DiffusionFaceKind, physical_face_count > diffusion {}
 

Detailed Description

Spectral advection category and constant inflow spectrum of each domain face, indexed by amrex::Orientation. Inflow values are dry-air-relative z = U / rho_d for every layout component. diffusion is the face's particle-mixing semantics, which follows ERF's own scalar diffusion there: an ERF inflow face exchanges with the inflow spectrum, an inflow_outflow face does so where the carrier is inward, and every other face is closed.

Member Function Documentation

◆ all_periodic()

bool erf_sbm::SBMPhysicalBoundaryConfig::all_periodic ( ) const
noexcept
21 {
22  for (const auto face_kind : kind) {
23  if (face_kind != AdvectionFaceKind::Periodic) return false;
24  }
25  return true;
26 }
std::array< AdvectionFaceKind, physical_face_count > kind
Definition: ERF_SBMPhysicalBoundary.H:30

Referenced by identity().

Here is the caller graph for this function:

◆ has_inflow_or_outflow_face()

bool erf_sbm::SBMPhysicalBoundaryConfig::has_inflow_or_outflow_face ( ) const
noexcept

Whether any face is neither periodic nor a wall.

38 {
39  for (const auto face_kind : kind) {
40  if (face_kind != AdvectionFaceKind::Periodic &&
42  return true;
43  }
44  }
45  return false;
46 }

Referenced by erf_sbm::particle_mixing_schema().

Here is the caller graph for this function:

◆ identity()

std::string erf_sbm::SBMPhysicalBoundaryConfig::identity ( ) const

Restart-schema line; an all-periodic configuration keeps the M4b identity.

50 {
51  if (all_periodic()) return "boundary=triply-periodic-v1";
52  std::ostringstream line;
53  line << "boundary=physical-faces-v1";
54  for (const int face : identity_order) {
55  const auto face_kind = kind[static_cast<std::size_t>(face)];
56  line << ';' << face_name(face) << '=' << face_kind_name(face_kind);
57  if (face_kind == AdvectionFaceKind::PrescribedInflow) {
58  line << '[';
59  const auto& values = inflow_z[static_cast<std::size_t>(face)];
60  for (std::size_t n = 0; n < values.size(); ++n) {
61  line << (n == 0 ? "" : ",") << canonical_real(values[n]);
62  }
63  line << ']';
64  }
65  }
66  return line.str();
67 }
std::string canonical_real(const amrex::Real value, const bool allow_unbounded_nan=false)
Definition: ERF_SBMCanonicalIdentity.H:28
const char * face_kind_name(const AdvectionFaceKind kind) noexcept
Definition: ERF_SBMPhysicalBoundary.cpp:78
const char * face_name(const int face) noexcept
Definition: ERF_SBMPhysicalBoundary.cpp:70
bool all_periodic() const noexcept
Definition: ERF_SBMPhysicalBoundary.cpp:20
std::array< std::vector< amrex::Real >, physical_face_count > inflow_z
Definition: ERF_SBMPhysicalBoundary.H:31
Here is the call graph for this function:

◆ periodic_in()

bool erf_sbm::SBMPhysicalBoundaryConfig::periodic_in ( int  dir) const
noexcept
30 {
31  return kind[static_cast<std::size_t>(dir)] == AdvectionFaceKind::Periodic &&
32  kind[static_cast<std::size_t>(dir + AMREX_SPACEDIM)] ==
34 }

Member Data Documentation

◆ diffusion

◆ inflow_z

std::array<std::vector<amrex::Real>, physical_face_count> erf_sbm::SBMPhysicalBoundaryConfig::inflow_z

Referenced by identity().

◆ kind


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