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

#include <ERF_MaterialProperties.H>

Inheritance diagram for MaterialPropertiesCore:
Collaboration diagram for MaterialPropertiesCore:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real molarHeatCapacity (const amrex::Real a_T) const
 Return the molar heat capacity. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real surfaceTension (const amrex::Real a_T) const
 Compute the surface tension coeff given temperature. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real coeffCurv (const amrex::Real a_T) const
 Return the coeff of curvature given the temperature. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real coeffVPSolute () const
 Return the vapour pressure coefficient. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real coeffMolecularDiffusion (const amrex::Real a_T, const amrex::Real a_P) const
 Return the molecular diffusion coefficient given temperature and pressure. More...
 

Public Attributes

amrex::Real m_density = std::numeric_limits<double>::max()
 
amrex::Real m_ionization = std::numeric_limits<double>::max()
 
amrex::Real m_mol_weight = std::numeric_limits<double>::max()
 
amrex::Real m_lat_vap = std::numeric_limits<double>::max()
 
amrex::Real m_Rv = std::numeric_limits<double>::max()
 
amrex::Real m_Tc = std::numeric_limits<double>::max()
 
amrex::Real m_Tb = std::numeric_limits<double>::max()
 
amrex::Real m_Nav_by_molweight = std::numeric_limits<float>::max()
 
amrex::Real m_mol_Cp_coeffs [7]
 
bool m_is_soluble = false
 
bool m_is_water = false
 

Static Public Attributes

static constexpr amrex::Real s_N_av = amrex::Real(6.02214076e23)
 
static constexpr amrex::Real s_kb = amrex::Real(1.380649e-23)
 
static constexpr amrex::Real s_mol_weight_air = amrex::Real(0.0289647)
 
static constexpr amrex::Real s_sigma_air = amrex::Real(3.62e-10)
 
static constexpr amrex::Real s_eps_air_k = 97
 

Member Function Documentation

◆ coeffCurv()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real MaterialPropertiesCore::coeffCurv ( const amrex::Real  a_T) const
inline

Return the coeff of curvature given the temperature.

119  {
120  auto surf_tens = surfaceTension(a_T);
121  auto retval = 2 * surf_tens / (m_Rv * m_density);
122  return retval;
123  }
amrex::Real m_Rv
Definition: ERF_MaterialProperties.H:73
amrex::Real m_density
Definition: ERF_MaterialProperties.H:69
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real surfaceTension(const amrex::Real a_T) const
Compute the surface tension coeff given temperature.
Definition: ERF_MaterialProperties.H:104
Here is the call graph for this function:

◆ coeffMolecularDiffusion()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real MaterialPropertiesCore::coeffMolecularDiffusion ( const amrex::Real  a_T,
const amrex::Real  a_P 
) const
inline

Return the molecular diffusion coefficient given temperature and pressure.

139  {
140  if (m_is_water) {
141 
142  return diffelq; // from ERF_Constants.H (amrex::Real(2.21e-05) [m^2 s^{-1}])
143 
144  } else {
145 
146  auto mol_weight_v = s_N_av/m_Nav_by_molweight;
147  auto sigma = amrex::Real(1.18e-8) * std::cbrt(mol_weight_v/m_density);
148  auto sigma_v_air = myhalf * (sigma + s_sigma_air);
149 
150  auto eps_v = amrex::Real(1.15) * m_Tb * s_kb;
151  auto eps_v_air = std::sqrt( eps_v * s_eps_air_k * s_kb);
152  auto T_star = a_T / (eps_v_air/s_kb);
153 
154  auto omegaD = amrex::Real(1.06036) / std::pow(T_star, amrex::Real(0.1561))
155  + amrex::Real(0.193) / std::exp(amrex::Real(0.47635)*T_star)
156  + amrex::Real(1.03587) / std::exp(amrex::Real(1.52996)*T_star)
157  + amrex::Real(1.76474) / std::exp(amrex::Real(3.89411)*T_star);
158 
159  auto term1 = 3 * std::sqrt( s_kb*a_T * s_kb*a_T * s_kb*a_T);
160  auto term2 = amrex::Real(8.0) * std::sqrt(2*PI) * a_P * sigma_v_air*sigma_v_air * omegaD;
161  auto term3 = std::sqrt( m_Nav_by_molweight + s_N_av/s_mol_weight_air );
162 
163  auto retval = term1*term3/term2;
164  return retval;
165  }
166  }
constexpr amrex::Real diffelq
Definition: ERF_Constants.H:84
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
constexpr amrex::Real PI
Definition: ERF_Constants.H:16
amrex::Real sigma
Definition: ERF_InitCustomPert_DataAssimilation_ISV.H:11
amrex::Real Real
Definition: ERF_ShocInterface.H:19
bool m_is_water
Definition: ERF_MaterialProperties.H:87
static constexpr amrex::Real s_sigma_air
Definition: ERF_MaterialProperties.H:55
static constexpr amrex::Real s_mol_weight_air
Definition: ERF_MaterialProperties.H:53
static constexpr amrex::Real s_kb
Definition: ERF_MaterialProperties.H:50
static constexpr amrex::Real s_eps_air_k
Definition: ERF_MaterialProperties.H:57
amrex::Real m_Nav_by_molweight
Definition: ERF_MaterialProperties.H:76
amrex::Real m_Tb
Definition: ERF_MaterialProperties.H:75
static constexpr amrex::Real s_N_av
Definition: ERF_MaterialProperties.H:49

◆ coeffVPSolute()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real MaterialPropertiesCore::coeffVPSolute ( ) const
inline

Return the vapour pressure coefficient.

128  {
129  auto retval = (amrex::Real(0.75)/PI)*(m_mol_weight/m_density);
130  if (m_is_water) {
131  retval = amrex::Real(4.3e-06);
132  }
133  return retval;
134  }
amrex::Real m_mol_weight
Definition: ERF_MaterialProperties.H:71

◆ molarHeatCapacity()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real MaterialPropertiesCore::molarHeatCapacity ( const amrex::Real  a_T) const
inline

Return the molar heat capacity.

92  {
93  auto retval = zero;
94  auto term = one;
95  for (auto i = 0; i < 7; i++) {
96  retval += (m_mol_Cp_coeffs[i] * term);
97  term *= a_T;
98  }
99  return retval;
100  }
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
amrex::Real m_mol_Cp_coeffs[7]
Definition: ERF_MaterialProperties.H:79

Referenced by surfaceTension().

Here is the caller graph for this function:

◆ surfaceTension()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real MaterialPropertiesCore::surfaceTension ( const amrex::Real  a_T) const
inline

Compute the surface tension coeff given temperature.

105  {
106  if (m_is_water) {
107  return amrex::Real(0.076148325); // N m^{-1}
108  } else {
109  auto term1 = amrex::Real(6.0) * std::cbrt(s_N_av);
110  auto term2 = std::cbrt((m_density/m_mol_weight)*(m_density/m_mol_weight));
111  auto retval = molarHeatCapacity(a_T)*(term2/term1)*(m_Tc - a_T);
112  return retval;
113  }
114  }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real molarHeatCapacity(const amrex::Real a_T) const
Return the molar heat capacity.
Definition: ERF_MaterialProperties.H:91
amrex::Real m_Tc
Definition: ERF_MaterialProperties.H:74

Referenced by coeffCurv().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_density

amrex::Real MaterialPropertiesCore::m_density = std::numeric_limits<double>::max()

◆ m_ionization

amrex::Real MaterialPropertiesCore::m_ionization = std::numeric_limits<double>::max()

◆ m_is_soluble

bool MaterialPropertiesCore::m_is_soluble = false

is soluble in water?

Referenced by MaterialProperties::MaterialProperties().

◆ m_is_water

bool MaterialPropertiesCore::m_is_water = false

◆ m_lat_vap

amrex::Real MaterialPropertiesCore::m_lat_vap = std::numeric_limits<double>::max()

latent heat of vaporization

Referenced by MaterialProperties::MaterialProperties(), and MaterialProperties::print().

◆ m_mol_Cp_coeffs

amrex::Real MaterialPropertiesCore::m_mol_Cp_coeffs[7]
Initial value:
= { amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX),
amrex::Real(DBL_MAX) }

vector of molar heat capacity polynomial coeffs

Referenced by MaterialProperties::MaterialProperties(), molarHeatCapacity(), and MaterialProperties::print().

◆ m_mol_weight

amrex::Real MaterialPropertiesCore::m_mol_weight = std::numeric_limits<double>::max()

◆ m_Nav_by_molweight

amrex::Real MaterialPropertiesCore::m_Nav_by_molweight = std::numeric_limits<float>::max()

Avogadro number by vapour mol. weight

Referenced by coeffMolecularDiffusion(), MaterialProperties::MaterialProperties(), and MaterialProperties::print().

◆ m_Rv

amrex::Real MaterialPropertiesCore::m_Rv = std::numeric_limits<double>::max()

gas constant for vapour of this material

Referenced by coeffCurv(), MaterialProperties::MaterialProperties(), and MaterialProperties::print().

◆ m_Tb

amrex::Real MaterialPropertiesCore::m_Tb = std::numeric_limits<double>::max()

◆ m_Tc

amrex::Real MaterialPropertiesCore::m_Tc = std::numeric_limits<double>::max()

critical temperature for surface tension

Referenced by MaterialProperties::MaterialProperties(), MaterialProperties::print(), and surfaceTension().

◆ s_eps_air_k

constexpr amrex::Real MaterialPropertiesCore::s_eps_air_k = 97
staticconstexpr

Temperature parameter for air [K]

Referenced by coeffMolecularDiffusion().

◆ s_kb

constexpr amrex::Real MaterialPropertiesCore::s_kb = amrex::Real(1.380649e-23)
staticconstexpr

Boltzmann constant [J K^{-1}]

Referenced by coeffMolecularDiffusion().

◆ s_mol_weight_air

constexpr amrex::Real MaterialPropertiesCore::s_mol_weight_air = amrex::Real(0.0289647)
staticconstexpr

Molecular weight of air [kg mol^{-1}]

Referenced by coeffMolecularDiffusion().

◆ s_N_av

constexpr amrex::Real MaterialPropertiesCore::s_N_av = amrex::Real(6.02214076e23)
staticconstexpr

Avogadro's number

Referenced by coeffMolecularDiffusion(), and surfaceTension().

◆ s_sigma_air

constexpr amrex::Real MaterialPropertiesCore::s_sigma_air = amrex::Real(3.62e-10)
staticconstexpr

Molecular length scale of air [m]

Referenced by coeffMolecularDiffusion().


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