ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
surface_layer_stress Namespace Reference

Classes

struct  FaceStressResult
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real conservative_to_kinematic_stress (amrex::Real conservative_stress, amrex::Real rho)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool lsm_flux_is_valid (bool has_flux, bool is_land, amrex::Real flux, amrex::Real undefined)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FaceStressResult combine_lsm_and_most_stress (amrex::Real rho_low, amrex::Real rho_high, amrex::Real kinematic_low, amrex::Real kinematic_high, bool low_valid, bool high_valid, amrex::Real most_face_stress)
 

Function Documentation

◆ combine_lsm_and_most_stress()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE FaceStressResult surface_layer_stress::combine_lsm_and_most_stress ( amrex::Real  rho_low,
amrex::Real  rho_high,
amrex::Real  kinematic_low,
amrex::Real  kinematic_high,
bool  low_valid,
bool  high_valid,
amrex::Real  most_face_stress 
)

Combine cell-centered kinematic LSM stresses with a conservative MOST fallback stress at one face. The returned cache values are always kinematic, while face_stress is always conservative.

53 {
54  const amrex::Real half = amrex::Real(0.5);
55  FaceStressResult result{
56  amrex::Real(0.0),
57  low_valid ? kinematic_low
58  : conservative_to_kinematic_stress(most_face_stress, rho_low),
59  high_valid ? kinematic_high
60  : conservative_to_kinematic_stress(most_face_stress, rho_high)};
61 
62  if (low_valid && high_valid) {
63  result.face_stress =
64  half * rho_low * kinematic_low + half * rho_high * kinematic_high;
65  } else if (low_valid) {
66  result.face_stress =
67  half * rho_low * kinematic_low + half * most_face_stress;
68  } else if (high_valid) {
69  result.face_stress =
70  half * rho_high * kinematic_high + half * most_face_stress;
71  } else {
72  result.face_stress = most_face_stress;
73  }
74 
75  return result;
76 }
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real conservative_to_kinematic_stress(amrex::Real conservative_stress, amrex::Real rho)
Definition: ERF_SurfaceLayerStress.H:13

Referenced by SurfaceLayer::compute_SurfaceLayer_bcs().

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

◆ conservative_to_kinematic_stress()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real surface_layer_stress::conservative_to_kinematic_stress ( amrex::Real  conservative_stress,
amrex::Real  rho 
)

LSM cache value from a conservative face stress.

15 {
16  return conservative_stress / rho;
17 }
rho
Definition: ERF_InitCustomPert_Bubble.H:107

Referenced by combine_lsm_and_most_stress(), and SurfaceLayer::compute_SurfaceLayer_bcs().

Here is the caller graph for this function:

◆ lsm_flux_is_valid()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool surface_layer_stress::lsm_flux_is_valid ( bool  has_flux,
bool  is_land,
amrex::Real  flux,
amrex::Real  undefined 
)

Test one LSM side without coupling validity to another component's handle.

26 {
27  return has_flux && is_land && flux < undefined;
28 }

Referenced by surface_diagnostics::classify_scalar_source(), and SurfaceLayer::compute_SurfaceLayer_bcs().

Here is the caller graph for this function: